Please visit the homepage for location and information on open hours


Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Raspberry Pi LED Controller Build
05-06-2013, 10:08 PM,
#1
Raspberry Pi LED Controller Build
Hi All, received the Raspberry Pi board along with the WiPi USB Wireless Network adapter and power supply. Here's a photo of the beginning pieces:

[Image: P1020807.jpg]

So what's the plan, well I'd like to connect non adressable RGB LEDs to the board and be able to change / program the colors more then most of the shelve controllers can do. This all started last fall when I hooked up some simple white LEDs under the eves of our garage so the light floods down the wall. Also having done work on energy conservation (and being the son of depression era parents) anytime I can save a little juice I'm into it. In the case of the garage I went from a single 60 watt incandescent bulb to roughly 8.5 watts of LEDs that produce a lot more light. I liked the lighted wall look enough to try and do the same on the front of the house only with RGB LEDs.

Here's a few links to the current setup I'm using:

LED modules
http://www.oznium.com/rectangle-led-module

12 Volt Power Supply (clipped the plug off to hard wire to the household wiring)
http://www.oznium.com/waterproof-led-transformer

RGB Controller
http://www.solidapollo.com/chroma-flow-r...oller.html

The RGB Controller is the piece I'd like to replace with the Raspberry Pi. The controller is very basic in that you can adjust brightness and colors but it won't remember the changes from one night to the next and there is no way program the color changes, just shades of RGB. I'd like to have red, white and blue for the 4th and purple, orange and strobes for Halloween and not wanting to spend $250 for the fancy controller I thought I'd give it a try and maybe learn something along the way.

So here's what I'd like to see in my controller:
Connect via WiFi to change colors
Be able to load in scripts for different schemes
Come on at night and off during the day
Make it so easy my wife can use it
Remote control from Ipad app
Database of holiday lighting schemes (probably unnecessary but cool)

So I have the basics and now on to build the rest. David was helpful (patient) the other evening in explaining MOSFETs and transistors as well as mixing the 5v Pi with the 12v LEDs. So here's the next piece to the puzzle:

Bread Board (really starting at the beginning here)
N-channel MOSFETs
Adafruit 16-Channel 12-bit PWM/Servo Driver – I2C interface
Pi Plate or Cobbler
Light sensor

Here's a link to the basic setup:
http://learn.adafruit.com/rgb-led-strips/overview

If there are any suggestions out there I'd love to hear them. Until the next update, John
John Woj
IdeaMakers Designs, LLC
"I'm on the the verge of something" Breaking Bad

Reply
05-09-2013, 09:31 AM,
#2
RE: Raspberry Pi LED Controller Build
Things are proceeding slowly with the Pi project, installed both the Raspbian and Occidentalis images on SD cards to give both systems a try. Mostly waiting on the driver board to arrive so I can hook up the wiring. Since there are not many output pins on the Pi the driver board is necessary to split the output into the three RGB channels. Or at least that is how I'm explaining it to myself.

I'm able to ssh to the Pi start a VNC server and access the Pi over VNC. So I need to add VNC to the startup and setup an email system so the Pi can email its IP addy since it isn't hooked up to a monitor at this time. Or I could setup the PHP server so the front page would show the IP by going to raspberrypi.local in a browser. Mostly needed for when I'm going back and forth between home and SpokaneCreate!.

Came across a nice little app called Ardumote for the iPad that lets you setup buttons on the screen (sort of a gui app app) that will send messages to the Pi which looks like a good way to easily control and change the light settings. Even has sliders for adjusting each channel.

Till the next update, John
John Woj
IdeaMakers Designs, LLC
"I'm on the the verge of something" Breaking Bad

Reply
05-11-2013, 08:32 PM,
#3
Soldering
As Dan likes to say, Build It, Own It, here's a photo of all the pieces parts that need to be soldered together.

[Image: P1020957.jpg]

In front is the Prototyping Pi Plate which mounts on top of the Raspberry Pi and will hold all the pieces when soldered together.

In back is the 16 Channel Servo Driver which breaks up the controls for the individual RGBs and does PWM. I could control 4 separate LED strings from the one board but fortunately for the neighbors we are only doing one. This board can also do motor / servo control and you can connect up to 16 PWM devices to just the single board.

And the little board is the luminosity sensor.

Time to polish up my soldering skills, John
John Woj
IdeaMakers Designs, LLC
"I'm on the the verge of something" Breaking Bad

Reply
05-20-2013, 07:34 PM,
#4
Raspberry Pi LED Controller Build
It Works!!! Here's a quick video of the LED setup with iPad remote control.

[video=youtube]http://youtu.be/v7MRwhAVRgU[/video]

So here's the basic setup so far, the Pi Plate sets atop the Raspberry Pi. This is wired to the Adafruit servo controller on the bread board along with the transistors that control the LED states.

I'm using the Ardumote app and Python script for the iPad control, the script is running as a Linux listening service and when an button is pushed on the app it catches the message sent by the button. I'm then using the RGB_Driver python script to change the state of the lights.

I can see these two scripts being combined into one that will repeat all night long and also there is some hardware programming in both that will be interesting to learn. My thanks to Dan for the quick fingered Google on running a python script from within a python script.

