Summary of Arduino Temperature Sensor
This project describes a standalone temperature sensor system using four DHT-11 sensors connected to an ATMega 328 microcontroller with an Arduino bootloader and an ENC28J60 Ethernet module. The microcontroller reads temperature and humidity data periodically and serves it as JSON over HTTP on port 80 for easy internet access. The system runs on 3.3 volts supplied by an LM317 voltage regulator that steps down 5 volts from a USB charger. The sensors and microcontroller are housed in a project box suitable for mounting in a server rack, enabling remote monitoring via networked applications.
Parts used in the Standalone Temperature Sensor System:
- Four DHT-11 temperature and humidity sensors
- ATMega 328 microcontroller with Arduino bootloader
- ENC28J60 Ethernet module
- LM317 voltage regulator
- 10 µF capacitor (for clock stabilization)
- 10K ohm resistors (for pull-up on sensor outputs and RST line)
- 16 MHz crystal oscillator (clock for ATMega 328)
- Normally open push button switch (connected to reset)
- Project enclosure box
- USB phone charger (5 V power supply)
I previously worked on an enclosure for the Computer Club server rack, and I thought it would be a good idea to put together a standalone temperature sensor system. Preferably it would interface over the internet so that IRC bots and other programs could talk to it.
The project will use four DHT-11 temperature sensors, an ATMega 328 with an Arduino bootloader (for ease of programming), and an ENC28J60 ethernet module.
The microcontroller will take a temperature reading every few seconds, and when a connection comes in on its port 80, it will send back HTTP headers, text/json
, and JSON data for easy parsing, in the following format:
{
"sensor one": {
"humidity": "34",
"celcius": "25",
"fahrenheit": "77"
},
...
"sensor four": {
"humidity": "34",
"celcius": "24",
"fahrenheit": "75"
}
}
The sensors are not all that accurate, so I cast the floating point values generated by the Adafruit DHT library to integers for reporting.
Since this project will live in a server rack, it needs to be put in a project box. The DHT11 and ENC28J60 module both need 3.3 volts, and the ATMega will run on 3.3 volts, so I used an LM317 voltage regulator to knock down 5 volts from a USB phone charger to 3.3 volts.
Running an ATMega 328 by itself is pretty simple, it needs a 16 Mhz clock connected between pin 9 and 10, and both of those connected to ground through a 10 uF capacitor. The, connect VCC, AVCC and AREF to 3.3 volts, and use a 10K ohm resistor to pull up RST.
Then, connect both GND pins to ground, and hook up a normally open switch to RST to ground.
For the DHT11 modules, each of them needs to be connected to 3.3 volts and ground, and each of their sensor output pins is pulled up to 3.3 volts with a 10K ohm resistor.
Read More: Arduino Temperature Sensor