Reef Discussion

MagicJ

Moderator
Jul 11, 2011
9,650
3,761
Hobart, Tasmania
Arduino Microprocessor - Questions and Answers
A few people are starting to think about using an Arduino to control their LED's and other things.

I will post up some information shortly, but if anyone has any questions then this is the place to post them.

If you have no idea what I am talking about have a look here http://www.arduino.cc/

Cheers
 

DavidS

The Resident Loony
Jul 17, 2011
3,337
1,033
Ballarat, Victoria
So MagicJ a couple of questions based on what I can see of your build:

- Your design looks like it's all running 240v from the board to the power points - is this a specific board you're using to cope with 240v?
- What board is it?
 

MagicJ

Moderator
Jul 11, 2011
9,650
3,761
Hobart, Tasmania
First off, you don't need something like this to control LED's - I wanted some additional functionality to control all of my 240v equipment via the arduino.

The arduino has a number of I/O (input/output) digital pins which can output either 0v or 5v - this switching voltage can be used to switch a high voltage relay connected to 240v. Many people build their own switching circuits using solid state relays etc but my electronics knowledge is not that advanced.

I took the easy way out and purchased this board http://www.futurlec.com.au/SSRAC.jsp. This has 8 relays and uses opto-isolators for isolation between control signals and output controls i.e. if something goes wrong with the board your Arduino won't be fried by the 240v.
awww.futurlec.com.au_images_SSRAC_300.jpg

For $53 this is pretty good value (cheaper now than when I got mine!!)

As I had plenty of room available I built a box to house the board and hooked up standard power points as this was the cheapest option.

This is how it looks
240v control.jpg
240v control front.jpg


Care - this requires wiring up 240v AC power and you should use the services of a friendly electrician :D
 

DavidS

The Resident Loony
Jul 17, 2011
3,337
1,033
Ballarat, Victoria
So if that board in your box is just a relay board, is your Arduino built into that box that the keypad is on?

I can see some benefit to this design - handy for macro type functions to turn off pumps, wave makers, etc, seems to be a beneficial idea.
Where does the lighting link back in?
 

MagicJ

Moderator
Jul 11, 2011
9,650
3,761
Hobart, Tasmania
Whilst you can just use the Arduino to control your LED's, it can actually do a lot more - controlling my 240v devices was one of my requirements when I started this project. Macro functions are great - I can press one button and all my pumps, skimmer etc are turned off. It is also works great for an ATO system - connect up a float switch and plug a small pump into one of the controllable sockets and you have a perfect ATO. I have a few extras built into my ATO which I will detail at a later stage. Temperature sensors are also easy to setup and program.

One of the problems with this type of DIY is finding a way to 'package' everything up so it looks good.

I chose to go down the 'modular' route so that I can unplug everything from the main Arduino control box so that I can easily take the Arduino to my computer to program it - this does create a problem in that you need to wire in plugs for everything. I used the D9 and D15 connectors used on computer connections but they are not fun to work with!!.

  • I have a box for my 240v relay as shown above.
  • A box for my arduino board with all the requisite connectors

    Arduino-Box---Outside.jpg

    Arduino-Box---Inside.jpg
  • A nice box for my LCD, keypad and display LED's - I also have my RTC (Real Time Clock board) located in this box together with a little piezo speaker. It took quite a few hours to route out the openings for the LCD and keypad but I think it looks pretty good.

    Control-Box---Outside.jpg

    Control-Box---Inside.jpg
  • A box for my LED light control - this includes a small transistor switching circuit because the Meanwells require a 10v PWM signal to control the dimming circuit whereas the Arduino only outputs a 5V PWM signal.

    LED-Box.jpg


    LED-Box-Inside.jpg


    Switching-Circuit.jpg
Enjoy :D
 

DavidS

The Resident Loony
Jul 17, 2011
3,337
1,033
Ballarat, Victoria
Looking forward to it. I damn near want to rip off your entire design. Being able to macro turning off an on a few power points and handling the LEDs sounds like what I'd like to achieve. Might make it look a little different though...
 

MagicJ

Moderator
Jul 11, 2011
9,650
3,761
Hobart, Tasmania
Photo's now added.
I have not done anything unusual - you can borrow any ideas that you like and make it look like whatever you want :D
 

DavidS

The Resident Loony
Jul 17, 2011
3,337
1,033
Ballarat, Victoria
If I had a list of all of the parts, and all of the sketches, I reckon it'd still take me months to build it all. Otherwise, I reckon this would take years.
Was debating simplifying, and just going for lighting control and avoid having any type of control box, but I know it would irritate the hell out of me knowing that I could make it do other things I'd inevitably want.
 

MagicJ

Moderator
Jul 11, 2011
9,650
3,761
Hobart, Tasmania
:DOne advantage of the keypad/LCD is that you can easily adjust all of the variables and save them to the internal memory (EEPROM) rather than having to hardcode them into the program. Makes the programming a lot more difficult but significantly improves the ease of use.
You could always start with just a LED controller and add the other bits later ;)