Off to solder it up, John
John Woj
IdeaMakers Designs, LLC
"I'm on the the verge of something" Breaking Bad

Reply
05-21-2013, 08:12 AM,
#5
RE: Raspberry Pi LED Controller Build
Looking good John! Those RGB LEDs are fun to play with. At my last job, I did the firmware and linux drivers for our lighting controller. It was an FPGA controlled board that could drive 4, 300 light strips independently. Those lights were used in the cabinet of a slot machine, and had an interface that allowed our game designers to program light sequences and effects that were timed to the game and game events. You can see them in action in this video: http://www.youtube.com/watch?v=YJVtvLMnJ_4 I have a bunch of other lighting videos on my phone that I can't upload to youtube, but could show you some time.

One of these days I'll be able to make it to a meeting again and check out all the cool projects people are working on.
Reply
05-21-2013, 06:22 PM,
#6
RE: Raspberry Pi LED Controller Build
Good job getting this all put together so quick! Are you going to bring it by tomorrow?
Reply
05-22-2013, 07:28 AM,
#7
RE: Raspberry Pi LED Controller Build
Hi David, yes I'll bring it to the Wednesday night opening. Been a fun beginner project.

Hi Pete, Thanks for the link to the video. I like the sort of fog or mixed color effect around the edges of the slot. I think those are addressable LED lights aren't they? I'm using just plain LED modules, need to slowly convince the neighbors these are cool without annoying them.

John
John Woj
IdeaMakers Designs, LLC
"I'm on the the verge of something" Breaking Bad

Reply
05-22-2013, 07:59 AM,
#8
RE: Raspberry Pi LED Controller Build
Each strip was individually addressable, but the lights on each strip were not individually addressable due to cost reasons. The covers over the lights (the trim around the cabinet) was chromed on the outside, so when the lights were off, all you saw was chrome. When on, the light was visible. This also provided for interesting effects when machines were next to each other, as the chrome would reflect and blend the light from nearby machines.
Reply
07-31-2013, 01:28 AM,
#9
RE: Raspberry Pi LED Controller Build
Hey Guys well i think that most appreciating pics related to Raspberry Pi board.Thanks!!
Reply
10-04-2013, 02:23 PM,
#10
RE: Raspberry Pi LED Controller Build
Well summer is over so time to get back to LED controller, sorry for the overdue update. Here's a photo of the assembled PI board(s).

[Image: P1030427.jpg]

Well you can sort of make it all out but at the bottom is the Pi Plate which sits on top of the Raspberry Pi and connects via the GPIO. Soldered onto this is the 16 Channel Servo Drive (front of the photo) with the red, yellow and white wires coming off the pwm, 3 transistors (behind all the wires) for controlling the 12 volt RGB Lights and the Luminosity sensor (below the loop of wires).

I've been working on the python scripts to make it all functional combining a database of sunrise / set times but more on that later. Nate was helping me understand the PWM and we came across a rather fun frequency and phase control that I'd thought I'd show and try to explain since that is usually how I learn. So please correct me if I'm wrong about this concept.

We all know that you can blink an LED light by adjusting the hertz cycle (Frequency), around 25 hertz the eye can make out the on / off cycle, above that and the LED looks like it is on all time since it is blinking to fast for our eyes to detect. Well we can do this in the python script through the Adafruit_PWM_Servo_Driver with the command:

pwm.setPWMFreq(60)

Where 60 can be any Frequency of 25 hertz or more. But then we can also adjust the Phase of the Frequency so that within each cycle we are also cycling the 3 channels of lights (RGB).

pwm.setPWMFreq(25)
pwm.setPWM(2, 0, 25) #Blue Channel
pwm.setPWM(1, 2700, 2725) #Green Channel
pwm.setPWM(0, 4070, 4095) #Red Channel

We are taking each cycle of the Frequency and breaking it down into 4095 parts and then turning on each of the different colored lights at different times during each cycle. Kind of cool but unfortunately we aren't able to (at least not yet) set the Frequency below 25 to really show the individual lights turning on and off. I was able to shoot a grainy youtube video of this though and the camera FPS does pick up the effect.

[video=youtube]http://youtu.be/n6sfsuzNXj0[/video]

What you are looking at is the LEDs under a piece of paper and at first the Frequency is set to 25 hertz and a white bar runs up the video. Then the Frequency is kept the same but the phase shift turns on the line running up the video turns to red / green multiples. Yes sort of simple for ye engineers out there but interesting to a few of us. Here's the complete code:

pwm.setPWMFreq(25)
pwm.setPWM(2, 0, 25) # all lights on at the same time
pwm.setPWM(1, 0, 25) # 25 is a dim setting for the video
pwm.setPWM(0, 0, 25)
time.sleep(3)

pwm.setPWM(2, 0, -1)# all lights off
pwm.setPWM(1, 0, -1)
pwm.setPWM(0, 0, -1)

pwm.setPWM(2, 0, 25) #varying on / off times for each light
pwm.setPWM(1, 2700, 2725)
pwm.setPWM(0, 4070, 4095)
time.sleep(5)

Next time getting is all to work: combining databases, luminosity sensors, cron and some Halloween trickier to get it all to work.

John
John Woj
IdeaMakers Designs, LLC
"I'm on the the verge of something" Breaking Bad

Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)