Digital counter using bar leds instead of 7 segments digits. - Page 1
Forum section: electronics / projects

author: DBoulanger
author_rank: Regular Contributor
timestamp: January 25, 2014, 07:14:55 pm
content: Hi everyone,While searching on the net for some "basic" counter, I found some schematics that were using Johnson counters, such as the CD4026, connected directly to 7 segments digits. The "chaining" of the CD4026 chips looks fairly straightforward and easy to apply to build a multi-digit counter.While digging in my electronic parts box, I found some led bar displays, which have 10 leds per bar. That lead me to question myself how could I use them instead of the 7 segments digits ?The first scenario I came up with was feeding some AND gates with the "abcdefg" segments output of the CD4026 to lit the appropriate led on the bar. It didn't take me much time to realize that this would not be sufficient since under some circumstances a digit may use the same segments as another digit and more to be represented, which would complicate the things. For instance, the number 3 uses the same segments as the number 1, therefore if I limit the logic to establish which segments are lit using only simple AND gates, I would end up with some sort of conflict.To alleviate that situation, I would need to add even more logic gates, most certainly other than the AND ones, which would end up being far too much to handle. At first glance, I would end up with a CD4026, 2 Quad 2-Input AND gates and some extra logic (like for the number 1 and 3 segments for instance), for each digit of the counter. With a 6-8 digits counter, that is a fair amount of chips and perhaps overdoing too !Even though I haven't thought much about it, an approach using some sort of voltage divider interfaced with a LM3914, could potentially be considered. Honestly, I haven't spent much time on that idea, so I'll need to dig a bit more to see how feasable that would be.I'm also considering the use of CD4017, but according to the info I gathered from different forums, the chaining isn't as "simple" as the CD4026. It seems to be some challenge to come up with something workable using that chip. On the other hand, since the outputs are already decoded, that makes it a fair candidate, involving much less logic than dealing with the CD4026 segments approach.So globally, I would like to build a counter which would use led bars instead of 7 segments digits. Ideally, I'd like to be able to select either a dot or a bar display, similar to what the LM3914 allows.I'll do some experiments on my end but meantime if you have any suggestions, ideas or comments, that would be greatly appreciated. This is a project idea I came up with just for fun and to gain some experience with something different.I'm all ears for other approaches as well, so don't be shy !Regards.

author: zapta
author_rank: Super Contributor
timestamp: January 25, 2014, 09:28:11 pm
content: Dave had video about using bar graph for USB uSupply display, don't know what came out of it. Motivation was low price.

author: linux-works
author_rank: Super Contributor
timestamp: January 25, 2014, 10:35:58 pm
content: arduino. simple, easy, one chip solution.I use them in my LCDuino audio vol control board (delta1 and delta2). that application is for a relay attenuator and I'm using the bargraph chips as a debug device even though I leave them perm mounted on the pcb.if you have several debug leds you want for your project, bargraph led chips are great. simple to drive. see the LCDuino website (www.amb.org) for schematic and arduino code if you want to see how we used them.

author: EEVblog
author_rank: Unknown
timestamp: January 25, 2014, 10:49:58 pm
content: Quote from: zapta on January 25, 2014, 09:28:11 pmIt was just an academic curiosity.

author: DBoulanger
author_rank: Regular Contributor
timestamp: January 26, 2014, 01:15:04 am
content: Hi,I don't have access to any member of the Duino's family for now.The may idea was to create something with what I had available.Led bars, CD4026, CD4017, LM3914, that I have, but no Duino's family member.Also, I'm not quite ready to jump in the Duino's world right now.Regards.

author: zapta
author_rank: Super Contributor
timestamp: January 26, 2014, 02:30:58 am
content: What is the problem with chaining CD4017? It seems to have a cary out output that you can feed to the clock input of the next digit.As is, it will give you dot display, not filled bars, but IMO it's nicer. With filled bars '19' will give you about X3 more light than '20' which is counter intuitive.Another option you have is to have BCD display, 4 LEDS per digit like this onehttp://www.thinkgeek.com/product/59e0/

author: dannyf
author_rank: Super Contributor
timestamp: January 26, 2014, 02:51:00 am
content: QuoteA mcu or pga would be fairly easy to implement but overkill as well.It can be implemented via logic gates as well. Take a binary input, D0..D3, representing 0..9. Easy value is represented by a unique combination of those digits.For example,Code:Value Combination0 nD0 * nD1 * nD2 * nD3 = NOT(D0) AND NOT(D1) AND NOT(D2) AND NOT(D3)1 D0 * nD1 * nD2 * nD3 = D0 AND NOT(D1) AND NOT(D2) AND NOT(D3)2 nD0 * D1 * nD2 * nD3 = NOT(D0) AND (D1) AND NOT(D2) AND NOT(D3)...You will find that through logic arithmetic, you can decompose them to a combination of those inputs or their logic operations and implement them via actual logic gates - FGA / PGA software essential does that.

author: linux-works
author_rank: Super Contributor
timestamp: January 26, 2014, 03:07:09 am
content: arduinos are cheap and there's a lot of free docs out there to help you get up to speed.this would be a good first experience for you.and a single chip solution is NOT overkill; in fact, its the elegant way of solving this problem.I'd be glad to help if you decide you want to break into the microcontroller thing. its really not that hard with all the good help out there and free toolchains.

author: dannyf
author_rank: Super Contributor
timestamp: January 26, 2014, 03:10:23 am
content: The above approach assumed (parallel) binary input. If your input is non-binary (decade or BCD), you just need to reconfigure the gates for your combinations.If your input is serial, you can use a counter of the right type for the conversion.

author: dannyf
author_rank: Super Contributor
timestamp: January 26, 2014, 03:41:07 am
content: QuoteA general approach would be to use the counters to drive a dac which then drives the lm3914 + led bars.Simpler of the two would be the binary counter + a r2r network.The decade counter can also work, except that the resistors are non-linear, which has the advantage of providing a wider range.If you have some logic gates (NAND for example), the decade counter provides a cleaner solution.If you have some parallel memory chips, it would be super-simple: the address lines are parallel inputs and the data lines are the decoded output - which is essentially what a mcu / fga is going to do, except faster.

author: DBoulanger
author_rank: Regular Contributor
timestamp: January 26, 2014, 04:41:36 am
content: Awesome !Putting and idea on the table and in no time, various ways to achieve it.Obviously, the ball is back in my camp and will have to decide which way to go.BTW, the "chaining" examples I saw on the net for the CD4017 where mainly to somehow "extend" the length of the led bar, having 20 or 30 units.My goal is to have one bar for the units, one for the tens, hundreds and so on. Unless I missunderstood what the fellows mentionned in other forums, Q0 and Q9 for the second CD4017 and on, are reserved for the carry and the reset gymnastic.I'm far from putting the other ideas away. The main idea is to make use of the extra chips I already have, in an Appolo XIII way. I want to see how far I can get with what I have. Obviously, if I conclude that my approach leads me to something "illogical", then yes, I will opt for a different approach. With all the ideas you gave me, I'm convinced that this can be done, one way or the other. I just have to take the path I'm confortable with.Thanks again guys for your inputs, that was a real treat !

author: DBoulanger
author_rank: Regular Contributor
timestamp: January 28, 2014, 01:37:37 am
content: Hi everyone,I'm actually giving it a try with the CD4017's on breadboard.I've been successful, I guess, at chaining the CD4017's the way I wanted. The countless hours I spent. On the internet didn't help much since all the chaining samples I saw where in fact to extend the count instead of creating "divide by 10" steps/levels. Anyhow, I think I got it now. Still have to figure out the "overall/master" reset, because the chaining approach I'm using is slightly different then the ones proposed on the internet. I will see when I get there.On the other hand, most circuits I saw are using a fair amount of discrete components to drive the leds. From a pair of resistors and a transistor, per led, to only one resistor for the hole set of leds, passing by transistor arrays, I have to admit I saw quite a few.I came up with and idea, which can also have been addressed by someone else, that I don't know, which drives all the leds related to a CD4017 with one transistor and 2 resistors. I have to admit, I'm still unsure of the values that should be there, but what I put in place does work.Despite it actually works, it doesn't mean it will last. So I'd like to know if what I thought of actually make sense and if there is/are, pros and cons.Here's a sketch of the block I'm considering to put in place. Let me know if this is something that can be done "safely" without damaging the CMOS, or if this is something I should avoid.

author: dannyf
author_rank: Super Contributor
timestamp: January 28, 2014, 01:47:46 am
content: QuoteIt all depends on what you mean by "does work": it certainly doesn't do what you wanted to do (producing an led bar). The circuit you have produces an led dot.And it makes no sense to pulse the transistor.

author: DBoulanger
author_rank: Regular Contributor
timestamp: January 28, 2014, 02:12:25 am
content: Sorry for the confusion Danny.The sketch I proposed was to determine if it was possible to cut on the discrete components count, by re-posionnioning them differently.Few moments after my post, I realize that connecting the transistor that way would imply that the collector current will have to go through the CMOS, which defeat the purpose. The overall idea was to come up with something the minimize the CMOS current to drive the leds via a transistor, but obviously I'll need to have a transistor per led if the led current is to exceed the CMOS output capability.So instead of separate discrete components, in this case resistors and a NPN transistor per led, I most likely will opt for transistor arrays as they're fairly cheap and don't take too much space.By the way, I chained 6 CD4017's on the board and everything rolls as expected. Still need to check how I will reset those things since the RST pins are all LOW to ground and pulling them HIGH wil obviously create a short. I guess this is where the gates will come into play.Again, don't worry about the sketch, this is not what I have on my board for the bars.

author: dannyf
author_rank: Super Contributor
timestamp: January 28, 2014, 02:22:13 am
content: QuoteI suspect that you can benefit greatly from reading the datasheet.