Digital bargraph display driver circuit

digital-logicmicrocontroller

.For a project I need to display a progress bar of the activity performed by my MCU. For this purpose I am going to use a bargraph display, but the problem is that bargraph display driver driver IC LM3914 uses analog input where as MCU produces a digital output.

How can I display a value on bargraph using digital input instead of analog? The bargraph should display values from lower to higher and higher to lower. Schematics will be highly appreciated.

UPDATE:

FIFO is more important then moving the value in backward direction.

I only have two data pins available on uC (PIC16F84a) to drive a Bargraph display, and IO expander will increase the cost of system.
I tried IC 4017 for the purpose, but it provides only one ON pin at a time.

Best Answer

schematic

simulate this circuit – Schematic created using CircuitLab

If your microcontroller can output PWM, then set it to a high PWM frequency, and use a low-pass filter to generate a voltage. Something as simple as a resistor from PWM output to a capacitor, and a resistor across the capacitor to ground, as well as signal into the bar graph input, will probably work well (enough).

Try a 10k resistor in, and a 1 uF capacitor, and a 10k resistor in parallel with the capacitor. This is assuming that the bargraph has a high impedance input. If there is a significant load in the bargraph input, R2 is not needed.

The duty cycle of the PWM output will determine the voltage that gets sent to the bar graph. Just make sure the uC output voltage range is compatible with the bargraph input; else re-buffer with an opamp or source follower or whatever.

If I had this problem, though, I'd simply use 10 digital output pins of the uC to drive 10 LEDs arranged in a bar directly :-)

Related Topic