Author Topic: Backyard WeatherStation for Planting and later Aquaponics.  (Read 16871 times)

hexibot43

  • Jr. Member
  • **
  • Posts: 78
Re: Backyard WeatherStation for Planting and later Aquaponics.
« Reply #30 on: January 29, 2014, 08:36:16 PM »
     Finally got a web server up and running, and live online.  Just a set of static pages for now.  Still trying to learn how to push the data received by my gateway Moteino, and dump it into a Mysql database on the Raspberry PI.  I think I've got NodeJs up and running and socket.io.  Yeah right.  I've got them both stating their current update level.  So they are there.

     I'm guessing the next thing I need to do is point socket.io to the comm port of my USB connection.  I haven't tried programming the Moteino from the PI.  I'll try that tonight to verify connection.  I've had the gateway connected to my laptop while getting the Moteino part of the system up.

     Looking forward to having the connection between Moteino and RaspberryPI done and over with....Then all I need to do is code on the PI.  Push incoming data to the Mysql Database, and provide data for the webpages from the Database.  Can't wait to have live data on my webpages.

http://mabs.ghostnation.org:8888/index.php

hexibot43

  • Jr. Member
  • **
  • Posts: 78
Re: Backyard WeatherStation for Planting and later Aquaponics.
« Reply #31 on: March 25, 2014, 11:47:21 AM »
     I've been slowly continuing to work on this project.  Ok, very slowly.  I had to learn Python, and Mysql, and I think I'm getting old.  It doesn't come as fast as it use to.  Anyway, I just got the mysql database working correctly, with data coming in from the Moteino network.

    I'm still having problems with my power consumption.  My battery is not lasting as long as my predictions....  Could you all look at my code and see if you see anything that stands out.  I can't see any consumption on my Multimeter during the off time at all.  It is currently set to provide info every 5 minutes and shut down the rest of the time.  It is doing that.  I am not powering the sensors off a I/O pin as I was doing before.  I've just got them hooked to the output of the regulator.  So that is on DHT22, and 2 DS18b20s.  Nothing else.  All powered by a single Duracell Procell 9v.  I don't even have a circuit to measure battery power hooked up.  I've just been taking readings of Open Circuit Voltage with a multimeter once, or twice a day. 

     Battery Voltage starts at 9.62 volts on 3.16.14  by Today I'm at 9.12 volts.(3.25.14).  I'm just waiting for it to stop functioning to get an idea of longevity...but I don't think it is looking good.
   
     Here is my code as it is today.  I've turned off all my debugging. 

https://codebender.cc/sketch:26389

     Any ideas or insight? 

Thanks,

Mab



Felix

  • Administrator
  • Hero Member
  • *****
  • Posts: 6370
  • Country: us
    • LowPowerLab
Re: Backyard WeatherStation for Planting and later Aquaponics.
« Reply #32 on: March 25, 2014, 01:02:44 PM »
Your sensors is probably where current is being leaked if they are permanently powered. To get real power savings you should sleep EVERYTHING including sensors since EVERYTHING uses power.

Also to reduce the output power on a HW you will have to keep in mind that the HW power scale is not linear but rather divided into 2 scales: 0-15 and 16-31 which are equivalent (they do the same thing, ie 15 has the same effect as 31). See this post for explanations: http://lowpowerlab.com/forum/index.php/topic,362.msg2043.html#msg2043

hexibot43

  • Jr. Member
  • **
  • Posts: 78
Re: Backyard WeatherStation for Planting and later Aquaponics.
« Reply #33 on: March 25, 2014, 03:41:34 PM »
Felix - So having set my power to 16 (or 1) will be at the lowest power output, and so I will hope the least power usage as well.  But this is in combination with the High Power registers.  I have them on so I'm at +5db.  If I turned them off I could get down to +2db output gain.  I think I got it.  Why is there always some little strangeness to everything.  Why do they even have 16-31.  Why not just 1-15 and leave it at that?  I know you didn't build it.  For every rule there is an exception. 

Will go back to driving all the sensors via I/O pins from the Moteino.  I just couldn't even read the at rest load on my Ammeter.  Nor my MilliAmp meter.  I think the DS18b20 at rest drain is measured in NanoAmps, and the DHT22 is in MicroAmps.  But it is easy to go back to driving them from an I/O so tonight we'll make a change and try again....Thanks   

hexibot43

  • Jr. Member
  • **
  • Posts: 78
Re: Backyard WeatherStation for Planting and later Aquaponics.
« Reply #34 on: March 27, 2014, 01:57:55 AM »
     Alright, changed the code, and the hardware.  Driving the DHT22, off one pin, and the two DS18b20s off another.  The DS18b20s worked right away.  Bad data from the DHT22.  To test my code and hardware, I just remarked out turning off the power pin for the DHT22, and it started working again.  I really hate to have to turn it back on, and wait for it to warm up before using it again.  I had noticed that when starting up the Moteino that the DHT22 would usually give me bad data the first time I used it, but after that it would work fine. 

Any suggestions?  Is there a good Humidity sensor that I could use instead?  The Ds18b20s work so well, and I bought a lot of them so adding another one of those is no big deal.


Felix

  • Administrator
  • Hero Member
  • *****
  • Posts: 6370
  • Country: us
    • LowPowerLab
Re: Backyard WeatherStation for Planting and later Aquaponics.
« Reply #35 on: March 27, 2014, 08:10:03 AM »
A good humidity sensor that is battery friendly? I'm not sure. I haven't used humidity sensors much. There are some more expensive sensors like this: http://www.adafruit.com/products/1638
I can't speak to whether they work better though. Quite pricey!

hexibot43

  • Jr. Member
  • **
  • Posts: 78
Re: Backyard WeatherStation for Planting and later Aquaponics.
« Reply #36 on: March 27, 2014, 10:00:35 AM »
Been doing some looking myself too.  Looks like I've found something to try..  Still looking but this one uses 240uAs during conversion.  Very Battery friendly.  And only about $10 each.  I will just need to figure some way to mount it.  Still looking...though.  I would much rather have a package like the DHT22 which is easily connected without making a PCB.

http://www.mouser.com/new/Silicon-Laboratories/silabs-si7005/

hexibot43

  • Jr. Member
  • **
  • Posts: 78
Re: Backyard WeatherStation for Planting and later Aquaponics.
« Reply #37 on: March 27, 2014, 11:25:58 AM »
Ok it takes about 500 250 milliseconds for the DHT22 after being powered on to provide valid data.  I wish that was in a datasheet.  Maybe it was, but I didn't see it.  Seems there is a lot of controversy with these sensors.  Lots of different wiring, etc,..

Since I was always noticing that my first conversion was always bad data, going to move my delay from the end of the code to the beginning where it should have been in the first place.  I'll just power the DHT22 up and go back to sleep (not delay) for 500 250 mills.  So instead of it being on all the time, it will be on for about .2 .1 seconds longer than my original up time.  And off for 5 minutes completely.  Will be putting a new battery in tonight and start the clock again.  Crossing my fingers.  Of note, the DS18b20s don't seem to need this time at all.  They worked without any delay after powering them up.   hmmmm, I am going to re-verify they, the DS18b20s, aren't getting power from the signal line to the Moteino.
 
« Last Edit: March 28, 2014, 12:31:11 AM by hexibot43 »

A

  • Newbie
  • *
  • Posts: 43
Re: Backyard WeatherStation for Planting and later Aquaponics.
« Reply #38 on: March 27, 2014, 12:02:46 PM »
Been doing some looking myself too.  Looks like I've found something to try..  Still looking but this one uses 240uAs during conversion.  Very Battery friendly.  And only about $10 each.  I will just need to figure some way to mount it.  Still looking...though.  I would much rather have a package like the DHT22 which is easily connected without making a PCB.

http://www.mouser.com/new/Silicon-Laboratories/silabs-si7005/

Si has come out with a second generation of humidity sensors that use even less power. I use the si7021 on my WeatherShield and I've been quite happy with the performance. http://www.silabs.com/products/sensors/humidity-sensors/Pages/si7013-20-21.aspx

If you want a breakout board that is code compatible with the Si702x, though not quite as energy efficient, you can get one from SparkFun. If you're dead set on the Si7005 and you're willing to wait 3 weeks, there is a breakout board for it on Tindie.

hexibot43

  • Jr. Member
  • **
  • Posts: 78
Re: Backyard WeatherStation for Planting and later Aquaponics.
« Reply #39 on: March 27, 2014, 08:11:19 PM »
Thanks A,

     I'm going to get one of the ones you mentioned, and give it a try.  I'll know in a week how my battery is lasting.  Code modified to conform to the wait  time of the DHT22.  At least I figured out why when rebooting my first conversion would not be good.  Only has to be on .2 .1 of a second instead of on the whole time so that should help.  .2 .1 seconds for every 5 minutes.... 

    As soon as these rains stop here my greenhouse will be going in.  Managed to get 15 55gallon barrels so far.  I've been luckily getting them for free.  And I have managed to score a glass roof with the chicken wire in it for free too.  Well the glass is suppose to be free.  We'll see how much free costs me.  I'm sure quite a bit of beer at least.  Looking forward to posting pictures of everything once it gets moving.       
« Last Edit: March 27, 2014, 11:10:03 PM by hexibot43 »

hexibot43

  • Jr. Member
  • **
  • Posts: 78
Re: Backyard WeatherStation for Planting and later Aquaponics.
« Reply #40 on: March 28, 2014, 12:49:52 AM »
Changes made to software. 

Confirmed 250ms wait time sufficient to provide valid data from DHT22 sensor after re-powering unit up. 

Powering DHT22 up 250ms before the rest of code loop starts running, and going back to
sleep for 250ms.  Also added 250ms sleep after powering up for the first time  in the Dht22 setup routine, which got rid of my bad data at first conversion.  Appears to be providing valid data at all times now.

Starting with fresh battery @ 9.62Volts  @ 9:15pm 3.27.14 Recorded while in sleep mode.

Crossing my fingers that I don't see such a rapid fall off in voltage.

 
 

