led bar light with transistors

Thread Starter

Nanda Kumar 1

Joined Aug 25, 2016
42
Hi to all ,

I designed a circuit which give a led bar lighting .This circuit perfectly working with external power source to the input(that in puts varies from 1v,2v,3v,4v,5v for 1v =1st led will glow ,for 2v 1st 2nd led will glow for 3v 1st,2nd,3rd leds will glow,for 4 volts 1st,2nd,3rd,4th leds will glow). But when I am connecting to the micro controller of i/o pin the same circuit which giving all leds glowing at a time for 1 volts.Give me any suggestions . I attached the schematic .
 

Attachments

Dodgydave

Joined Jun 22, 2012
11,395
It will light up all leds at once, your circuit needs the bases driven separately from the microcontroller, each base needs a higher voltage limit like using zeners or use a Lm3914 bargraph chip.
 

AlbertHall

Joined Jun 4, 2014
12,625
It will light up all leds at once, your circuit needs the bases driven separately from the microcontroller, each base needs a higher voltage limit like using zeners or use a Lm3914 bargraph chip.
The different thresholds are set up by the different resistors on the transistor bases.
 

Thread Starter

Nanda Kumar 1

Joined Aug 25, 2016
42
It will light up all leds at once, your circuit needs the bases driven separately from the microcontroller, each base needs a higher voltage limit like using zeners or use a Lm3914 bargraph chip.
Thankyou for replay @Dodgydave .
1) I want to drive all five LED's with single micro controller i/o pin .And that i/o pin generating different voltages 1v,2v,3v,4v,5v. That voltages iam generating with the help CCP pwm pin .Now the issue is the above circuit working fine with when iam connecting to the external power supply, Led's glowing according to the input signal (input voltage from the external power supply i.e 1v,2v,3v,4v,5v) , but when I am interfacing with the my micro controller i/o pin for 1 volts input signal glowing all leds .
2) I am using resister voltage divider network there to provide the voltage to the Base
 

AlbertHall

Joined Jun 4, 2014
12,625
Thankyou for reply @AlbertHall .I'am using ccp to generate a PWM signal . I am able to measure that different voltages with DMM .
A PWM signal is a 0V to 5V square wave. The voltmeter will read the average of that waveform, but your LEDs won't. During the 0V section the all LEDs will be unlit and when it is 5V all the LEDs will be lit so your eyes will average that and see all of them lit. You need a low pass filter between the uC and the LED circuit to average out the waveform to a smooth DC voltage. As the input resistance of the LED circuit is low it makes a simple RC circuit unlikely to work well so I think you will need an op-amp circuit to do the job.

Try the circuit below and make the cut-off frequency one tenth or perhaps one hundredth of the PWM frequency.
http://www.electronics-tutorials.ws/filter/filter_5.html
 
Top