loading
Picture of Arduino Based Meter - a many LED Driver
As the direct result of a question in the Instructables forum, for a bargraph to display data on the dashboard of a car, a custom electronics instructable.

Here, for your delectation is the Car-barDuino, a simple display system for analog and digital stuff, for a car, for a timer, for a thermometer, for whatever. I built it for a manifold pressure meter for friends car, I'm going to use it at work for some monitors in a research instrument.

Under the hood, it uses a micro configured to run "Arduino" sketches, so anyone can play with the code. All the spare I/O has been brought out to connectors to play with.





Enjoy and employ.

 
Remove these adsRemove these ads by Signing Up

Step 1: What it can (and can't) do

Picture of What it can (and can't) do
In its current form, we can drive 2,  7 segment displays and a 30 element bargraph. We can mix LEDs from red/green/yellow, but it can't drive white or blue. If there was enough interest, I'd redo the design to allow higher voltage LED technology to be used. The current design is open ended, since each MAX7221 can be connected to the next over just 5 wires, and each can drive 64 LEDs at once.

There are 15 levels of digital control of LED brightness, and a SINGLE resistor to set the maximum brightness of all of the LEDs on one chip.

The processor can be any standard Arduino (Atmega 168 or 328) and with the ICSP connector, you can burn your own bootloaders.

The input interface uses a simple current limiting resistor and two diode clamps to the 5V rail. DON'T make a habit of driving into the clamps !

There are no input scaling resistors on the circuit at the moment.

Step 2: How it works

Picture of How it works

Here are the schematics.  At the right hand end, Its a generalised, basic ATmega 168 or 328 layout, with the FTDI interface cable for serial connection to the outside world, and the ICSP connector for fast programming and/or bootloader installation.  The LEDs are driven by a Max 7221 or Max 7219 (datasheet)

There are currently only two analog inputs wired, and they have diode clamps to the 5V supply rails.

The unit is designed to run off a 12V supply, there is an on-board 5V regulator that barely gets warm at all in use.





Car-barduino.pdf(431x164) 152 KB
car bar schematic.pdf(1040x807) 77 KB

Step 3: Building one

I designed the PCB by hand, but the PCB was made professionally. I like putting big ground planes on my boards, since it kills noise dead at the source, but it makes the board hard to make well at home. Its also seriously double sided and plated through. Whereever ground connections are made to ICs, the connection is direct to the ground plane. There are also several capacitors, which again reduce noise, so don't omit them. I am sure Maxim must have had a neat layout planned when they designed the 7221 , but I'll be damned if I can see it yet. I gave up on my auto-router too - the tracking looked nasty.

The Bill of Materials shows what you need. Suggested sources ? In the UK, Rapid, RS and Farnell have everything. Farnell is Newark in the USA.

Assembly has been made deliberately easy, since Chris, who suggested it (Hi Chris !!) hasn't got access to surface mount assembly, and should present no problems at all to anyone with decent soldering skills. There are a couple of simple SM capacitors to fit, and a resistor, which should be fitted before the Arduino !!

If anyone is interested, I have some spare PCBs that I can sell on - it turned out to be as cheap to make 5 as 1 ! Go figure.  The board has a couple of very minor screwups that I'll fix if I make more of 'em, but the lucky first buyers get to fix their own.

Step 4: Using it

Picture of Using it
The coding is pretty simple. I integrated the whole thing using the excellent LEDcontrol library in Arduino, and it worked off the shelf.

You need to look at my "ledSetup" command to allocate the right pins to the MAX7221, and I also made things better by limiting the scanregister to 4.

Take a look at my pin mapping functions in "BarGraph" I can do dots, and bars. A bit more work, probably with the mapping function and you could do some really neat animations.

The source includes a digital filter called an "exponential forgetter" or first order low-pass filter. Its designed around binary math as far as possible, for high speed operation using shifts and not explicit multiply operations.

The input (0.1024) digits is scaled to 0..30 digits currently: there's no reason not to scale it 0.99 for the 7 segs, and scale it 0..30 for the bar.

I've got several little projects lined up, a VU meter is pretty obvious - the next gen board'll squeeze in two rows of bar, probably only 20 bits per row !

Design requests.

A couple of folks have asked about adding OBD-II interfaces to the thing. I am looking at suitable interfaces for it at the moment - there are three different standard interfaces !!

What I WILL be doing on my next boards is two rows of 20 bars + 4 digits, 2 on each line. Optionally, you can have just 30 bars on each line.

Projects
Here's a (future) list of other projects running on the same hardware. If you've got a project you've done using it, let me know in the comments and I'll add a link here:

  • VU meter, coming soon
  • Reaction timer
  • Bath thermometer
  • Kitchen timer
  • TDS/EC meter
  • Moisture meter
  • Vacuum/Boost Gauge (gage !)  by skullmaster20
DillyDog1 month ago

Great concept! I'm thinking of a sleek wall clock showing the time in a bargraph. Will this easily expand to 2 bars of 60 LEDs each (making 120 LEDs)? I don't immediately see why not.

steveastrouk (author)  DillyDog1 month ago

Yes. use 2 boards. You only need the processor on one of the boards. They were designed to be cascadable.

rendermatt4 years ago
Very nice. I'm sure I will find use for one of these one day! Haha, the reset mode reminds me of my knight rider scanner
http://www.youtube.com/watch?v=voQxDf_DTrk
Llamarama5 years ago
Minimalist design at it's very finest! Is it possible to connect an external sensor, somthing like a hall sensor, and use this as a speedometer/tachometer?

Either way an interesting concept!
steveastrouk (author)  Llamarama5 years ago
Yep, its eminently possible.

Listen carefully, because this spec even confuses me ;-)

The new board I have done (ready for a prototype or two) has TWO rows. You can use 2 digits on the top row, and 20 bars, or you can have no digits and 30 bars.

The 2nd row has provision for none,  2 or 4 digits. no digits 30 bars, 2 digits 20 bars and 4 digits no bars.

The board is standalone arduino....or it will work as a shield, if you don't populate the board, or it can accept shields.

AND it has expansion slots, so you can extend the display to EIGHT 7221s.

Its only very slightly wider than the MK1 board in the article.

Steve
Very confusing, but I think I have it. :)

