Showing posts with label humidity. Show all posts
Showing posts with label humidity. Show all posts

2015-07-06

Temperature & Humidity monitoring - update

Back working on the temp sensor that I started in http://lpaseen.blogspot.ca/2014/11/temperature-humidity-monitoring.html

Two prototypes have now been running over 5months on same battery so my fear that I have to replace batteries every 2 weeks is gone.
With that in mind I moved on and made a PCB to place all parts there. First try came out ok.


I then put it in a small box with 2xAA battery. The booster is a separate board and that is something I don't like. Will probably make another board+box and use 3xAAA in it so I don't need a booster.
It's a lot left to desire for any kind of final version. The booster is annoying and I wonder if it's better to run off 3 batteries instead. The advantage of the booster is that it suppose to work as long as the two batteries together gives more than 0.9v. On the other hand, it takes power and space. I don't have a good enough multimeter to properly measure how much it takes so I can't test it that way. What I do know is that the sensor with 3xAAA NiMH and 3.1V left is still running after 5 months. The one with 2xAA NiMH and booster been on for almost 6 months and with 2.45V left I expect it to run a bit longer.

Besides battery my other issue is wireless range, was hoping for a bit more than the size of the house but that seems to be tricky. If I put the receiver in the basement and transmitter in attic it doesn't work so I moved the receiver to the middle of the house and then I can get my (way to high) attic temp.

I'm considering making another version without a arduino board, just the atmel chip (which one, atmel328p, attiny85 or something else?), SMD, ISP connector and voltage booster onboard (with the option to not populate it if going with 3XAAA). If so I can of course no longer get a way with toner method to make my own PCB and need to order it from somewhere, http://dirtypcbs.com/ that has a $14 protopack for 10 5cmx5cm boards looks interesting.

Next we have the presentation side, right now it's just storing all values in a .csv file. To get something going I'm trying to upload about one week of  data to plot.ly so now I have temp&humidity at https://plot.ly/~lpaseen/306 and battery level at https://plot.ly/~lpaseen/309

2014-11-29

Temperature & Humidity monitoring

Started to build a temp & humidity monitoring system. Yes, it's a ton of them out there already but I didn't make them so they don't count.

The requirements are multiple (more than standard 3) remote temp and humidity sensors that can be inside or outside. A central console connected to computer that receive the data and can log it somewhere.

Starting with remote sensor part I now figured out the parts needed, put them together and done some coding for it.
For initial round I'm going with all off the shelf stuff. Arduino pro mini as the brain, DHT22 as sensor and the dime a dussin 315MHz transmitters from ebay. Did find a case in a local store that seems to be perfect for the remote sensors at least.
Box to be filled
Since I want to run this off 2xAA batteries I also need a booster (the sensor requires at least 3.3v).
Remote Sensor

Coding is simplified by using VirtualWire lib and DHT22 lib. Was going to use jeelib for power saving sleep but for unknown reason jeelib doesn't like the other two (any one of them seems to work, strange) so I ended up grabbing some pieces from internet to make the arduino power down completely for 8 seconds wake up long enough to see that it's not yet time to send and keep sleeping.
Need to remove the power led but with that one still installed I'm down to 3.5mA during sleep and about 22mA when sending data.

Coding I done so far has defined a protocol that is <27 bytes (VirtualWire lib default limit) and still contain all I think I currently need.
Protocol:
  • 1 byte: Type of transmitter, 1=temp/humidity, 2=water level, 3-127=reserved for future use
  • 1 byte: Protocol format, depends on sensor but format 2 follows (1 is missing mV)
  • 4 byte = unit no of the device, basically a random 64bit number (don't think I need the 128bit uuid)
  • 2 byte = Sequence number so receiving side know it's same msg
  • 2 byte = vcc in mV
  • 2 byte = batt mV
  • 1 byte DHT22 status of the data
  • 2 byte temp*10
  • 2 byte humidity*10
  • 2 checksum - 2 bytes
I know length is missing but the first two bytes does define format and with that length can be added if the size is dynamic.
Vcc is calculated reading internal 1.1v ref
batt is a separate wire from before the booster

On the receiving side I got it to receive data, separate the different sensors and show a csv or human readable output on the serial port.
Receiver
My current issue is current and presentation.
The remote sensor is taking to much power for to long, considering changing so it only sends the data once and only if status is ok. If that transmission is lost we get it next round.

On the receiving side I'm wondering how to best present the info (besides serial output). The csv output is pretty simple
#Unitno,unitId,msgCnt,vcc mV,batt mV,stat,temp c,humid %
0,13C76FE0,11,4693,4092,0,22.60,42.60
1,2585C230,63,5051,2152,0,21.00,43.30
1,2585C230,65,5096,2076,0,21.00,43.30
0,13C76FE0,12,4693,4092,0,22.60,42.40
No time since then I would need a rtc somewhere and the time is when it's coming so the receiving app can time stamp itself.
I could add a 4x20 lcd but with more than 4 sensors it gets hard to present anything useful.
Thinking of sending it to an raspberry pi where I add it to a database and then have a website that can do the presentation.

One more thing to figure out is distance, how far away can a sensor be and what can be done to increase the range.


Update1: Managed to put it all inside the box
But I think I may have to find another sensor/add 1 battery, the stepup- converter is killing my battery even when idle.



Update2:
Done some testing and decided that the stepup converter must go. Running it on 5V means higher current to start with and the converter does use some power also. I have removed the power LED in the arduino so now it's only on when sending. I also improved the sleep part so it's doing a full power down and let the watchdog start it up every 8 seconds, so time between transmissions need to be a multiple of 8sec.
Some numbers measured with a cheap multimeter.
The battery lifetime is based on 2400mAh batteries, a sampling of about 4 sec (have to check on why so long) and with a rest of 72sec:

Running on 5v from booster, mA after booster:

Active: 15-18ma
Rest: 0.58mA
Batterylife: N/A (70 days - but not really relevant since that's after booster)

mA before boster:

Active: 42-44mA
Rest: 1.49mA
Batterylife: 27 days

Power usage during using 3xAA and no step-up

Active, 3-4 sec, 11mA
Resting - 78sec, .46-.47 mA
Batterylife: 98 days

So if I run on 2 batteries it takes 3x more power during rest than if I run on 3 batteries and no booster (partly because it's then running on 3.6v instead of 5v) and that means 3.6 times longer between battery replacements. While the arduino can run of 2 batteries the sensor requires at least 3.3V so I need 3x.


Version - 0.4 of the remote sensor code, still need a lot of cleanup but it works