What is it?
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
Eagle layout
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
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
TODO
- 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 $
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
- 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
Dear…
What is your battery time?
And what is the time u use between the reading/sending?
Great work! 🙂
Currently my sleeptime is 300000 (equals 5 minutes), this gives me a battery life of around 35 weeks.
The battery life drops 7% per 2.5 weeks.
I track this via datamine in my Vera3 environment
Hello!
Nice work! I made a similar circuit but I had a problem with low temperatures (-5°C). Did you have similar problems?