In this post, I'll present another ESP8266 chip based IO project which is digital thermometer with binary display. This is again an GPIO project with temperature sensor being an input pin; LEDs being output pins. If you have OLED Display Module, you can use that component to display the temperature.
Figure: Digital Thermometer Circuit and Temperature Sensor
Temperature sensor I used is "DS18B20 Temperature Sensor" having 3 wires. Red wire is for VCC(voltage) line, Black wire is Ground (0) and yellow wire is for data line. Yellow wire should be connected to the input pin of the chip. These devices are called as 1-Wire Devices as only 1 wire carries information (temperature info in our case) [1] .
I've used Temperature reading section of the code from [1] as is and modified according to this project requirements.
Figure: Digital Thermometer vs my circuitry
Setting Up Circuitry
- GPIO 16, GPIO 5, GPIO 4, GPIO 0, GPIO 2, GPIO 14 pins will be configured as Output pins being pin_D0, pin_D1, pin_D2, pin_D3, pin_D4, pin_D5 respectively.
- GPIO 12 will be configured as Input pin. Additionally, 4.7 K resistor should be connected between data pin (GPIO 12) and VCC line (I've used 5K resistor which will probably change the accuracy slightly) [1]
Test Environment
Chip Used: ESP8266 NodeMCU (Flash Size 4 MB)
Firmware Used: esp8266-20171101-v1.9.3.bin
Temperature Sensor: Waterproof Digital Temp Sensor DS18B20
Circuit Components: 1K Resistors, 5K Resistor (for Temp Sensor), LEDs, Button, Jumper Wires
REFERENCES
[1] https://docs.micropython.org/en/latest/esp8266/esp8266/tutorial/onewire.html
[2] https://github.com/mdemiray/MicroPython-TempSensor
Comments
Post a Comment