Andre's Web enabled Arduino controller

Discussion in 'Anything DIY Related' started by AndreM, 8 Mar 2012.

  1. AndreM

    AndreM

    Joined:
    8 Mar 2011
    Posts:
    209
    Likes Received:
    1
    Location:
    Cape Town, Bellville
    Sorry for starting yet another thread on an Arduino controller, but I didn't want to clog up @Manic's thread and I think we're going in slightly different directions.

    I really want a controller that is web enabled, that is, one which I can manage with a web browser, either from my PC or from my phone.

    I thought I'd share what I've built so far, it's been going slow but maybe posting about it will keep me motivated a bit more :)

    These are the components I'm using:

    - Arduino Mega2560
    - Arduino Ethernet Shield
    - DS1307 Real Time Clock
    - DS18B20 based temperature sensors
    - Relay modules with built transistor / opto drivers that I can connect directly

    [​IMG]

    My plan is to hook up the Arduino to my home network, which has ADSL and a Wireless access point. This way I can access the Arduino controller with a web browser on my PC, or using Wifi via the access point, from a phone or tablet. Opening up a port on my firewall I can also access it from the internet if I'm not at home (this has some security implications, but a VPN or password protection should sort this out).

    So far I have the web server running on the Arduino, serving static files (css, images) from the SD card that is included on the Ethernet Shield. It also creates dynamic pages for specific URLs. Right now the only thing it does is report on current temperature.

    Here are a few screenshots of the current program running with 5 temperature sensors. The temperature sensors all connect to the same pin, and the 'Scan' button scans this bus for probes and sets their resolution. The 'Temperature' button then reports the temperature for each of the probes.

    [​IMG]

    [​IMG]

    [​IMG]

    I don't mind sharing the code if anyone is interested. For the current version you will need the Arduino Mega2560, Ethernet Shield, a MicroSD card, one or more DS18B20 temperature sensors and a 5k resistor.

    You can download the current version here: http://code.google.com/p/arduino-aquarium-web-controller/downloads/list


    Next step is to add the clock.
     
    Last edited by a moderator: 26 Nov 2015
  2. AdS Guest




    to hide all adverts.
  3. Mc

    Mc

    Joined:
    8 Jun 2011
    Posts:
    2,650
    Likes Received:
    38
    Location:
    Benoni
    Looking good Andre can you access it remotely or just on the lan. I am interested in that code will pm you my email address.
     
  4. lIghty

    lIghty

    Joined:
    3 Nov 2007
    Posts:
    5,053
    Likes Received:
    52
    Location:
    Westville, Durban
    Looks Awesome Andre!
     
  5. Achilles

    Achilles

    Joined:
    22 Feb 2009
    Posts:
    1,050
    Likes Received:
    100
    Location:
    Cape town
    very interested please document more!
     
  6. LCornelius

    LCornelius Moderator

    Joined:
    5 Mar 2009
    Posts:
    5,459
    Likes Received:
    124
    Location:
    Durbanville (CPT)
    Great stuff!
    Tagging along!
     
  7. Quintin

    Quintin

    Joined:
    30 Aug 2010
    Posts:
    1,607
    Likes Received:
    37
    Location:
    Ruimsig
  8. Junz

    Junz

    Joined:
    19 Dec 2008
    Posts:
    899
    Likes Received:
    2
    Location:
    Rustenburg
    what was the total cost for everyting ?
     
  9. robvdv

    robvdv

    Joined:
    22 Jun 2007
    Posts:
    798
    Likes Received:
    16
    Location:
    Noordhoek, Cape Town
    Very nice. Are those 1-wire temp sensors? I've been fiddling with a Make Controller with the intention of doing something similar.

    Can the ethernet shield resolve DNS and make an outbound request? Would be nice if it would push its status up to a server somewhere. The server could then report if it hadn't heard from the controller in a while.

    I have a lot of experience with asynchronous web applications. I'm happy to help out a bit and bounce ideas if you like.
     
  10. AndreM

    AndreM Thread Starter

    Joined:
    8 Mar 2011
    Posts:
    209
    Likes Received:
    1
    Location:
    Cape Town, Bellville
    That would depend on your network configuration. The webserver runs on the Arduino, and you give it an IP address. To access it outside of your local lan you would need to do some port forwarding on your internet router, or set up a VPN to connect to your local network.

    I bought everything off eBay, these are the prices including shipping and taxes (I had to pay 14% VAT at customs when I picked it up)

    - Arduino Mega2560 - R303.33
    - Arduino Ethernet Shield - R190.28
    - Realtime Clock Module - R92.83
    - Waterproof Temperature Probe - R42.67 each
    - 8 Channel Relay Module - R105.49

    Yeah, they're DS18B20 1 wire sensors. You can get just the chips from Mantech or RS, or you can get the already constructed probe off eBay for not much more.

    The Ethernet shield proves you with a TCP/IP stack, and you have to implement everything else on top of that yourself. But luckily the HTTP protocol isn't that complicated if you stick to the basics.

    Here is an example of downloading a web page from the internet using a DNS name: Arduino - DnsWebClient
     
  11. Mc

    Mc

    Joined:
    8 Jun 2011
    Posts:
    2,650
    Likes Received:
    38
    Location:
    Benoni
    Thats cool Im looking to get the wifi shield set up on mine. I like your temperature probes I went for the chips but I might change them later.
     
  12. butcherman

    butcherman Moderator MASA Contributor

    Joined:
    7 Sep 2009
    Posts:
    11,626
    Likes Received:
    280
    Location:
    Kempton Park
    are the probes stainless steel?
     
  13. robvdv

    robvdv

    Joined:
    22 Jun 2007
    Posts:
    798
    Likes Received:
    16
    Location:
    Noordhoek, Cape Town
    Ooh, nice.
     
  14. AndreM

    AndreM Thread Starter

    Joined:
    8 Mar 2011
    Posts:
    209
    Likes Received:
    1
    Location:
    Cape Town, Bellville
    Yes they are, so they will probably corrode slowly in saltwater. But at R40 each I don't mind replacing them if they do :). I guess you could cover the exposed metal with more heatshrink.
     
  15. lIghty

    lIghty

    Joined:
    3 Nov 2007
    Posts:
    5,053
    Likes Received:
    52
    Location:
    Westville, Durban

    Just dip them in epoxy.
     
  16. AndreM

    AndreM Thread Starter

    Joined:
    8 Mar 2011
    Posts:
    209
    Likes Received:
    1
    Location:
    Cape Town, Bellville
  17. dono

    dono

    Joined:
    12 Mar 2008
    Posts:
    161
    Likes Received:
    2
    Location:
    Durban
    @AndreM very nice dude... Brilliant idea... Wish the mega had more pins so that you could have the wifi shield as well as a TFT..
     
    Last edited by a moderator: 26 Nov 2015
  18. AndreM

    AndreM Thread Starter

    Joined:
    8 Mar 2011
    Posts:
    209
    Likes Received:
    1
    Location:
    Cape Town, Bellville
    Wow, that is surprising that you've run out of pins.

    I have not worked with the Wifi shield, but the Ethernet Shield only uses 5 pins out of the 54 available.

    On the Mega it uses pin 50, 51 and 52 for the SPI bus (through the ISP header) and it uses Pin 10 for Ethernet select and pin 4 for SD select.

    The RTC will use two pins (I2C bus), and the temperature probes uses one shared pin.

    How many pins does that TFT use? Maybe it would make sense to rather use a driver for the TFT instead of connecting it directly if it uses up that many pins.
     
    Last edited by a moderator: 26 Nov 2015
  19. dono

    dono

    Joined:
    12 Mar 2008
    Posts:
    161
    Likes Received:
    2
    Location:
    Durban
    Sorry my last post was meant to read ethernet shield.. I do have the wifi modules.,. But didnt get to try them out yet.

    Yea.. 6 channels of Pwm channel LEDs, some Pwm fans, temp Controllers, heaters etc Only have 1 pin left, using the itdb02 LCD shield, so the TFT is using like 40pins off the mega... Prob can get an i2c for the TFT.. Too much of a reprogramming headache though.
     
    Last edited: 9 Mar 2012
  20. AndreM

    AndreM Thread Starter

    Joined:
    8 Mar 2011
    Posts:
    209
    Likes Received:
    1
    Location:
    Cape Town, Bellville
    40 pins for the display, yeah, that uses up almost all of the pins.

    I guess this is where the focus of my project differs, I prefer having a web interface so I can use my cellphone or other internet enabled device to control it. Although, having both would be great :). I do have an HD44780 16x2 LCD I might hook up for some status information.
     
  21. Mc

    Mc

    Joined:
    8 Jun 2011
    Posts:
    2,650
    Likes Received:
    38
    Location:
    Benoni
    DO you know how many pins this lcd uses?
     
    Last edited: 9 Mar 2012
Recent Posts

Loading...
Similar Threads - Andre's enabled Arduino Forum Date
Andre's first marine tank - 1.2m Medium Tanks 19 Mar 2011
Google search enabled Forum Suggestions and Feedback 12 Mar 2009