So in theory I could have 2 Digits for 99MPH then the 20 bars for a tachometer, or 4 digits for MPH and RPM.

If I chose to extend I could have 8 digits and 40 bars? Or would I have to use 2 boards with 4 digits and 20 bars.

Or some variation thereof, I think, perhaps, sort of, mabey...

Regardless thoroughly intrigued and I will follow with great interest! :)
steveastrouk (author)  Llamarama5 years ago
See ? Now I'M confused, and I designed it ROFL.

I could have 2 Digits for 99MPH then the 20 bars for a tachometer, or 4 digits for MPH and RPM.

Yesssss.

I could have 8 digits and 40 bars? Or would I have to use 2 boards with 4 digits and 20 bars.

Only on two boards.

Looking at OBD functionality at the moment as well, as a shield board.

Oh well, that would simplify programming greatly, 1 board for the speedo and one for the tacho!

Now to get a grip on programming! How I long for a world of logic gates and PROMs! LOL!
steveastrouk (author)  Llamarama5 years ago
Here'e the latest board design. Hope you can see the idea.

Steve
tacho2bar.jpg
I see what you mean now! Looks like a good board! Can't wait to see the final product!
steveastrouk (author)  Llamarama4 years ago
Final board is in my hands now. More news when I put the chips on. ...


Stece
I am now extremely excited! :) Can't wait to build this myself!
Jeffrey G C4 years ago
i cant get it to download, ive tried to save it, but it wont let me save it as anything other than .tmp
steveastrouk (author)  Jeffrey G C4 years ago
Save it and rename it.
neutron75 years ago
Hi i am trying to download your code, i want to have a look at how you use a bargraph and 7 segment separately on max 7221 (im doing 7 seg + LED indicators) it points to a temp file.
steveastrouk (author)  neutron75 years ago
Hi,
Save the file as a .pde file and open in Arduino.

Steve
Jayefuu5 years ago
When are you adding the videos? :)
steveastrouk (author)  Jayefuu5 years ago
When I reshoot with the other 10 leds on the bar.

Steve
steveastrouk (author)  steveastrouk5 years ago
Video is up now.
Where? Are you shure? There is a blank space where the video should have been.
steveastrouk (author)  mhkabir5 years ago
Hi Kabir,
Yep, first step :-)
If you can't see them, let me know and I'll send you the links.
Steve