Sunday, 10 February 2013

Raspberry Pi and Leds strip RGB

This project came up with my friend who wanted cover his room with leds strip and control all of them with a simple http request.
The idea was to be able to change color and the brightness, so I had to buy just a few components to make the controller:

  • 4x MOSFET N-Channel STP75NF75
  • 1x Breakout Adafruit
  • 1x 16 Channels servo Adafruit
  • 1x PCB
  • some wires

I just placed all my components on a PCB board, connected the 16 channels servo via I2C and each MOSFET to the leds strip.

Why MOSFET and 16 Channels?
Someone is maybe asking why I am doing this total mess with MOSFET.
The answer is that the 16 Channels couldn't give me the same result that I was expected. This means I couldn't pass the max power through this board, so I avoided the problem by using  4 MOSFET that are getting the main source power, 12V, and Raspberry is sending the right pulse to each ones.

HTTP Request
My friend made a little script in Python that is waiting for a POST request with Red, Green, Blu, Power as parameters and then it will send the new color through the 16 Channels.

I don't really have so much code, I took the example from Adafruit to drive the 16 channels ( 3 lines ) and then parsed the 4 parameters to send the value between 0 and 4095.
Obviously I can post something if someones needs a little guide how to parse these values =).