poplamatter.blogg.se

Interface psoc with adafruit trinket
Interface psoc with adafruit trinket









interface psoc with adafruit trinket

Hence, reading the data pin after the will directly provide the bit that was sent by the sensor. So, if the bit is ‘0’ then after 24 us the Data pin is low and if the bit is ‘1’ then after 24 us the Data pin is high. Therefore, the value of Data pin is read after a delay, greater than 24 us, which gives the value of the bit.If the sensor is transmitting a ‘1’ then it sends a 70 us high signal followed by the 54 us low signal of the next bit. If the sensor is transmitting a ‘0’ then it sends a 24 us high signal followed by the 54 us low signal of the next bit.This LOW to HIGH transition wakes up the CPU. To transmit a ‘0’ (Logic LOW), the sensor sends a 54 us low signal followed by a high signal.The interrupt is now enabled, and the CPU is put to sleep. The START condition is sent first and the ACK is checked.The interrupt is triggered at the rising edge of the Data pin which wakes the CPU. The first approach puts the CPU to sleep when not in use and makes use of the interrupt.The checksum is obtained by simply adding the first 4 bytes. The last byte contains the checksum and needs to be verified to ensure that the data received is valid. Logic 1 – 54 us low and 70 us high signalĤ0 bits are sent in a similar way after which the communication terminates.Logic 0 – 54 us low and 24 us high signal.Bit-level logic is represented as follows,

interface psoc with adafruit trinket

DATA – Data is sent serially in terms of bits. The sensor then sends a logic high for about 80 us and then starts sending Data to the PSoC MCU.ģ. ACKNOWLEDGMENT – The sensor detects the low pulse from the MCU and sends an acknowledgment signal by pulling the Data line low for approximately 54 us. An 18 ms low pulse is sent to the sensor.įigure 1: Communication protocol of sensorĢ. START – Start condition is sent by the PSoC 6 device. The communication protocol followed by the sensor is asynchronous with a START condition, ACKNOWLEDGEMENT and 5 bytes of Data.ġ. The Data pin should be configured as a bidirectional pin with drive mode set as Resistive Pull Up. Data pin acts as the asynchronous interface between the sensor and the PSoC device. The operating voltage of the sensor is 3.3V to 5V and thus Vcc is connected to 3.3V and Gnd to Ground of the kit. DHT11 sensor uses a resistive humidity measurement component and NTC temperature measurement component. DHT11 sensor provides relative humidity value in percentage (20 to 90% RH) and temperature values in degree Celsius (0 to 50 ☌). The PSoC Creator projects for the two applications are attached as part of this blog.ĭHT-11 is a single wire digital humidity and temperature sensor, which provides humidity and temperature values serially with one-wire protocol. This blog provides 2 ways to interface DHT-11 with PSoC 6 one using the interrupts and the other without. The sensor is manufactured by many companies one of which is Adafruit and the Adafruit sensor can be found here. Software/IDE – PSoC Creator 4.3 and PDL 3.1.1ĭHT-11 is a popular sensor to measure temperature and humidity.











Interface psoc with adafruit trinket