Fading LEDs via PWM

Schematic Overview
           The schematic for this project was kept as simple as possible so that the focus could remain on how the touch screen works and how we interface to it. You can see the completed schematic for this project below. The main parts in the schematic are the LM7805, 18F1330 and Assorted LEDs.

View Full Schematic

Schematic Specifics

Power Regulator
           The 7805 regulation circuit is nothing special. Connect a battery to one side, that has +7.5v or more and the output is +5v. A 47uF dc filtering cap is added to allow the PIC to operate flawlessly.

LED Circuit
           The LED circuit consists of the connection from the microcontroller to the 2N2222 transistor. The transistor provides a ground for the LED when it is switched on, allowing the led to be turned on. When the transistor is in the off state, the LED has no ground so current cannot flow through it, therefore the LED is off.