PIC16F628 4 RGB LED PWM Controller

20,585

Circuit Image

The complete schematic for the driver is provided. A PIC16F628 microcontroller has been selected due to its low cost, internal oscillator (4 MHz), and built-in USART. It is important to note that there is an error in the schematic; a pull-up resistor on RA5 (pin 4 in the schematic) is required. An updated schematic and board can be found at the bottom of the post. Additionally, a decision was made to have a PCB printed for the first time, with boards produced by BatchPCB.com at a cost of $5 each. The total cost for four boards, including shipping and handling, was $32.36 ($20 for the boards and $12.36 for shipping). Although the delivery took some time, the quality of the boards justified the wait. The first revision of the board contains an error; a pull-up resistor on RA5 (pin 4 in the schematic) is necessary. Compensation for this mistake can be observed in the second picture provided (on the back of the upper-left board). This issue will be addressed in future revisions. The current firmware includes eight commands, as the ninth command, self-test, was removed to conserve memory. The source code for the firmware contains details on how the commands are implemented, along with examples of usage.

The schematic features the PIC16F628 microcontroller, which operates at a frequency of 4 MHz, making it suitable for various applications requiring moderate processing capabilities. The internal USART facilitates serial communication, allowing the microcontroller to interface with other devices. The inclusion of a pull-up resistor on RA5 is critical for ensuring proper logic levels during operation, particularly when the pin is configured as an input. The printed circuit board (PCB) design was executed by BatchPCB.com, known for their cost-effective PCB manufacturing services.

The total expense of $32.36 for four boards reflects the economical approach to prototyping, enabling the designer to test the circuit without significant investment. The design process included an iterative approach, with the first revision revealing the necessity for the pull-up resistor, which highlights the importance of thorough testing and validation in electronic design. Future revisions will incorporate this correction, improving the reliability of the circuit.

The firmware implemented on the microcontroller supports eight distinct commands, providing flexibility for various applications. The removal of the self-test command demonstrates a consideration for memory management within the firmware, ensuring that the most critical functions remain available. The source code serves as a valuable resource for understanding the operational commands and their implementation, offering insights into the programming logic and structure used in the firmware design. Overall, this project exemplifies the process of designing, prototyping, and refining electronic circuits while leveraging cost-effective manufacturing solutions.Here is the full schematic for the driver. I chose to use a PIC16F628 as the microcontroller because it is cheap, has a internal oscillator (4 MHz) and an internal USART. NOTE: There is an error in this schematic and a pull-up resistor on RA5 (pin 4 in the schematic) is necessary.

See the bottom of the post for an updated schematic and board. I de cided I would try getting a PCB printed for the first time, so I got boards created at BatchPCB. com for $5 each. The total for 4 boards shipped was $32. 36 (4 x $5 for the boards and $12. 36 for shipping and handling). They took a long time to arrive, but the quality was well worth the wait. NOTE: There is an error on the first revision of the board and a pull-up resistor on RA5 (pin 4 in the schematic above) is necessary. You can see how I compensated for the mistake in the second picture below (look on the back of the upper-left board).

This will be corrected in future revisions. See the bottom of the post for an updated schematic and board. The current firmware has 8 commands (the 9th, self-test was removed to save space). See the source code for the firmware for how the commands are implemented, but here is some example usage: 🔗 External reference