Outside temperature

What is it? questionmark

It is a very easy way to measure the temperature outside of my apartment. The protoboard is placed in a tupperware style box to protect against the rain and placed in the shadow part of my balcony.

In my Vera3 environment this looks like

Yes, it is winter here so the temperatures are correct

Eagle layout questionmark

OutsideTemperature

Most of the projects I use a Arduino Pro Mini, but for this one a Arduino Nano was used.
Note: I forgot to draw in the resistor for the ds18b20

Arduino code questionmark

All the code can be found on my github: https://github.com/timdows/AMD/tree/master/OutsideTemperature

OutsideTemperature.ino sets up the MySensor, DHTClass and Dallas objects.
At the setup all these objects’ Init methods are called and the gateways is forced to take the gateway as its parent in the begin method.
The getBatteryVoltage function is able to get an impression of the current battery status, as it is accurate to around 10%. This value is than divided by 50 (batteryVoltage * 100 / 5000) where I still have to measure maximum voltage when the battery pack is fully charged. The result is than send to the gateway via sendBatteryLevel.
In order to save the battery, gw.sleep is called with an interval of 5 minutes. This puts the radio and Arduino (in PowerDownMode) in sleep and wakes up on the timer interrupt.

The Dallas class reads the onewire pin with one or more sensors connected to it. This is done by the DallasTemperature and OneWire objects.
In order to create the objects oneWire and sensors without calling the constructor, I have created an empty constructor for those classes as it did not exist.

The DHTClass class reads the current values of its DHT11 sensor, this value is then send back via the mySensorGatweway.

End result questionmark

Top view with powerbank

Bottom view with powerbank

Connected the 5V pins directly, as the microchip of the charger would turn off when the Arduino went to sleep mode

TODO questionmark

  1. As the DHT11 also measures humidity, it should not be in a closed box outside (that is my current situation to protect against rain), figure out a way to get some better readings of the DHT11

Project costs in € or $ questionmark

Object Price
Arduino Nano $ 2.68
DHT11 $ 0.89
NRF24L01 $ 0.86
 DS18B20 $ 0.89
Powerbank $ 4.00
Other materials $ 2
Total $ 11.32

What could be better questionmark

  1. It took me a while to figure out how to measure the battery status. I have tried to use resistors in series and read it via an analog pin, but it always turned out to be the value 1023 (maximum value of analog pin). Only when I found that you could measure the bandgap I found http://provideyourown.com/2012/secret-arduino-voltmeter-measure-battery-voltage and implemented that example

7 thoughts on “Outside temperature

Leave a Reply

Your email address will not be published. Required fields are marked *