Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

Bargraph programming (and hardware) help please .....

Status
Not open for further replies.

Azaruk

New Member
I am putting together an ultrasonic reversing alarm/display for the heavy transport industry.

Using the SRF04 sensors into a PIC for processing and display. There are two sensors - and two displays.

I would like to display distance from rear of trailer to loading dock by means of two bargraphs. Minimum of 10 segments, prefer 16, but 20 segments would be cool.

I'm looking for an elegant and simple solution to the problem of driving the led bargraphs with the minimum number of PIC pins.

I will probably multiplex the two bargraph channels to save on pin commitments.

I would be OK with using additional hardware to solve the problem.

Anyone got any absolutely brilliant ideas?
 
A few years back I used a 16F876 to feed 2 rows of 16 LED's multiplexed together. I used two pins as analogue inputs, and two more for switches.
One switch selected dot or bar mode, the other linear or log mode - basically a double, enhanced, LM3914/3915.
 
Pin Count

That sounds like the sort of thing I'm looking for. I have experience with the 3914/5 chips.

Did you commit your output pins to directly drive the 16 led's?

I was thinking of using 4 lines to interface to a counter, but need bar graph (not dots) so counter would have to activate all pins up to the indicated count to provide an adequate display. Am I making any sense here?

The reason I don't want to commit too many pins is due to the fact that whenever something like this is put together, new ideas come out of the woodwork - some of them excellent - so having a few uncommitted pins would be a useful 'feature'.
 
You might consider using N(N-1) multiplexing where N is number of pins. 5 pins can drive 20 LEDs.

led_bar-dot_prototype-jpg.7001


Or use 6 pins to drive 30 LEDs.

**broken link removed**
 
Last edited:
Mike - thanks. That's a seriously elegant solution. Do you mind if I use it?
I would never have come up with that by myself! If I have trouble coding this display, may I ask for help?
Thanks again.
 
Please use it. I hope it works out for you. But please note that these Charlieplexed or N(N-1) multiplexed designs do not light the LEDs to full brightness when you have more than a couple columns and you may not see the display at all if it's in direct sunlight.

If you require full brightness and/or PWM brightness control in your product (from super bright to black) then you may want to consider another high performance reduced I/O design I developed that utilizes standard multiplexing and an 8 bit serial-to-parallel sinking driver IC. While the design was originally intended for driving large numbers of 7-segment or 8x8 matrix displays using a 9 or 10 pin interface, it scales down well when you have lower I/O pin requirements.

In this scheme 1 driver IC and 3 PIC pins will drive 16 LEDs, 4 pins will drive 24 LEDs, 5 pins will drive 32 LEDs, and so on. The pins are multiplexed via the PIC PWM signal to form both a column driver bus during the display "on" time (PWM off time) and a data bus to load the serial-to-parallel sinking driver IC shift register during the display "off" time (PWM on time).

The drawing below shows 7-segment displays but I'm sure you realize those can be replaced by the discrete LEDs in standard Bar/Graph displays. The drawing also shows two seperate displays, each with its own driver IC, but, again, I'm sure you realize you only need a single display and driver IC for your 20 LED Bar/Graph.

Have fun. Regards, Mike
 

Attachments

  • Matrix Display (4 pin).PNG
    Matrix Display (4 pin).PNG
    37.3 KB · Views: 511
Last edited:
Status
Not open for further replies.

Latest threads

New Articles From Microcontroller Tips

Back
Top