Raspberry Pi Satellite LED+ Light controller - The Planted Tank Forum
Reply
 
LinkBack Thread Tools Display Modes
post #1 of 30 (permalink) Old 12-01-2014, 11:40 PM Thread Starter
Wannabe Guru
 
PTrader: (0/0%)
Join Date: Jun 2014
Location: Cape Coral, Florida
Posts: 1,286
Raspberry Pi Satellite LED+ Light controller

This is a bit of a "yet another LED+ controller" but in case it is of interest....

I wanted a controller for the LED+ that was web based, not based on physical controls. In fact I wanted it to be headless - no physical keyboard or control. I also wanted it to support wired or wireless, as I had one tank easily wired, one not so much.

I also started doing this to include other measurements and controls (like flow rate) and gave up - expensive sensors that probably work, and cheap ones that didn't; I decided that was not needed. But the Pi is easily extensible if I find some good sensors.

I was not yet ready to automate dosing or feeding, but similarly, easy to add.

So right now this is ONLY a LED+ controller, that:

- Is Headless
- Is Wired or wireless
- Has Web based controls for changing lighting
- Has Web based scheduling for automated light control
- Still supports the regular remote (i.e. no physical changes to LED+)
- Has been optimized to reduce SD card I/O while running

I put the instructions on my own web site where it's easier to update (no commercials there, or similar), but would be delighted with Q&A here.

http://www.leferguson.com/Pages/LEDPlusPI.aspx

Note that this presumes one is reasonably familiar with Linux and the Pi and soldering. Because it uses an add-on board with a header socket, as well as a few components, it requires more soldering than some of the audrino options, and indeed if you want a simple controller those are perhaps better.

If you like linux and want a "real" computer running your lights, especially that might be a basis for extension to monitoring or controlling other sensors, this may be an option. All the source code (which is really short, all HTML, javascript, a bit of php and bash) is on the site in a tarball.

When configured and installed, the web page looks like this:



The keys on the left side, vaguely the same as on the physical remote, can be used for direct control. There are also some added keys, notably the ones with percentages, which will move the indicated color up or down by about 20% or 100% gradually. In addition there's a up/down by percentage for rgbw, i.e. all colors.

The percentages are approximate, I made no effort to discern exactly how many steps each color can do, in part because I found different LED+'s do not respond equally (I have five of them). So I wanted something approximate for 20%, and far enough to be completely on or off for 100%.

The schedule is on the right side, military time. You can schedule by right clicking on a button, it adds it to the schedule and you type in the time.

Here's an example of my second build, using a pretty vanilla case, where the IR emitted is connected via a standard 1/8th stereo plug (socket added by me), and with a wifi dongle. This one is under my 220G tank, and driven by the same power supply I use to drive four LED+'s.



Here is a work in progress to mount the emitter and four IR receivers on a wooden frame that fits on top. It's unfinished as of this shot, and has a piece of aluminum foil substituted for a diffuser, but it should give the idea.



Because it's a web app (and a pretty vanilla one) it should work from almost any device. I have had some issues on touch screens discerning right click/long touch vs a touch-and-hold, so the up/down and Mx keys work fine for individual strikes, but on a tablet/phone you might not be able to "hold" depending on your browser implementation.

The web page gives the linux configuration information, and all the source code including the config files for lirc (the IR remote control software) are in a tarball that's available at the web page.

I'll update periodically as I make changes, and put some release notes as appropriate to new versions on the web page linked above.

Note: No security is built in; the presumption is that it is on a local LAN and no security is needed. Adding authentication and authorization would be straightforward but I had no need for it. Do not expose this, without suitable security changes, to the outside internet.

I welcome both suggestions and questions.

Linwood

Latest tank build:
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
Linwood is offline  
Sponsored Links
Advertisement
 
post #2 of 30 (permalink) Old 12-02-2014, 12:01 AM
Planted Tank Guru
 
kman's Avatar
 
PTrader: (1/100%)
Join Date: Dec 2013
Location: Los Angeles
Posts: 2,350
Subbed.


To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.


To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
|
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
|
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.

---------------------------------

To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
|
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
|
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
kman is offline  
post #3 of 30 (permalink) Old 02-09-2015, 08:00 PM
Algae Grower
 
