0
\$\begingroup\$

.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.

\$\endgroup\$
3
  • \$\begingroup\$ What kind of digital input? A USB port? 8 bits available in parallel? A single bit of varying duration/frequency? Nothing can be done without some detail. \$\endgroup\$
    – DarenW
    Commented May 1, 2013 at 5:31
  • \$\begingroup\$ @DarenW digital input being a microcontroller gpio. \$\endgroup\$
    – Passerby
    Commented May 1, 2013 at 5:39
  • \$\begingroup\$ Of course, the 4017 is a decade counter. It's not even a shift register. It wouldn't help. Jon's answer of pwm on a data pin is basically the only solution, short of extra hardware like a io expander, second microcontroller/pic or a 10 bit flip-flop circuit. \$\endgroup\$
    – Passerby
    Commented May 3, 2013 at 9:12

2 Answers 2

3
\$\begingroup\$

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 :-)

\$\endgroup\$
1
  • \$\begingroup\$ I'd simply use 10 digital output pins of the uC to drive 10 LEDs arranged in a bar directly Or multi/charlieplex them, if your mcu can spare the cycles. The other option is replacing the lm3914 with a gpio/port expander \$\endgroup\$
    – Passerby
    Commented May 1, 2013 at 5:41
2
\$\begingroup\$

Instead of converting to analog, and then back to digital, just drive the LEDs directly from the MCU, keep it digital.

If you don't have enough IOs to drive the LEDs, you can multiplex them, or hang them off a shift register, or off a SPI or I2C IO expander, or latch them, or... lots of possibilities, but more information is needed!

\$\endgroup\$
0

Not the answer you're looking for? Browse other questions tagged or ask your own question.