Jump to content
inTank Media Baskets

Typhon-based LED controller on the cheap (seriously)


ajmckay

Recommended Posts

NEW!

 

So I've wanted to build a reef controller for quite some time, but for whatever reason I never got around to it. Well, for my LED array - called Wavelengths - I used Meanwell LDD drivers that need a PWM signal for dimming (no analog potentiometers as I understand it). So I set out to create an LED controller using some common parts that anyone should have as well as my old Arduino that's been collecting dust.

When I started researching code and how to do all this when I stumbled upon the "Typhon project". I knew about the BoostLED Typhon, but what I didn't realize is that the Typhon is a completely open source project started by a guy on RC to get people off their butts and making DIY stuff. HERE is the original thread. So after browsing through that I decided that it fit my specifications almost exactly and even had more functions because I didn't have a manual mode worked into mine. My button scheme operated differently, but who cares. The code I used is pretty much the same as the Typhon controller.

Specifications/requirements:
- Control 4 channels independently (program start/end times, maximum intensity, and fade duration)
- Manual mode all on, all off, or all on at a selectable intensity 0-100%
- Look cool in a project box
- Have an LCD screen with backlight

- Target cost $30 (for everything except project box 'cause the cost depends on what you want)

For the hardware I wanted to use an Arduino Duemilanove that I had lying around with the ATMEGA 168 chip. It's an older one (2008-2009), but uses the same code and has the same I/O pins (input/output).

To build a Typhon you basically have 3 choices:
1) Buy one from BoostLED. Though I'm not sure that's the original intent of the project and I think it's kinda crappy that a company is selling an open source licensed product (then again there wasn't a non-commercial clause in the creative commons licensing for v1 and it does help people get one who may not have the skills to build one).
2) Download the files, order the circuit board, and assemble it yourself. There's a list of materials you can order (resistors, capacitors, transistors, etc) and then a file you download and send to a PCB (printed circuit board) manufacturer and they build you a board and ship it to you. You just bust out your soldering iron and solder on the components. The only thing is getting the circuit board printed can cost a bit if you order from a place that has a minimum order.
3) Upload the Typhon code to an Arduino and add a few components. This is probably the least popular option as far as I could tell because I only found a few examples of people doing it for the Typhon code though there are plenty of Arduino-based reef controllers out there. I'm sure this is the cheapest option - especially since it's easy to get cheap Arduino boards on eBay. So my plan was to just use a regular Arduino, upload the code, and figure out the inputs/outputs. I already had the Arduino so that was motivation to make this option work. The hardest part was to find out how to connect all the inputs/outputs as there were no diagrams on how to do that since the traces were built into the Typhon circuit board.

So here's how to build it:

1) Gather the materials - If you have a few weeks for shipping and some of the cords lying around I'm sure you can easily get all the parts for about $30 shipped, especially if you get an older controller (I don't really think the new ones do anything different other than maybe have more space for code).
- Arduino Duemilanove (you can get an older board on eBay for $10-15 shipped, $20 for the newer Uno from china or $30 domestically)
- 2 packs of 1/4 watt 10k ohm resistors from Radioshack ($1.50 ea.)
- A pack of 4 momentary push buttons from Radioshack ($3)
- A 16x2 LCD screen that is HD44780 compatible ($4 from china, $10 shipped domestically or $16 from a store)
- Most LCD's come with a pot to adjust contrast, but you may need one separately $1 at Radioshack
- DS1307 RTC (real time clock) ($4 from china or $10 shipped domestically)
- A bunch of 22ga solid core copper wire ($6 or so for 3 different colored spools @ Radioshack)
- 6' Piece of network cable to carry PWM signal - free for me as I have tons lying around
- A quick connector such as a molex that provides power to an older disk drive or cd-rom. Could use anything similar that has 5 wires (1 for each LED channel + 1 for ground).
- USB cord to connect the Arduino to your computer for programming- free if you have a printer or scanner or something.
- A breadboard will be really helpful ($4 from china or $9 at Radioshack for a small one)
- A small piece of circuit board ($2 at Radioshack if you want to re-use your breadboard)
- Project box (optional)
- A 9-12v power supply (extra wall wart should do) unless you plan on keeping it powered on by the USB port on your computer
* Note that this list is for drivers which require a 0-5v PWM signal. If your driver uses 0-10v PWM (Meanwell ELN series for example) then you'll need a few transistors and a 12v power supply. Go see thereefninja's reefcontroller to see how this is done. You just have to add a 10v power source, a transistor and a resistor into the line.