PTrader: (0/0%)
Join Date: Jan 2015
Location: Wauconda Il
Posts: 36
So can this controller operate if the internet goes out, or without internet at all?
Dawagner is offline  
 
post #4 of 30 (permalink) Old 02-09-2015, 08:02 PM Thread Starter
Wannabe Guru
 
PTrader: (0/0%)
Join Date: Jun 2014
Location: Cape Coral, Florida
Posts: 1,286
Quote:
Originally Posted by Dawagner View Post
So can this controller operate if the internet goes out, or without internet at all?
Yes, in fact I don't recommend exposing it to the internet as I did not take time to make it very secure (that's in the instructions).

The only thing it uses (and does need some substitute) is that it uses the internet to obtain the correct time, and adjust over time (via NTP). If no connectivity, since the Pi has no real time battery clock, it needs some NTP-like source for time, like a PC that can serve up time.

I have a new version with minor corrections; if you plan to try it let me know, I'll get it posted sooner (was planning to get it up later this week).

Linwood

Latest tank build:
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
Linwood is offline  
post #5 of 30 (permalink) Old 02-09-2015, 08:17 PM
Algae Grower
 
PTrader: (0/0%)
Join Date: Jan 2015
Location: Wauconda Il
Posts: 36
I am planning on trying this or the Arduino controller . I have experience with arduino from other hobbies (RC) but have also been interested in trying out the Raspberry PI.

For the NTP is it sufficient to just be connected to the router? Or does something further have to be setup for it to sync the time such as portforwarding? I apologize for this question lol this part is a bit out of my knowledge base.

How hard would it be to install a RTC on the Pi?
Dawagner is offline  
post #6 of 30 (permalink) Old 02-09-2015, 08:20 PM Thread Starter
Wannabe Guru
 
PTrader: (0/0%)
Join Date: Jun 2014
Location: Cape Coral, Florida
Posts: 1,286
The Pi expects that it will be provided with a DHCP served internet address as well as name servers; the NTP link is by name, so it needs DNS resolution. Your router almost certainly provides that.

Just connecting it to the router however has another issue depending on the router -- to use this (remember it has no controller keypad, etc.) you need to know it's name or IP address, so you have to be able to set up a reservation in your router, and/or your router needs to cache and serve up the name so you can find it.

Adding a real time clock looks pretty easy -- there are several projects out there where it is done. I didn't look into it, as I like NTP sync, so all my computers (etc) are at exactly the same time.

Linwood

Latest tank build:
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
Linwood is offline  
post #7 of 30 (permalink) Old 02-09-2015, 08:26 PM
Planted Tank Guru
 
kman's Avatar
 
PTrader: (1/100%)
Join Date: Dec 2013
Location: Los Angeles
Posts: 2,350
Can a RTC be added to the Pi as easily as an Arduino? They're super cheap, after all.


To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.


To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
|
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
|
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.

---------------------------------

To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
|
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
|
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
kman is offline  
post #8 of 30 (permalink) Old 02-09-2015, 10:58 PM
Planted Tank Obsessed
 
zerodameaon's Avatar
 
PTrader: (0/0%)
Join Date: Dec 2014
Location: Bay Area
Posts: 450
Its as easy as putting on a HAT then configuring the RTC. Or you can grab any generic standard RTC and wire it up. You just have to make sure you are using 3.3v instead of 5v unless you are using a HAT that can take 5v.
zerodameaon is offline  
post #9 of 30 (permalink) Old 02-10-2015, 02:12 PM
Algae Grower
 
PTrader: (0/0%)
Join Date: Jan 2015
Location: Wauconda Il
Posts: 36
Awesome thank you,
Dawagner is offline  
post #10 of 30 (permalink) Old 02-10-2015, 03:00 PM
Children Boogie
 
mistergreen's Avatar
 
PTrader: (13/100%)
Join Date: Dec 2006
Location: Cincinnati
Posts: 16,743
The PI is a full on network computer where it sync time to a time server (NTP) so it doesn't need an RTC really but you can add one easily if you're not planing to have it hooked up to the network.

I have a wireless usb dongle in my PI and it couldn't be easier but connecting the PI via terminal is a bit of a problem with wireless.
mistergreen is offline  
post #11 of 30 (permalink) Old 02-10-2015, 04:15 PM
Algae Grower
 
