Mini Weather Station
-
else if (temperature != lastTemp)So I've been working with temperature sensors a while and I worry about comparing floats, and their notorious precision triggering a true here and superfluously affecting the rate of the radio updates. The DHT22 is accurate to about 1 Celsius degree, so it may be unnecessary to transmit a change if there is a change to temperature at any precision of less than 1.
maybe try something like:
if (temperature > lastTemp + 0.5 || temperature < lastTemp - 0.5) { doSomething(); lastTemp = temperature; }Would reduce transmissions and save battery?
same argument with your hygrometer and barometric pressure, but different level of precision. Not for the weather calculations, just for the decision to transmit updates, IMO.
all easy to test with your serial monitor.
@BulldogLowell Thanks, that looks like it is worth a try, or just round to 0.5 degree. I am also going to cut down the sample interval. After the 1min samples to average for the pressure, the rest of the time 5min is probably good enough.
-
@BulldogLowell Thanks, that looks like it is worth a try, or just round to 0.5 degree. I am also going to cut down the sample interval. After the 1min samples to average for the pressure, the rest of the time 5min is probably good enough.
maybe, but you may still have the same precision problem if you are using floats.
maybe just round and cast it to an int... DHT22 isn't precise to half a degree F or C...
int roundedTemperature = (int) floor(temperature + 0.5); if (roundedTemperature != lastTemperature) { doSomething(); lastTemperature = roundedTemperature; }more on floats and their precision...
-
-
@ jtm312
Dear..
Great project!
I print your station, very good quality!!!How is the battery?
Do you have options to reduce the power?
Is this sketch the best option?
Do you have a list that i need to buy so i can build this nice station?Thanks!!!
@Dylano Thanks.
I get 3-4 months from a battery by just removing the 2 LEDs from the arduino. Could probably do better running it from 2 AAA batteries and removing the voltage regulator as well. To save more power, you could also increase the interval between sending updates to the controller.
To build it you need:
- Arduino Pro Mini
- Humidity Sensor – DHT22 Aliexpress
- list itemPressure Sensor – BMP180 Aliexpress
- Prototype board & Battery Connector
Connections:
- Radio connected as http://www.mysensors.org/build/connect_radio
- 3.3V to sensors from arduino
- Battery Sense - A0 - connected as http://www.mysensors.org/build/battery R1=1M * R2=100k
- BMP085 - SCL - A5
- BMP085 - SCA - A4
- DHT22 - D3
-
Think about to replace your DHT22 with a less current hungry sensor
HTU21D cold be a good choice (But only running 3,3V) -
If you at some point redesign the nice looking weather station, I recommend:
1)To place the battery in the top, to avoid battery corrosion
2) Make a little hole in bottom for water condensation trip out hole -
The pro minis have an onboard voltage regulator (raw input). The specs say that they are good for up to 12v for either the 5v or 3.3v version. I used a 3.3v version as it made the rest of the interface easier.
-
I am curious what kind of battery life you are getting with the 9 volt battery? I tried a sensor with a 9 volt battery and the useful battery duration was less than ideal.
@dbemowsk said in Mini Weather Station:
I am curious what kind of battery life you are getting with the 9 volt battery? I tried a sensor with a 9 volt battery and the useful battery duration was less than ideal.
Typical capacity is around 550mAh for alcaline version. All extra voltage is wasted in the linear regulator so you end up with less than half the capacity of 2 AAA or about 20% of the capacity of 2 AA. Not a good choice imho, better switch to i2c sensors like si7021 or BME280 like MikeF did to have much lower power consumption and much lower voltage requirements and use 2 AAA. And the lower the voltage is, the lower the current consumption is for Arduino, radio and sensor so in the end instead of having 4 months of battery life you can get 2 or 3 years with 2 AAA.