2) Assemble the unit.
- I decided I wanted my breadboard back, so I soldered my buttons down to a piece of circuit board with the 10k ohm resistors as in the picture.
- Just follow the wiring diagram below on how to hook everything up. I used a breadboard style layout, but you could connect everything directly or through a small circuit board from Radioshack.

3) Download the code.
- Goto http://www.arduino.cc and follow the steps under "Getting started" to download the compiler and install the drivers on your computer.
* Note that there are several versions of the Arduino environment. I have an older unit, so the most recent version of the Typhon code I can use (due to space requirements) is revision 13 of the 1.0 code. In general if you're using older code you'll need one of the older environments (version 23 or earlier). If you're running new code you can probably use a newer environment.
* You can have multiple environments installed on your computer - It's just a folder. I used version 18 to compile my code. If you get an error while trying to upload a sketch just try an older version of the Arduino environment.
- Copy/paste the code into your Arduino window. You can use the code directly from the Google code site where all the versions are, or you can use the BoostLED modified code
- Google site with the code This is the overall project site showing all code revisions and the Typhon hardware.

- The specific code I used (Revision 13 of the Typhon code from the google code link above - the most recent revision that would fit on my old arduino)
- BoostLED modified code (may be particularly useful if you will be using buckpucks due to the inverted 0-5v pwm)
- At the top of the code are comments on the particular version of code you're using. Of interest are the libraries you'll need. The libraries will look like this and they're usually located at the top. For your code to compile you need these libraries in your libraries folder within the version of the Arduino environment you're using.

#include <LiquidCrystal.h>


*The libraries are easily found at http://www.arduino.cc or use google. The code I used requires the following libraries (I'm only listing the ones that don't come pre-loaded in the arduino environment so you have to download them yourself).
- Button.h
- EEPROMVar.h
Also, BoostLED has a handy .zip file containing the libraries you need that you can just extract to your libraries folder. Get it here: "Extralibraries.zip".

4) Upload the code
- Just click upload button in the Arduino program and wait a minute!
- If the code uploaded your LCD screen should be talking to you and you should be able to navigate the menu using the buttons!

5) Hook up the PWM outputs on the Arduino to your LED drivers!
- Since my Arduino will be positioned away from the light I decided to use a network cable to carry the signal. This way I won't have a bunch of cords going to the light. I also wanted to keep it easy to disconnect for moving and such so I'm using some computer connectors which I've modified slightly and soldered onto the network cable. The other end of the connector will go on the PWM wires coming from the drivers. See the picture on how I put together my cable. I'm not exactly sure where I got the connector I used, but like I said you could use a fan connector or molex or something else. If all else fails there's always wire screws or butt connectors!
- Follow the instructions in the diagram below to connect the dimming signals to the Meanwell LDD drivers. It's probably very similar for other drivers, but if you are using a different driver (though why would you?) make sure you check the data sheet to see what the instructions say.

Wiring Diagram, hopefully it's high enough resolution:
Arduinotyphonwiringdiagram02-2013_zps785

7) Test!
- Once the pins are connected properly it should work. Click over to manual mode, cycle through all on/all off and then try to turn the lights on using the % function, starting at 0% and going all the way to 100%. In my tests once I figured out how to connect the PWM correctly everything worked as smooth as butter.

IMG_1902_zps9bc44b3f.jpg

IMG_1906_zps0e82a060.jpg

DIY button arrangement
IMG_1862_zpsdc7f0a45.jpg
PWM quick connect
IMG_1918_zps524238bd.jpg

My mess (before making it look neat in a project box)
IMG_1900_zpsac4a9d19.jpg


Video! (coming soon)


So there you have it, a cheap, and simple LED controller. Note that if you want further expandability you can get a different Arduino board that has a bunch more input/output pins. Alternatively you could use an i2C controller (often built into LCD screens) which would allow you to operate multiple items on just a few pins on the arduino, leaving a lot left over for other things. Some people have programmed their arduinos to control heaters, pumps, ATO's, and read temp/pH/salinity/ORP probes as well. I was just interested in an LED controller for the time being though stay tuned for possible updates. Note that the code may need modification if different hardware is used such as an i2C controller!