If I had a list of all of the parts, and all of the sketches, I reckon it'd still take me months to build it all. Otherwise, I reckon this would take years.
It took me about 8 months to get it all together - most of this was working on the sketch. Given what I know now, I think I could put it together in a couple of weekends.
 

MagicJ

Moderator
Jul 11, 2011
9,650
3,761
Hobart, Tasmania
Depends on what you want to do yourself, but I have been following a thread on Reef Central for over a year where some smart guys developed their own circuit board for a LED controller using the same chip as some of the Arduino's. As allowed under the open source Creative Commons rules this project has now been commercialised and is available as a completed project, minus a project box.

Have a look here for more details http://www.boostled.com/collections/diy/products/typhon-led-controller-kit. At $55 USD this is a pretty good price considering it comes with an LCD and 4 buttons to allow input of variables, a Real Time Clock, and a voltage regulator to increase the output to 10v to allow easy interface with the Meanwells. The major downside is that it doesn't have a USB port built in and it only uses the 328P chip which means that it would struggle with memory to hold a sketch such as the one I use.
 

DavidS

The Resident Loony
Jul 17, 2011
3,337
1,033
Ballarat, Victoria
That Typhon board looks good though - especially given that it's really nice and small - like something that could be mounted in a box up around the light level for easy access to see the screen.I like the panel on it too.
In terms of its capacity - looks like it's at least capable of letting me control the blue and white channels separately, and still let me control the sunrise/sunset on each one.

Cost wise, looks like it'd be the cheapest option for LED only control. That might be very tempting just so I can get the lighting control running quickly.
I can then buy a regular board, and work on power control for everything else with less pressure that way.
 

MagicJ

Moderator
Jul 11, 2011
9,650
3,761
Hobart, Tasmania
Just be aware that you will not be able to upgrade the program without buying an FTDI interface cable.

I will have a look at the code later on and see what the functionality is like.

How much control do you have over the lights from the keypad controls?
Most of these programs are done in a similar way - start time, total time and fade duration - I have an extra control for maximum power level for each channel. Via the keypad I can change all of these variables for each channel.
 

DavidS

The Resident Loony
Jul 17, 2011
3,337
1,033
Ballarat, Victoria
Whats the likelihood of wanting to upgrade the program for this type of device given I don't really need it to do much? Not really sure how these things work, so not sure how big of a deal that is. The cable isn't that much extra. Read somewhere that they're working on a box for it - heres hoping they make one soon.
 

MagicJ

Moderator
Jul 11, 2011
9,650
3,761
Hobart, Tasmania
I would definitely want the ability to load new software - the cable is an extra $20.

For the price this looks to be a pretty good option although the 16x2 LCD can be a bit limiting.
 

DavidS

The Resident Loony
Jul 17, 2011
3,337
1,033
Ballarat, Victoria
Would the limiting element be relative to it's base functions, or only really an issue if I tried to leverage the device beyond the basic functionality that it currently provides?
 

MagicJ

Moderator
Jul 11, 2011
9,650
3,761
Hobart, Tasmania
16x2 would be fine for what this does. I have read about a lot of builds where they start off with this size screen and soon upgrade to a 20x4, which is what I am using - the smaller screens make it difficult to implement a usable menu system.
 

DavidS

The Resident Loony
Jul 17, 2011
3,337
1,033
Ballarat, Victoria
Ok cool. I think I may go with the Typhon just for the lights, then look into some DIY once I decide to start trying to manage the rest of the tank better.
If I do that, I get something workable for the lights quickly. Might look at getting the Typhon in a couple of months, then look at what else I can do with an Arduino once I work out what else I'd like to do.
 

MagicJ

Moderator
Jul 11, 2011
9,650
3,761
Hobart, Tasmania
In looking further at what you get, the Typhoon is actually pretty good value for money, except shipping is $45 :eek:

To put together a similar controller you would need:

Main Board
http://www.robotgear.com.au/Product.aspx/Details/469 $27.50 + shipping
LCD Screen
http://www.robotgear.com.au/Product.aspx/Details/413 $29.95 + shipping
Real Time Clock
http://www.futurlec.com.au/Mini_DS1307.jsp $7.90 + shipping

plus you would also need to build a small switching circuit and get a seperate 10v power supply.

For around $100 this is much better value than the PWM units from rapidled.
You might like to see if anyone else is interested in a Typhoon as the postage cost for two is still $45 ;)
 

DavidS

The Resident Loony
Jul 17, 2011
3,337
1,033
Ballarat, Victoria
Noticed the shipping charge before, but when I'm ready I'll see if anyone else is keen on one and see how it goes.
Just waiting for the boxes to be available if that happens. Doesn't look like something that would be fun to custom build an enclosure for.