Weather station 2.0
Метеостанция 2.0
10
Project description
Author used HW below
- Arduino or Freeduino microcontroller (with ATmega328);
- Ethernet-shield Wiznet w5100;
- Digital temperature sensor DS18B20;
- Atmospheric pressure sensor BMP085;
- Humidity sensor DHT22;
- Resistor 4.7 kOhm;
- Resistor 5 kOhm.
DS18B20:
DHT22:
BMP085:
HW connection
Resistor R1 in the diagram is 4.7 kOhm, it is used to pull up the data line for the DS18B20 temperature sensor. Resistor R2 - 5 kΩ, pulls up the DHT22 data line. The temperature and humidity sensors are placed outdoors. I used a four-core telephone cable for this - it works great at a distance of 6 meters from the microcontroller. The pressure sensor is placed in the house. Due to the leakage of windows / doors, the atmospheric pressure outside and inside will be almost the same.
Perhaps someone will pay attention and ask the question: why is the DS18B20 connected using a three-wire circuit, and in the last article there were only two? The fact is that at that time I used a parasitic power supply for the temperature sensor. However, at large distances from the microcontroller, this may fail. Therefore, I recommend forcibly supplying power to the sensor.
If you don't have DHT22 or BMP085 sensors then just leave the corresponding Arduino pins unconnected. In the code, it will be necessary to correct only one or two lines.
Well, here's the code for the sketch:
Pay attention to lines 17-23:
- mac is the MAC address of the Arduino. This is your unique identifier on the people's monitoring site. Therefore, to protect against matches, I recommend using the MAC address of your computer / router / phone with the last byte changed (so that there is no collision within the local network).
- BMP085_EXIST - the presence of an atmospheric pressure sensor. Set to 0 if you don't have one.
- DHT_EXIST - the presence of a humidity sensor. Set to 0 if you don't have one.
- DS18B20_PIN - pin for connecting the DS18B20 temperature sensor.
- DHTPIN - DHT22 humidity sensor connection pin.
- DHTTYPE - type of humidity sensor: DHT22 or DHT11
- postingInterval - interval for posting readings. The default is 600000ms (10 minutes).
Weather Station 2.1
I am posting an updated version of the firmware for People's Monitoring. Added temperature reading from humidity and atmospheric pressure sensors. And now, if there is no connection to the network, the controller will wait for it to appear (it will help solve the problem of “freezing” after a power outage, when the router has not yet had time to start, and the arduino is already trying to get an IP address).
Everything about the connection is written in this article: http://19dx.ru/2014/07/meteostanciya-2-0/
Thanks to those who already wrote their solutions in the comments to the previous version (especially cephex ). Your path was right
Attention! The Arduino Leonardo has problems with the pressure sensor.