Future updates:
- Clean it up and put it in a project box or tupperware or something.
- Fan controller so the fan's only running when the light is
- Moonlight controller that's on when the main light isn't.

  • Like 2
Link to comment

http://code.google.com/p/jarduino-aquarium-controller/

 

Can you do anything with this controller code? Or am I comparing apples to oranges?

 

Definitely apples & oranges there. His project is pretty cool no doubt but it goes way above and beyond the Typhon, which is purely an LED controller that requires minimal parts and minimal know-how.

 

To use the Jarduino code you would need to purchase the hardware specified for that project. If you want to have more functionality though that project looks cool. It requires a lot more components and programming, but he's written a pretty good guide.

Link to comment

Dude you should... It's pretty easy especially if you have an arduino lying around.

 

I know absolutely nothing about coding and It took a few hours but I was able to get it to work. I'm thinking about learning some more about code and maybe sometime buying a newer arduino so I can upload more code and not be limited by space as much.

 

Then again the one I already built does exactly what I want it to do, so why should I mess with it...

Link to comment

A side note, mouser has like 5$ shipping or something to residential addresses. A lot of the components like resistors and pots that you are getting from radio shack could be bought for a few cents from mouser. I didn't realize shipping was so cheap until I had to go to mouser to get a part for a project.

  • Like 1
Link to comment

A side note, mouser has like 5$ shipping or something to residential addresses. A lot of the components like resistors and pots that you are getting from radio shack could be bought for a few cents from mouser. I didn't realize shipping was so cheap until I had to go to mouser to get a part for a project.

True that...

 

The components themselves are really cheap at mouser/digikey/other online suppliers compared to radio shack. Given the very few items needed though I'm not sure if the savings would offset the cheap shipping though.

 

If you have another project with a need for electrical components and you can combine the order then definitely you could save a few bucks! That or if you need wire and stuff the price difference may be enough to easily justify the $5 shipping and still come out ahead.

Link to comment

True that...

 

The components themselves are really cheap at mouser/digikey/other online suppliers compared to radio shack. Given the very few items needed though I'm not sure if the savings would offset the cheap shipping though.

 

If you have another project with a need for electrical components and you can combine the order then definitely you could save a few bucks! That or if you need wire and stuff the price difference may be enough to easily justify the $5 shipping and still come out ahead.

This is why I mentioned the 5$ shipping. Anything past these two lines and you'd save by buying from mouser. It didn't hit me how bad I was getting screwed by radio shack and how little I would have to buy for it to make sense to stop shopping at radio shack.

- 2 packs of 1/4 watt 10k ohm resistors from Radioshack ($1.50 ea.)

- A pack of 4 momentary push buttons from Radioshack ($3)

Link to comment

This is why I mentioned the 5$ shipping. Anything past these two lines and you'd save by buying from mouser. It didn't hit me how bad I was getting screwed by radio shack and how little I would have to buy for it to make sense to stop shopping at radio shack.

You have to admit that Radioshack can be pretty handy sometimes though. As far as I know that's the only place to get electrical components quickly.

 

And while some $$ can be saved shopping online I usually don't think that much in advance and so I sometimes just pay a bit of a premium to get the stuff faster. But for larger orders I definitely go with mouser or digikey.

Link to comment

You have to admit that Radioshack can be pretty handy sometimes though. As far as I know that's the only place to get electrical components quickly.

 

And while some $$ can be saved shopping online I usually don't think that much in advance and so I sometimes just pay a bit of a premium to get the stuff faster. But for larger orders I definitely go with mouser or digikey.

Honestly? I find that radio shack generally doesn't have what I want, and on the odd chance they do, I stand in the store looking at a 1.5 cent item that they want 3$ for and I have a hard time doing it. I've got a selection of basic resistors and caps at work, so it would be looking for a diode or something and they just don't have the one I need.
Link to comment

Honestly? I find that radio shack generally doesn't have what I want, and on the odd chance they do, I stand in the store looking at a 1.5 cent item that they want 3$ for and I have a hard time doing it. I've got a selection of basic resistors and caps at work, so it would be looking for a diode or something and they just don't have the one I need.

 

That's awesome you have stuff like that available to you at work! What do you do?

 