PTrader: (0/0%)
Join Date: Jan 2015
Location: Wauconda Il
Posts: 36
Ok well I'm going to give it a try then. I think I can figure out the Time Server thing easily enough. I'm sure ill be back with more questions once everything comes in.
Dawagner is offline  
post #12 of 30 (permalink) Old 02-10-2015, 04:56 PM
Children Boogie
 
mistergreen's Avatar
 
PTrader: (13/100%)
Join Date: Dec 2006
Location: Cincinnati
Posts: 16,743
Quote:
Originally Posted by Dawagner View Post
I think I can figure out the Time Server thing easily enough.
It's automatic with the linux OS like Windows or OS X. I don't remember touching anything except telling it what time zone you're in.
mistergreen is offline  
post #13 of 30 (permalink) Old 02-21-2015, 01:21 PM
Algae Grower
 
PTrader: (0/0%)
Join Date: Jan 2015
Location: Wauconda Il
Posts: 36
Hey Linwood, I'm going thru the build right now. On your schematic you have 2 x 15 ohm resistors in parallel. But on the bottom you say you used 2 x 7 ohms instead to get more power. Is the schematic supposed to read 1 x 15ohm resistor? I see when you use the 2 x 7's you get a little more power ~271ma per the equation at the bottom.

Also your schematic has the 10kohm going to gnd and in your actual photos it looks like it goes to the power rail. Does it matter? Which should I follow?

Last edited by Dawagner; 02-21-2015 at 02:06 PM. Reason: Added question
Dawagner is offline  
post #14 of 30 (permalink) Old 02-22-2015, 03:57 AM Thread Starter
Wannabe Guru
 
PTrader: (0/0%)
Join Date: Jun 2014
Location: Cape Coral, Florida
Posts: 1,286
Quote:
Originally Posted by Dawagner View Post
Hey Linwood, I'm going thru the build right now. On your schematic you have 2 x 15 ohm resistors in parallel. But on the bottom you say you used 2 x 7 ohms instead to get more power. Is the schematic supposed to read 1 x 15ohm resistor? I see when you use the 2 x 7's you get a little more power ~271ma per the equation at the bottom.
That's wording ambiguously, sorry - the two 15 ohms in parallel yield 7 ohms net (well, 7.5).

So long as you don't send steady signals, only pulsed, these are not very critical, as the heat buildup in the pulses is minor, so you can drive the LED pretty hard. Just don't use something like debugging code and send a steady signal, I burned out one LED that way.

Quote:
Originally Posted by Dawagner View Post
Also your schematic has the 10kohm going to gnd and in your actual photos it looks like it goes to the power rail. Does it matter? Which should I follow?
That certainly appears to be true, though it is working. I guess it's pulling up not down. I followed the schematic on the second build I am pretty sure (I don't have time to go dig them out the cabinets and open right now).

I think the schematic is more correct, though it appears it works either way.

Of course you might breadboard it first.

I just put a new version of the code up that has some minor cleanup; same place, replaced what was there.

Linwood

Latest tank build:
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
Linwood is offline  
post #15 of 30 (permalink) Old 02-22-2015, 02:45 PM
Algae Grower
 
PTrader: (0/0%)
Join Date: Jan 2015
Location: Wauconda Il
Posts: 36
So far so good just got the program all loaded and the Web interface is working. I did add a rtc just as a precaution as my router is a piece of crap. Thanks for the awesome write up!
It gave me a bit of fuss at the last steps to reduce the amount of physical IO but I just went thru it a second time and it did the trick.
Dawagner is offline  
Reply

Tags
None

Quick Reply
Message:
Options

Register Now



In order to be able to post messages on the The Planted Tank Forum forums, you must first register.
Please enter your desired user name, your email address and other required details in the form below.

User Name:
Password
Please enter a password for your user account. Note that passwords are case-sensitive.

Password:


Confirm Password:
Email Address
Please enter a valid email address for yourself.

Email Address:
OR

Log-in










Thread Tools
Show Printable Version Show Printable Version
Email this Page Email this Page
Display Modes
Linear Mode Linear Mode



Posting Rules  
You may post new threads
You may post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

 
For the best viewing experience please update your browser to Google Chrome