Navigation

Tuesday, 23 December 2014

How to Connect LED (Current Source and Sink)

A Light Emitting Diode (LED) can be connected in either way as shown the the following diagrams:


When connecting an LED to a microcontroller, a current source or current sink configuration can be followed.

For Current Source configuration, the LED output is sourcing current so it flowing out of the microcontroller output. In this case, the LED is connected between the GND and the microcontroller output pin. This means that the LED will be switched ON when the microcontroller output is HIGH and switched OFF when the microcontroller output is LOW. This is as shown below, D13 is represented by a pin on the microcontroller.

For a Current Sink Configuration shown below, the LED output is sinking current since it is flowing into the microcontroller output. Tn this case, the LED is connected between the positive supply and the microcontroller output. This means that the LED will be switched ON when the microcontroller output is LOW, and will be switched OFF when the microcontroller output is HIGH.
To determine the value of the current limiting resistor to use, the formula bellow is used:
Where Vcc is the supply voltage; Vf is the LED forward voltage and I is the LED forward current. Vf and I are given in the datasheet of the LED. Therefore, if a supply voltage of 5V is to be used and Vf=1.5V; I = 10mA, the current limiting resistor to be connected will be given by



Monday, 22 December 2014

DC Barrel Power Jack Socket Pinout

This is a common barrel-type power jack for DC wall supplies. Its pinout is as shown in the figure below.

Saturday, 20 December 2014

How to Connect LCD to the Arduino


A Liquid Crystal display is connected as follows. D12, D11, D5 - D2 pins as shown in the figure above corresponds to pins 12, 11, 5 - 4 pins on the Arduino. For the VEE pin, a 10KOhm potentiometer can be used instead. For a 16-pin LCD, the A pin is connected to 5v while the K pin is connected to GND. It is optional to connect the A and K pins as they are used for the backlight of the LCD.