I agree that sometimes they just don't have what I need, but at the same time I wouldn't have finished this thing were it not for some prototyping board and the 40 pin IC holder I found there (total $3 + tax).

Link to comment

Does anyone have a complete parts list? Just to build the basic one. ya know same as the retail one avalable. I would like to try this out. Just need parts list and anything extra thats needed. Any help would be great :)

Link to comment

Does anyone have a complete parts list? Just to build the basic one. ya know same as the retail one avalable. I would like to try this out. Just need parts list and anything extra thats needed. Any help would be great :)

 

Ditto.....I'd like to see the same thing. Perhaps thorw together a digi-key project list.

Link to comment

Great write up!! I think many people will enjoy this project following your lead. Well done :)

 

I went the "Easy" route and ordered mine from BoostLED otherwise my LED array would be on an appliance timer with dimming knobs controlling the "color". It worked like that for 3 years so I know it wold work but having that little controller doing all the work just makes it so much.. well COOLER!

 

BAZINGA! << LOL

 

I have mine stuffed into a clear plastic "snap on lid" box from Staples. It's the perfect size, cost less than $2 and looks good until i get one made for it. (hopefully just a few weeks . . .)

 

Top Down

2013-02-26160422_zps653a22af.jpg

 

Front

2013-02-26160357_zpsf87f3d35.jpg

 

Top side Angled

2013-02-26160446_zpsbe322150.jpg

 

 

Please ignore the messy wires etc. I'm going to try and tidy those up this weekend.

 

  • Like 1
Link to comment

Does anyone have a complete parts list? Just to build the basic one. ya know same as the retail one avalable. I would like to try this out. Just need parts list and anything extra thats needed. Any help would be great :)

Seriously? There's a pretty complete parts list above to build the Typhon on an arduino. Instead of posting links to specific parts I just included a good description for everything so that you can price shop for the cheapest stuff. Would you rather a specific shopping list from somewhere? It may be more expensive to do it that way though, the cheapest parts are likely going to be on eBay from China and sometimes those links change.

 

 

Now, if you want to build the actual Typhon board (as in download the batch file, send it off to have a custom PCB printed for you, and then assemble all the components) then there's also the link above to the original Typhon thread, but here it is again:

 

 

And since there are so many different versions here is the link to the google code page (created by der wille zur macht) that has the PCB files and an excel spreadsheet with all the parts.

 

Hope this helps!

Link to comment

If anyone wants to try building one of these from scratch, I have most of what you will need. A couple years ago, I thought I would try to build one (or three). That never happened. If anyone is interested, I will post a parts list of what I have. I DO NOT have the pcb's though.

Link to comment

Okay so I'm not sure which project you all are commenting on now. Please keep this thread focused on building an LED controller using arduino hardware and the Typhon or custom code. If you are interested in making the Typhon controller itself please post on the Typhon thread @ RC (link in first post).

 

Anyways, I went ahead and created a mouser project, even though I knew it wasn't the most economical way to get the items, specifically the arduino and RTC and to an extent the LCD. The total for the project is $56 + shipping which includes the arduino, LCD display + pot, resistors, push buttons, and DS1307 RTC. For that price you may as well just buy the pre-assembled controller! Here's the link anyways though: http://www.mouser.com/ProjectManager/ProjectDetail.aspx?AccessID=6b03921cd3 as there is some pride in building something yourself even if it costs the same as a commercial unit.

 

Now let's invoke the purchasing power of CHINA! Most of these are eBay links so they may or may not work for long (not auctions - buy it now only). I'll put in the search description though as there are always new things coming up that you can find.

 

1) 1/4W 10K ohm resistor - $1 for 50 of them shipped from China.

http://www.ebay.com/itm/50-x-Resistors-10K-Ohms-OHM-1-4W-5-Carbon-Film-/260796452577?pt=LH_DefaultDomain_0&amp;amp;amp;hash=item3cb8ae0ee1#ht_1284wt_981

 

2) 16x2 HD44780 LCD - $4 shipped from China (Includes header pins, not necessary, but helpful)

http://www.ebay.com/itm/HD44780-16x2-LCD-module-Blue-backlight-Free-pin-header-/320537704496?pt=LH_DefaultDomain_0&amp;amp;amp;hash=item4aa1893830#ht_2509wt_1016

 

