Arduino Controlled Tank

Discussion in 'Members Systems' started by Jagwa, Jul 13, 2012.

  1. Jagwa

    Jagwa

    Joined:
    Mar 30, 2010
    Messages:
    141
    Likes Received:
    0
    Location:
    Newlands, Cape Town
    Hi , I embarked on automating and logging my aquarium parameters a few weeks ago. The pics below show what I have going so far.

    My Arduino Uno with wireless xbee shield along with the xbee series 1 transceiver.
    IMG_2136.jpg

    A temp sensor and its circuit which is connected to the analog input on the Uno.
    IMG_2135.JPG

    A second xbee which is connected to the PC with a xbee usb explorer board.
    IMG_2138.JPG

    So far I have been able to take readings and communicate them wirelessly to my pc. Here are my current readings.
    Capture.JPG
    As you can see it is cold in Cape Town. The plan is to eventually control the lights on/off time, temperature as well as measure the power consumption of the tank. I still need to sort out the datalogging so that I can view the parameters over the course of a month or so. The current graph only indicates the temp over the last hour. Will post updates as I go along.

    For those interested, the xbee which is connected to the PC is controlled using a program called Processing. It is really easy to get going and understand. There is also alot of support on the web for it.

    IMG_2136.jpg

    IMG_2135.JPG

    IMG_2138.JPG

    Capture.JPG
     
    Last edited: Jul 13, 2012
  2. Guest




  3. arcky1

    arcky1

    Joined:
    Nov 24, 2010
    Messages:
    292
    Likes Received:
    4
    Location:
    Randburg
    Yowzer! nice
     
  4. butcherman

    butcherman Administrator

    Joined:
    Apr 30, 2009
    Messages:
    1,583
    Likes Received:
    19
    Location:
    Kempton Park
    This looks like a great build. Loads of potential!

    Sent from my GT-I9100 using Tapatalk 2
     
  5. f-fish

    f-fish #unspecified

    Joined:
    Jun 27, 2009
    Messages:
    9,294
    Likes Received:
    1,869
    Location:
    JHB - Randburg
    Looking good .. keep posting
     
  6. Jenn

    Jenn Retired Moderator

    Joined:
    Jan 23, 2011
    Messages:
    2,244
    Likes Received:
    20
    Location:
    Johannesburg, Kensington
    Interesting. Would you care to share costs so far?
     
  7. OP
    Jagwa

    Jagwa

    Joined:
    Mar 30, 2010
    Messages:
    141
    Likes Received:
    0
    Location:
    Newlands, Cape Town
    mmm, trying to remember the price off the top of my head

    arduino uno - 225
    wireless shield - 145
    xbee - 300 each
    usb explorer board - i think about 100ish
    temp sensor - 20

    So the price does actually add up but the bulk of it is for the wireless communication.
     
  8. hadiosbourne

    hadiosbourne

    Joined:
    Aug 13, 2012
    Messages:
    23
    Likes Received:
    1
    Very interesting,
    I recently became interested in doing a controller for my system, expect i don't have much programming skills:D
    I've ordered the Raspbery Pi Since they make a much better web server, but the backorder is massive,
    I'll probably get mine in december , Will keep you posted once it arrived
     
  9. DigiGram

    DigiGram

    Joined:
    Feb 25, 2012
    Messages:
    206
    Likes Received:
    2
    Location:
    Parys, FS
    Well, I've won a MSP430 Launchpad (similiar to Arduino Leonarda, but for like R65, so I guess a bit less features) so as soon as that arrives, I'll start experimenting with programming for it. I'm ordering my PIC's this payday as well, so in about 4 weeks time I'll be able to start make some progression.
     
  10. OP
    Jagwa

    Jagwa

    Joined:
    Mar 30, 2010
    Messages:
    141
    Likes Received:
    0
    Location:
    Newlands, Cape Town
    I am now using my arduino to control my LED lights and my canopy fans. It is very simple.

    Here is a schematic of my driver.

    [​IMG]

    R1 in conjuction with current limiting transistor Q2 sets the current. Basically the current will rise until the voltage across R1 reaches about 0.6V and then Q2 pulls the Gate voltage of Mosfet Q1 low turning it off. This is a basic current limiting circuit. I use 3 cree xp-g LED's in series to keep the on forward voltage below 12V at my selected current. Make sure that Q1 has a low enough Gate-Source turn-on voltage so that your arduino input can turn it on. Another thing to consider is the Drain-Source resistance of Q1. Keep it low otherwise you increase your losses. The arduino PWM output pins are 5V. I used a SFP50N06 for Q1.

    I also control the fans in my hood using this simple circuit.
    [​IMG]

    I have hooked my Arduino up to a Real Time Clock. My Arduino then just constantly checks the time and updates the PWM pins. I can turn each string of LEDS as well as the fan on individually and I can dim them at different levels whenever I want. [​IMG]

    Check it out here
    75x60x45 Journal
     
    Last edited: Feb 21, 2013
  11. f-fish

    f-fish #unspecified

    Joined:
    Jun 27, 2009
    Messages:
    9,294
    Likes Received:
    1,869
    Location:
    JHB - Randburg
    nice one .. The NPN you are using for Q2 that the 2N3904 or the 2N2222.

    Post the sketch .. you can never have enough copies and Zoom love reading sketch files ;-)
     
  12. Zoom

    Zoom Retired Moderator

    Joined:
    Apr 13, 2009
    Messages:
    8,459
    Likes Received:
    107
    Location:
    Jhb- Roodepoort
    Ugh. Another thread where you guys swear at each other in a language I don't understand.
     
  13. oupoot

    oupoot

    Joined:
    Aug 22, 2012
    Messages:
    675
    Likes Received:
    1
    Location:
    Krugesdorp
    We got 5 of these for tester units, they are awesome!

    @Zoom lol
     
    Last edited by a moderator: Oct 2, 2016
  14. jrgns

    jrgns

    Joined:
    Jan 20, 2013
    Messages:
    72
    Likes Received:
    0
    Location:
    Jo' burg
    I'm waiting for my Rapsberry... I'd love to track and manage my tank using it.

    @Jagwa - where did you get the temp sensor? Do you have a ID for it?
     
    Last edited by a moderator: Oct 2, 2016
  15. oupoot

    oupoot

    Joined:
    Aug 22, 2012
    Messages:
    675
    Likes Received:
    1
    Location:
    Krugesdorp
    Just remember that these units are designed to be Thin Clients and not full fledged pc's and you will be limited based on the OS you put on the memory card. I have found ours to be slow from time to time on TS but still for the price its worth the money. @Jagwa I hope you make you app open source for the rest of us to use maybe? 'Wink"
     
    Last edited by a moderator: Oct 2, 2016
  16. OP
    Jagwa

    Jagwa

    Joined:
    Mar 30, 2010
    Messages:
    141
    Likes Received:
    0
    Location:
    Newlands, Cape Town
    Here is the code, very simple. Would like to connect to the internet with a wifi shield next
    Code:
    #include <Wire.h>
    #include "RTClib.h"
    
    RTC_DS1307 RTC;
    
    void setup () {
        Serial.begin(57600);
        Wire.begin();
        RTC.begin();
    
      if (! RTC.isrunning()) {
        Serial.println("RTC is NOT running!");
        // following line sets the RTC to the date & time this sketch was compiled
        RTC.adjust(DateTime(__DATE__, __TIME__));
      }
      pinMode(10, OUTPUT);
      pinMode(9, OUTPUT);
      pinMode(6, OUTPUT);
      pinMode(5, OUTPUT);
      pinMode(3, OUTPUT);
    }
    
    void loop () {
        DateTime now = RTC.now();
        updateLED(now.hour(),now.minute());
    }
    
    void updateLED(int hour, int minute){
      int temp = 255 - (4*minute);
      int temp1 = 4*minute;
      
      if ((minute == 58) || (minute==59) || (minute == 0)){
        analogWrite(10, 255);   // Fans On
      }
      
      if ((minute > 0) &&(minute < 58)){
        analogWrite(10, 0);    // Fans Off
      }
      
      if(hour < 10){
        analogWrite(9, 0);      // everything off
        analogWrite(6, 0);
        analogWrite(5, 0);
        analogWrite(3, 0);       
      }
      
      else if(hour == 10){
        analogWrite(9, temp1);      // white lights fade in
        analogWrite(6, temp1);
        analogWrite(5, temp1);
        analogWrite(3, 0);       
      }
      
      else if ((hour > 13) && (hour < 18)){
        analogWrite(9, 255);      // white light fully on
        analogWrite(6, 255);
        analogWrite(5, 255);
        analogWrite(3, 0);   
      }  
      else if (hour == 18){
        analogWrite(9, temp);      // white lights fade out and blue fades in
        analogWrite(6, temp);
        analogWrite(5, temp);
        analogWrite(3, temp1);       
      }  
      else if (hour == 19){
        analogWrite(9, 0);      // blue fully on
        analogWrite(6, 0);
        analogWrite(5, 0);
        analogWrite(3, 255);       
      } 
     else if (hour == 20){
        analogWrite(9, 0);      // blue fades out
        analogWrite(6, 0);
        analogWrite(5, 0);
        analogWrite(3, temp);       
      }   
      else if (hour > 20){
        analogWrite(9, 0);      // everything off
        analogWrite(6, 0);
        analogWrite(5, 0);
        analogWrite(3, 0);       
      }   
    }
     
    Last edited: Feb 22, 2013
  17. OP
    Jagwa

    Jagwa

    Joined:
    Mar 30, 2010
    Messages:
    141
    Likes Received:
    0
    Location:
    Newlands, Cape Town
    Maybe I should check out the Raspberry PI
     
  18. Zoom

    Zoom Retired Moderator

    Joined:
    Apr 13, 2009
    Messages:
    8,459
    Likes Received:
    107
    Location:
    Jhb- Roodepoort
    AAAH... something I understand... Rasberry Pie.

    [​IMG]
     
  19. Hawk

    Hawk Clown Fish :-)

    Joined:
    May 25, 2012
    Messages:
    5,147
    Likes Received:
    79
    Location:
    Cape Town
    I'm with you on this one :laugh:
     
  20. oupoot

    oupoot

    Joined:
    Aug 22, 2012
    Messages:
    675
    Likes Received:
    1
    Location:
    Krugesdorp
    lol no another kind of pie....

    [​IMG]

    @Jagwa If the Raspberry doesn work, look into a nettop, a lot more expensive but a full fledged pc able to run windows 7 ultimate x86
     
    Last edited by a moderator: Oct 2, 2016
  21. Jenn

    Jenn Retired Moderator

    Joined:
    Jan 23, 2011
    Messages:
    2,244
    Likes Received:
    20
    Location:
    Johannesburg, Kensington
    This whole thread went so far over my head until I got to the code. My poor fish have just lights on/lights off. Now you must add days and emulate phases of the moon :D
     

Recent Posts

Loading...
Similar Threads - Arduino Controlled Tank Forum Date
Arduino controll General Discussions Oct 18, 2014
Arduino and your tank Anything DIY related Jun 30, 2012
Easily Dose your tank with the Zetlight D100 WiFi Controlled Dosing Pump Jungle Aquatics Feb 19, 2017
Flourish Excel - mechanical controlled dosing per hour Planted Tanks Mar 11, 2015
Method of Controlled Imbalances Algae Summary Aquatic plants May 13, 2013

Share This Page