New Page 2

 

Welcome to SDR!

  • Amused
  • Angry
  • Annoyed
  • Awesome
  • Bemused
  • Cocky
  • Cool
  • Crazy
  • Crying
  • Down
  • Drunk
  • Embarraded
  • Enraged
  • Friendly
  • Geeky
  • Grumpy
  • Happy
  • Hungry
  • Piratey
  • Poorly
  • Sad
  • Shy
  • Sneaky
  • Tired
  • + Reply to Thread
    Results 1 to 13 of 13

    Thread: 2 sensor ATO and light controller with Raspberry Pi

    1. #1
      sushi is offline Registered User
      My status is: pee in tank
       
      I am:
      Set you mood here...
       
      Join Date
      Jul 2015
      Location
      Mira Mesa
      Posts
      1,967

      2 sensor ATO and light controller with Raspberry Pi

      Hello,

      I made an ATO system with two float sensors, a Raspberry Pi, and a solid state relay board. I wanted to log fills to a database so that irregularities could be detected and I would be notified. I also wanted more than a purely mechanical system so that I could try to prevent flooding due to stuck floats.

      I have a lower and upper float. If the lower float sinks too far, the script will check the last fill time and if it was long enough ago, it will turn on the pump. Every second it will read the sensor to see if it has lifted. After it lifts up, the pump will run for one more second and stop. It is set to run no more than 10 seconds at a time, no more than once per hour (for now). If the water level goes low before an hour has passed, or the pump runs longer than 10 seconds without lifting the lower float, I am going to have it send an email to me.

      The upper float switch is between the 3.3v signal to run the pump and the pump relay. This is so that if the upper float switch is lifted, it will cut off power to the relay and shut the pump off. I also ran a wire from the relay side of the switch to an input pin on the Raspberry Pi so that I can log if this occurs, telling me that the low sensor got stuck. Also if the Pi crashes and the pump gets stuck on, the upper float will cut power to the relay and shut it off.

      For the lighting I can set the sunrise time, sunset time, length of sunrise, length of sunset, and maximum intensity. For instance I can set it to start sunrise at 6 am, ramp up to full intensity over 3 hours, then ramp down to 0 over 3 hours, starting at 4 pm. I also turn on the dusk/dawn lights during sunrise and sunset, and the moonlights at night. I am considering adding in the ability to retrieve sunrise/sunset and moonrise/moonset times from any location and have it use those. I might not do this since equatorial sunset times don't change that much. I am also planning to add in random "clouds" where the lights will dim to between 70-95% for random lengths of time. All events are logged to a database.

      Here are some pictures of my setup so far, I am going to clean it up once everything is all tested and working, I know it looks like a dangerous mess at the moment.

      Float switches



      Power box and raspberry pi



      Hood with ground + PWM signal wires added



      Log from controller script



      Simple wiring diagram of ATO system



      The 8 outlet box is controlled by the Pi, I just found a tutorial here http://www.instructables.com/id/Web-...el-Powerstrip/ to build it, but I used a solid state relay instead of a mechanical relay.

    2. #2
      CMD2213 is offline Registered User
      My status is: Downgrade to upgrade
       
      I am:
      Tired
       
      Join Date
      Dec 2013
      Location
      Rancho Bernardo ,Ca.92127
      Posts
      6,826
      Lol crazy! I got a jbj low tops off full stops haha I'm a simple guy but that's pretty badass

    3. #3
      greg619 is offline Registered User
      Enter Status Here..
       
      I am:
      Set you mood here...
       
      Join Date
      Jun 2015
      Posts
      200
      I did something similar. Mine logs to www.greg-web.net/openfish.php


      Sent from my iPhone using Tapatalk

    4. #4
      CMD2213 is offline Registered User
      My status is: Downgrade to upgrade
       
      I am:
      Tired
       
      Join Date
      Dec 2013
      Location
      Rancho Bernardo ,Ca.92127
      Posts
      6,826
      I need to get tech savy

    5. #5
      greg619 is offline Registered User
      Enter Status Here..
       
      I am:
      Set you mood here...
       
      Join Date
      Jun 2015
      Posts
      200
      FYI. Pi with wifi cuts off periodically from power issues. I run a cron job that watches for wifi connection drops and resets the interface. There's info online with a script for this. Other than that its pretty stable.


      Sent from my iPhone using Tapatalk

    6. #6
      sushi is offline Registered User
      My status is: pee in tank
       
      I am:
      Set you mood here...
       
      Join Date
      Jul 2015
      Location
      Mira Mesa
      Posts
      1,967
      Quote Originally Posted by greg619 View Post
      I did something similar. Mine logs to www.greg-web.net/openfish.php


      Sent from my iPhone using Tapatalk
      Yeah yours is what got me thinking! I am extremely glad I used a raspberry pi instead of an arduino like I was planning.

      I wanted to ask you about your database. Do you run it on the pi and run the webserver off the pi directly? I will start graphing and make it look nicer once I get my temp probe in the mail, this is just the raw first test.

    7. #7
      CMD2213 is offline Registered User
      My status is: Downgrade to upgrade
       
      I am:
      Tired
       
      Join Date
      Dec 2013
      Location
      Rancho Bernardo ,Ca.92127
      Posts
      6,826
      When you guys. Make sure it's 100% come make.mine lol

    8. #8
      sushi is offline Registered User
      My status is: pee in tank
       
      I am:
      Set you mood here...
       
      Join Date
      Jul 2015
      Location
      Mira Mesa
      Posts
      1,967
      Quote Originally Posted by greg619 View Post
      FYI. Pi with wifi cuts off periodically from power issues. I run a cron job that watches for wifi connection drops and resets the interface. There's info online with a script for this. Other than that its pretty stable.


      Sent from my iPhone using Tapatalk
      Thank you, I was thinking of asking you a few questions but I didn't want to bother you. The main question I had about where the data is stored and where the web server is running from, I asked above

      I am embarrassed to show you my code because it will probably look like a baby wrote it

    9. #9
      sushi is offline Registered User
      My status is: pee in tank
       
      I am:
      Set you mood here...
       
      Join Date
      Jul 2015
      Location
      Mira Mesa
      Posts
      1,967
      Quote Originally Posted by CMD2213 View Post
      When you guys. Make sure it's 100% come make.mine lol
      greg619 might be working on something like that in the future! His looks very nice and well put together. I am too much of an amateur to make something for commercial use, and I don't have time, and I don't want to worry about selling a controller that boils someones fish if something goes wrong. I would not be able to sleep at night.

      Maybe if I get something put together that seems really nice and cheaper than the Apex or whatever, I might consider it. It might be cool to sell my power box with the RPi inside and you just plug it in, plug your lights and stuff into it, and connect to it via wifi and set up your whole tank with a web interface. I think to go from what I have to a commercially viable product is a huge leap though.

    10. #10
      CMD2213 is offline Registered User
      My status is: Downgrade to upgrade
       
      I am:
      Tired
       
      Join Date
      Dec 2013
      Location
      Rancho Bernardo ,Ca.92127
      Posts
      6,826
      Sales will skyrocket label it A-PEXX

    11. #11
      sushi is offline Registered User
      My status is: pee in tank
       
      I am:
      Set you mood here...
       
      Join Date
      Jul 2015
      Location
      Mira Mesa
      Posts
      1,967
      Quote Originally Posted by CMD2213 View Post
      Sales will skyrocket label it A-PEXX
      haha! Call it Ape X and the logo will be a gorilla

    12. #12
      CMD2213 is offline Registered User
      My status is: Downgrade to upgrade
       
      I am:
      Tired
       
      Join Date
      Dec 2013
      Location
      Rancho Bernardo ,Ca.92127
      Posts
      6,826
      And rke rough kit example

    13. #13
      greg619 is offline Registered User
      Enter Status Here..
       
      I am:
      Set you mood here...
       
      Join Date
      Jun 2015
      Posts
      200
      Well it looks like I found my marketing team. 😀 sushi I'd be happy to chat with you. Pm me and I'll give my info. As for your q: my pi talks to one of my Web servers (not hosted on the pi). I do this so that I can check remotely without vpn or tunnel into my home network (no unnecessary security holes). I'm also gonna hook it up to an app at some point so I can get push notifications. Gonna snooze now but will respond tomorrow if you have any other questions.


      Sent from my iPhone using Tapatalk

    + Reply to Thread

    Thread Information

    Users Browsing this Thread

    There are currently 1 users browsing this thread. (0 members and 1 guests)

       

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts