Step 4: 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.

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
<p>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.</p>
<p>Yes. use 2 boards. You only need the processor on one of the boards. They were designed to be cascadable. </p>
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<br> <a href="http://www.youtube.com/watch?v=voQxDf_DTrk">http://www.youtube.com/watch?v=voQxDf_DTrk</a><br>
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?<br /> <br /> Either way an interesting concept!<br />
Yep, its eminently possible.<br /> <br /> Listen carefully, because this spec even confuses me ;-)<br /> <br /> The new board I&nbsp;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. <br /> <br /> The 2nd row has provision for none,&nbsp; 2 or 4 digits. no digits 30 bars, 2 digits 20 bars and 4 digits no bars. <br /> <br /> The board is standalone arduino....or it will work as a shield, if you don't populate the board, or it can accept shields. <br /> <br /> AND it has expansion slots, so you can extend the display to EIGHT&nbsp;7221s.<br /> <br /> Its only very slightly wider than the MK1 board in the article. <br /> <br /> Steve<br />
Very confusing, but I think I have it. :)<br /> <br /> So in theory I could have 2 Digits for 99MPH then the 20 bars for a tachometer, or 4 digits for MPH and RPM.<br /> <br /> 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.<br /> <br /> Or some variation thereof, I think, perhaps, sort of, mabey...<br /> <br /> Regardless thoroughly intrigued and I will follow with great interest! :)<br />
See ? Now I'M confused, and I designed it ROFL.<br /> <em><br /> I could have 2 Digits for 99MPH then the 20 bars for a tachometer, or 4 digits for MPH and RPM.</em><br /> Yesssss.<br /> <br /> <em>I could have 8 digits and 40 bars? Or would I have to use 2 boards with 4 digits and 20 bars.</em><br /> <br /> Only on two boards.<br /> <br /> Looking at OBD&nbsp;functionality at the moment as well, as a shield board. <br /> <br />
Oh well, that would simplify programming greatly, 1 board for the speedo and one for the tacho!<br /> <br /> Now to get a grip on programming! How I long for a world of logic gates and PROMs! LOL!<br />
Here'e the latest board design. Hope you can see the idea.<br /> <br /> Steve<br />
I see what you mean now! Looks like a good board! Can't wait to see the final product!<br />
Final board is in my hands now. More news when I put the chips on. ...<br><br><br>Stece
I am now extremely excited! :) Can't wait to build this myself!
i cant get it to download, ive tried to save it, but it wont let me save it as anything other than .tmp
Save it and rename it.
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.
Hi, <br />Save the file as a .pde file and open in Arduino. <br /><br /> Steve
When are you adding the videos?&nbsp;:)<br />
When I&nbsp;reshoot with the other 10 leds on the bar.<br /> <br /> Steve<br />
Video is up now. <br />
Where? Are you shure? There is a blank space where the video should have been.
Hi Kabir,<br /> Yep, first step :-)<br /> If you can't see them, let me know and I'll send you the links. <br /> Steve<br />

About This Instructable


25 favorites


Bio: I'm an Engineer, who originally inherited the family business (Thanks Dad (RIP JC Taylor, 1938-2011)) after working in it for 25 years, designing and ... More »
More by steveastrouk: How to burn sawdust cleanly Building up a flight case Soldering stencils for DIY circuit boards.
Add instructable to: