Description: 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. The control of the RGB led is made with PWM (Pulse Width 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). More: 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.
The project utilizes a Piranha Super-flux RGB LED configured as a common anode device, interfaced with a PIC18F25K20 microcontroller. The primary objective is to generate various color combinations through two operational modes: an automatic mode that cycles through a pre-defined sequence stored in the microcontroller's memory and a manual mode that allows the user to select from seven distinct colors.
The RGB LED is controlled using Pulse Width Modulation (PWM) techniques. The PIC18F25K20 microcontroller is equipped with only two hardware PWM outputs. To achieve control over all three colors (Red, Green, and Blue) of the RGB LED, software PWM techniques are implemented. This is accomplished by leveraging TIMER0 to generate the necessary timing signals for PWM control, effectively allowing the microcontroller to simulate additional PWM outputs.
For user interaction, push buttons are employed to switch between the automatic and manual modes, as well as to choose specific colors in manual mode. A significant challenge arises from the mechanical characteristics of push buttons, which can lead to erratic state transitions due to bouncing. This bouncing results in multiple high and low states being detected during a single press, potentially causing unintended behavior in the circuit.
To mitigate this issue, a software-based de-bouncing algorithm is implemented. This approach avoids additional costs associated with hardware solutions, such as RC delay circuits or Schmitt triggers. The software algorithm ensures that only a clean, single transition is recognized for each button press, thereby enhancing the reliability of user inputs and ensuring smooth operation of the color selection functionality.
Overall, the design emphasizes efficient use of microcontroller resources, effective user interaction through intuitive controls, and robust handling of mechanical switch behavior, making it suitable for applications requiring dynamic RGB color control.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. 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).
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.
This project demonstrates the use of an ATTiny microcontroller and an RGB LED to create a light that continuously cycles through random colors, with the ability to change color dramatically at the press of a switch. The inspiration for this...
Security is a primary concern in daily life, and an access control system is a crucial component of a security framework. The microcontroller-based digital lock described here is an access control system that permits only authorized individuals to enter a...
The reflected infrared (IR) signal detected by the photodiode is sent to a signal conditioning circuit, which filters out unwanted signals and amplifies the desired output.
The circuit begins with a photodiode that captures the reflected IR signals. The photodiode operates...
The following circuit illustrates the sensor circuit of an analog line follower robot. Features include control by a microcontroller and a sensor circuit.
The sensor circuit for an analog line follower robot is designed to detect the presence of a line...
Microcontrollers (MCUs) are versatile integrated circuits that enhance the functionality of electronics, robotics, and other projects. However, they...
Microcontrollers (MCUs) serve as the central processing unit in a variety of electronic applications, offering programmable control that allows for complex functionalities in...
This circuit employs an 87C57 microcontroller along with several peripherals to convert X-10 power-line carrier-code formats from a personal computer for use with an X-10 power-line interface in a home-control system. Software details can be found in the reference.
The circuit...
Speed control is achieved through pulse width modulation (PWM) of the gates of two MGP20N45 TMOS devices. Consequently, the motor speed is directly proportional to the pulse width of the incoming digital signal, which can be generated by a microprocessor...
A Microchip PIC12C508 8-pin CMOS microcontroller controls a night light, turning it on and off at preset times every day. It is designed to save energy, produce no electromagnetic interference (EMI), and operate without batteries, featuring a built-in lamp fixture...
The article on the RGB LED fader has been one of the most visited articles on this blog. Since its publication, another microcontroller-based RGB LED project has been designed and built, this time controlling the colors from a computer via...
We use cookies to enhance your experience, analyze traffic, and (if you allow) serve personalized ads.
By clicking Accept All, you agree to our use of cookies.
Learn more