3) 10K ohm Trim pot - $1 shipped from China.

http://www.ebay.com/itm/3-x-10K-OHM-Trimpot-Variable-Resistor-6mm-/250844170325?pt=LH_DefaultDomain_0&amp;amp;amp;hash=item3a677a4855

 

4) Momentary tactile push button - $5 for 100 of them shipped from China.

http://www.ebay.com/itm/100x-Panel-Momentary-Mini-Tactile-Tact-Push-Button-Switch-4-Pin-DIP-6-x-6-x-10mm-/230914110734?pt=LH_DefaultDomain_0&amp;amp;amp;hash=item35c38db50e#ht_1557wt_1219

 

5) Arduino ATMEGA 328 - $13 for the arduino compatible Iduino shipped from China. The Chinduino is also available for $13!!!

http://www.ebay.com/itm/Iduino-uno-Atmega328p-pu-compatible-with-Arduino-s-IDE-/281041064125?pt=LH_DefaultDomain_0&amp;amp;amp;hash=item416f5a50bd#ht_2825wt_981

 

6) DS1307 RTC - $2.69 shipped from China.

http://www.ebay.com/itm/New-I2C-RTC-DS1307-AT24C32-Real-Time-Clock-Module-for-Arduino-51-AVR-ARM-PIC-/400422844086?pt=LH_DefaultDomain_0&amp;amp;amp;hash=item5d3b0fb6b6

 

So, the total cost for the China items (including shipping!) is *drumroll* $26.69... Not bad.

 

 

Other stuff I found:

 

22 awg solid core hook up wire for the LEDs and for hooking up the controller.

$18 way too much wire than you'll ever need: http://www.ebay.com/itm/Hook-Up-Wire-Kit-Stranded-Wire-/290818315074?pt=LH_DefaultDomain_0&amp;amp;amp;hash=item43b61f5342#ht_234wt_1219 - not from China!

Or, Radioshack $8 for 3 spools of like 10-15 ft. Still probably more than you'll ever use

 

Prototyping circuit boards.

$1 china circuit boards http://www.ebay.com/itm/10-pieces-5-x-7-cm-DIY-Prototype-Paper-PCB-Universal-Board-Free-Shipping-/200901785852?pt=LH_DefaultDomain_0&amp;amp;amp;hash=item2ec6adf8fc#ht_1862wt_981

Or $2.50 at radio shack

 

So while the shopping list I put together is pretty good IMO, it shows that the most savings come from finding the best deals. I mentioned "China" a lot in the links, but you can also find these components cheaply and shipped from the US (or whatever country you're in) for the same price or slightly more than the ones from China.

For example I found an LCD screen for $5 shipped domestically. Not a bad deal and still less than most other places, even mouser.

 

Also keep in mind that an arduino compatible board will work just fine as should any of the various versions of arduino just as long as it uses the same basic chip (ATMEGA 168 or 328) the code should work fine without modifications. At a local store I can buy an arduino compatible board for about $20, that's $5-10 less than the Arduino brand board. You can also buy kit versions so you can assemble the arduino board yourself! I've seen those for less than $10 online and about $15 at a store. More work for the same functionality - but also more pride in your project.

 

I didn't include costs for wiring and solder stuff, but if you built an LED array you probably have wire left over you could use for this. Also most people have an extra network cable and power cable (extension cord works) lying around. Some stuff is optional too. You don't need a molex pin connector, wire nuts, butt connectors, or soldering and electrical tape all work fine too. I just happen to have a few connectors lying around from old computers that I wasn't using.

 

On a side note I think someone is spying on me... I've mentioned Radio Shack a few times in this thread and now my ads on N-R.com are for Radio Shack...

  • Like 1
Link to comment

Besides writing the code, is there any reason with the right additional parts, (relays, ect), this could not be used to control pumps, power heads, heaters, Chillers.

 

Maybe display temperature? Ph?

Link to comment

Besides writing the code, is there any reason with the right additional parts, (relays, ect), this could not be used to control pumps, power heads, heaters, Chillers.

 

Maybe display temperature? Ph?

The guy on RC that created the typhon, also created a little bit more powerful diy controller called the hydra.

Here is the thread: http://www.reefcentral.com/forums/showthread.php?t=1783536

There should be a google code project for it too.

Link to comment

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recommended Discussions

×
×
  • Create New...