Appears to be working well.  Time will tell.  Back to working on Web Interface. 
« Last Edit: March 29, 2014, 10:07:22 AM by hexibot43 »

hexibot43

  • Jr. Member
  • **
  • Posts: 78
Re: Backyard WeatherStation for Planting and later Aquaponics.
« Reply #41 on: April 04, 2014, 11:29:58 AM »
Well after  almost a week I am seeing no improvement in battery performance.  It looks about even. 4-5 days I'm down from 9.62 to 9.21 volts.


         Moteino Battery Life using 9 volt battery Starting with fresh Duracell Procell               
                        
1st Run with all three temperature sensors connected directly to regulator output                        
                        
03/16/14   02:00:00 PM   9.62                  
03/17/14   07:12:00 AM   9.44                  
03/17/14   06:37:00 PM   9.41                  
03/18/14   07:20:00 AM   9.38                  
03/18/14   06:40:00 PM   9.35                  
03/19/14   07:20:00 AM   9.33                  
03/19/14   08:40:00 PM   9.31                  
03/21/14   07:05:00 PM   9.25                  
03/22/14   08:14:00 AM   9.21                  
03/25/14   07:10:00 AM   9.12                  
                        
                        
2nd Run with all sensors being powered via I/O pins of Moteino allowing them to be shut off during sleep time                        
Note:  The DHT22 sensor had to be started up 250 milliseconds early to allow for proper conversions with this setup.                        
                        
03/27/14   09:15:00 PM   9.62                  
03/28/14   07:21:00 AM   9.55                  
03/28/14   08:00:00 PM   9.48                  
03/30/14   08:40:00 AM   9.29                  
03/31/14   07:20:00 AM   9.22                  
04/02/14   11:59:00 AM   9.07                  


     I think it is time to just bail on trying to use a 9 volt battery.  Time to break down and buy that Lipo battery and solar panel I've been thinking about.  I've been looking at all they have at www.voltaicsystems.com.  I can't make up my mind.  I didn't want to get anymore than I need, but at the same time want to ensure that I've got it covered. 

   How long are the batteries lasting on the Mail Mote?  I'm thinking they aren't doing the same thing though.  Only once an event has occurred do they have to turn on.  My weather Mote is ON every 5 minutes, along with three temperature sensors.   

Felix

  • Administrator
  • Hero Member
  • *****
  • Posts: 6370
  • Country: us
    • LowPowerLab
Re: Backyard WeatherStation for Planting and later Aquaponics.
« Reply #42 on: April 04, 2014, 11:40:50 AM »
FWIW the battery will drop rapidly towards 9V then the rate of drop will slow down. That's like when you drink out of a bottle with a long neck. Those first sips will seem like will empty the bottle by a third, then it gets better. I've seen the same behavior in my duracell 9V batts.
Of course depending on how much power you actually draw when not sleeping will be a factor in how fast the batt will ultimately drain...

hexibot43

  • Jr. Member
  • **
  • Posts: 78
Re: Backyard WeatherStation for Planting and later Aquaponics.
« Reply #43 on: April 04, 2014, 08:05:49 PM »
Jing-Jing!

     The information I could find was leading me to believe that my battery was at almost a 0% state of charge when it reached 9 volts.  I will leave this unit up and running to see when it finally just stops producing data.  Any idea of what battery voltage you'd see when the Moteino is close to stopping to function?   

     I got a Weather shield from A for my birthday on Wednesday.  And I've still got one Moteino that I haven't yet used, which is already nicely soldered in place.  I'll just leave the other and start playing with this to keep myself busy.

     The weather hasn't been playing nice and I'm not so into construction in the rain.  I've now got something like 15 55 gallons plastic drums ready to be turned into a Aquaponics system.  We are currently in Drought here in California.  I think they just said we have 33% of the snow pack we need in the sierra to carry us through to the next season.  And yet it hasn't stopped raining here?!?  Supposedly Aquaponics only uses about 20% of the normal water used to producing vegetation.  Here's to hoping Aquaponics will allow me to keep growing all the Genovese Basil, Thai Basil, Red Peppers and San Marzano Tomatoes we can eat without the water company shutting me down. 

     I guess I'll have to throw in a simple voltage divider to track the  battery voltage.  I've been walking out and taking  readings with a voltmeter, which has already gotten tedious. 

Felix

  • Administrator
  • Hero Member
  • *****
  • Posts: 6370
  • Country: us
    • LowPowerLab
Re: Backyard WeatherStation for Planting and later Aquaponics.
« Reply #44 on: April 05, 2014, 01:17:25 PM »
I've used a 9V for my mailbox notifier and I've seen some crazy swings in voltage. The issue is we've had a brutal winter here and cold really takes a hard toll on the 9v cell. Warm temperatures will always bring voltage up and cold will kill it. Still it lasts for many months, transmitting every 16sec.
The voltage will drop to as low as 5.xV before it will finally die. The lower the voltage gets the less waste there is in the 3.3V regulator. So if you're at 9V or even below your battery is very alive and well, still going to last for months if you only draw a few uA most of time and transmit every half minute or so.