Super Flux RGB LED Controller

002

Introduction

In this project it was used the “Piranha Super-flux RGB” Led of common anode, and the PIC18F25K20, in order to generate combinations of colors. It has two function modes, automatic that generate the color sequence that is stored in the μC memory, and the manual mode in which you can select one of the seven possible colors.

Schematic

Schematic

Firmware

The control of the RGB led is made with PWM(Pulse With Modulation), because PIC18F25K20 only have 2 PWM outputs (Hardware), I did the PWM by software to have 3 PWM outputs for that I use TIMER0 and for the Manual mode I use IOC(interrupt on change).

De-bounce

In this project I use push buttons to change between modes and to change the colors. But if we use the button as in the circuit (1) we have a problem. The problem with this configuration, due to the mechanical nature of any switch that may contains spring return action of some kind, there won’t be a clean transition from a state to another, but instead there will be a series of high and low states spikes. To solve that problem we have to implement a de-bouncing system, it can be done by hardware or software. We can use a RC delay circuit or it can be done with a schmitt trigger, but both ways will increase the price. So I done by software the de-bounce.

Example of code to do de-bounce:

code

 

It can be done in a different away but this way works for me.

PSU

I use a 7812 voltage regulator to keep the voltage stable in the RGB led and for μC I use an LM317 voltage Regulator. To calculate the output of LM317 I use this equation:

equation1

Led RGB

I use different resistor values on the RGB Led because which color have a different VF (Forward Voltage) in order to have the same LUX for each color. To calculate the resister I use these equations:

equation2

001

 

Comments

  • I am looking for a product similar to Sonoff basic but that has the function of power on maintained after a power outage and that has more stability in the connection with your app, or that works locally, does this product do what I need? celularespia*gmail

    4 months ago
    • admin

      I am afraid not. This is something different than Sonoff. What would you like to achieve?

      3 months ago

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.

RELATED PROJECTS

By continuing to use the site, you agree to the use of cookies. more info

The cookie settings on this website are set to "allow cookies" to give you the best browsing experience possible. If you continue to use this website without changing your cookie settings or you click "Accept" below then you are consenting to this.

Close