Lm3915 counter up down by buttons

ebeowulf17

Joined Aug 12, 2014
3,307
Ok, here's my concept. I realized I can use about half as many resistors as I was originally thinking - it doesn't need separate pairs for each output, instead they can all stack up and feed through each other. This circuit would go between the 4028 that you've already successfully simulated and an LM3914, which is similar to the LM3915 in your first post, except that it's linear. You'll still have to check out the LM3914 data sheet in order to configure it with bar instead of dot mode and set the reference voltage to 5V.

In the image below, ignore the 9V voltage source - that was just there to make simulation easy since I didn't have a model for the 4028 and didn't bother simulating it in detail. I've assumed that it's outputs match its input voltage fairly closely (around 9V in this case.) The resistor values might all need adjusting if the outputs from the 4028 are significantly different than I assumed, or if the diode Vf is too far off from the 0.65V assumed in this simulation.

I don't claim this will work perfectly - it's just a proof of concept.
Counter_BarGraph.png Counter_BarGraph_data.png
 

Attachments

Thread Starter

ekremgusani

Joined Mar 20, 2011
157
Ok, here's my concept. I realized I can use about half as many resistors as I was originally thinking - it doesn't need separate pairs for each output, instead they can all stack up and feed through each other. This circuit would go between the 4028 that you've already successfully simulated and an LM3914, which is similar to the LM3915 in your first post, except that it's linear. You'll still have to check out the LM3914 data sheet in order to configure it with bar instead of dot mode and set the reference voltage to 5V.

In the image below, ignore the 9V voltage source - that was just there to make simulation easy since I didn't have a model for the 4028 and didn't bother simulating it in detail. I've assumed that it's outputs match its input voltage fairly closely (around 9V in this case.) The resistor values might all need adjusting if the outputs from the 4028 are significantly different than I assumed, or if the diode Vf is too far off from the 0.65V assumed in this simulation.

I don't claim this will work perfectly - it's just a proof of concept.
View attachment 134476 View attachment 134477
Thanks for your time I really appreciate it. Will try it today and will let you know! Thanks.
 

ebeowulf17

Joined Aug 12, 2014
3,307
Thanks for your time I really appreciate it. Will try it today and will let you know! Thanks.
No problem. Happy to help.

Looking at it with fresh eyes this morning, I realized there may be a better approach to the same basic concept. Yesterday I thought I was being clever by having everything run through the whole chain of resistors. Now I realize that, although in a simulation it's exactly the same result, in real life, that means the tolerance stackup on the accuracy of all those resistors could, in theory, be an issue. Here's a different version that would be far more forgiving:
Counter_BarGraph_B.png
The resistor values match the "Res. Sum" column from the table I uploaded earlier (or mostly match, after some sloppy rounding.)

For some strange, emotional reason, I just *like* the first way better, and they both work equally well as long as the resistor values are reasonably accurate, but when it comes to actually building something in the real world, this way is probably safer.
 

Attachments

Reloadron

Joined Jan 15, 2015
7,517
I like the above concept and have given this a little more thought. I mentioned D to A (Digital to Analog). You can build a simple D/A converter using a 741 or similar operational operational amplifier and the 741 is likely a 50 year old part but it will work. I would use your count up and count down buttons with a 74192 or 74193 simply because it gives you the Up and Down buttons. These counters output a 4 Bit binary signal D, C, B, and A. See page 95 of this link. 4-Bit D/A Converter and I would include the buffer shown below the 4 bit converter. The circuit will look like the below:
741 A to D.png

V1 through V4 simulate the D. C, B, and A outputs of a 74192 or 74193. The 74192 is the better choice. Use of the 74192 ca be found on page 74 of the link. The binary outputs of the 74192 drive the 741 D to A converter and the D/A converter can drive your LED chip. The link is loaded with useful circuits and information and while old stuff is good stuff.

Also the LM3914 is found on page 106. So think of the link as assorted building blocks.

Ron
 
Last edited:

ebeowulf17

Joined Aug 12, 2014
3,307
I like the above concept and have given this a little more thought. I mentioned D to A (Digital to Analog). You can build a simple D/A converter using a 741 or similar operational operational amplifier and the 741 is likely a 50 year old part but it will work. I would use your count up and count down buttons with a 74192 or 74193 simply because it gives you the Up and Down buttons. These counters output a 4 Bit binary signal D, C, B, and A. See page 95 of this link. 4-Bit D/A Converter and I would include the buffer shown below the 4 bit converter. The circuit will look like the below:
View attachment 134502

V1 through V4 simulate the D. C, B, and A outputs of a 74192 or 74193. The 74192 is the better choice. Use of the 74192 ca be found on page 74 of the link. The binary outputs of the 74192 drive the 741 D to A converter and the D/A converter can drive your LED chip. The link is loaded with useful circuits and information and while old stuff is good stuff.

Also the LM3914 is found on page 106. So think of the link as assorted building blocks.

Ron
Very cool! Something along these lines had been my next thought. I figured there should be a way to create analog voltages directly from the ABCD lines, but I hadn't wrapped my head around it yet. My initial brainstorming was way over-complicated, requiring a lot more op-amps. Thanks for sharing this circuit. I'll have to stare at it a while to understand it, but I like the idea.

EDIT: Would you mind sharing the .asc file for that so I can play with it a little? Thanks!
 

Reloadron

Joined Jan 15, 2015
7,517
Yeah sure. This is the classic looks good on paper. I did have a model for the 74193 but it wouldn't work right so I just went with the crude D to A using an op amp about 3 days older than dirt. The link is a collection of Forrest M. Mims circuits likely circa 1980 or so. I also think the LM741 is something I added to LtSpice IV years ago. In my drawing I only used a few steps for the D, C, B, and A binary inputs of 4 bits which should look like 0001, 0011, 0111 and 1111. Pretty rough but conveys the idea.

Ron
 

Attachments

ebeowulf17

Joined Aug 12, 2014
3,307
Yeah sure. This is the classic looks good on paper. I did have a model for the 74193 but it wouldn't work right so I just went with the crude D to A using an op amp about 3 days older than dirt. The link is a collection of Forrest M. Mims circuits likely circa 1980 or so. I also think the LM741 is something I added to LtSpice IV years ago. In my drawing I only used a few steps for the D, C, B, and A binary inputs of 4 bits which should look like 0001, 0011, 0111 and 1111. Pretty rough but conveys the idea.

Ron
Thanks!
 

Thread Starter

ekremgusani

Joined Mar 20, 2011
157
brisi3.jpg
No problem. Happy to help.

Looking at it with fresh eyes this morning, I realized there may be a better approach to the same basic concept. Yesterday I thought I was being clever by having everything run through the whole chain of resistors. Now I realize that, although in a simulation it's exactly the same result, in real life, that means the tolerance stackup on the accuracy of all those resistors could, in theory, be an issue. Here's a different version that would be far more forgiving:
View attachment 134497
The resistor values match the "Res. Sum" column from the table I uploaded earlier (or mostly match, after some sloppy rounding.)

For some strange, emotional reason, I just *like* the first way better, and they both work equally well as long as the resistor values are reasonably accurate, but when it comes to actually building something in the real world, this way is probably safer.
Why my bargraph doesn't move? What I am doing wrong? All the light are lit and doesn't move. Please see attached screenshoot.
 

ebeowulf17

Joined Aug 12, 2014
3,307
View attachment 134522
Why my bargraph doesn't move? What I am doing wrong? All the light are lit and doesn't move. Please see attached screenshoot.
Bottom of R14 should go to ground (or negative side of battery) instead of positive side of battery.

There may also be configuration errors on the 3914, but I'll have to look at the datasheet to be sure. Fix R14 first and see how far that gets you.
 

dl324

Joined Mar 30, 2015
16,923
I made one as you can see on above schematic I uploaded earlier but the leds countdown by itself as the capacitor dries and doesn't count up down by 1, it starts good but then at the number 4-5 start to count by 2-3 numbers at once and same when counting down. So my circuit is not good!
I still think cap leakage was a problem.

You can replace the RC with an integrator which will allow you to use a smaller, less leaky cap. I leave it up to you to figure out how to implement the up/down switches.
upload_2017-9-7_12-14-13.png
You need to use a rail-to-rail opamp.
 
Last edited:

Thread Starter

ekremgusani

Joined Mar 20, 2011
157
Here's a screenshot of the LM3914 diagram I mentioned earlier in case anyone can't or won't open a PDF.
View attachment 134529
I connected the R14 to ground and edited the lm3915 connections but now the when you start the circuit it start with number 5 led and when you click up switch count it counts 10 led up and stays like this till you count to number 1 again and it will lite 5 leds instead of 1. please see attached screenshoot.
brisi 1.jpg

brisi 2.jpg
 

Thread Starter

ekremgusani

Joined Mar 20, 2011
157
Here's a screenshot of the LM3914 diagram I mentioned earlier in case anyone can't or won't open a PDF.
View attachment 134529
Now is working perfect but if I continue to click up od down button it will loop. How I can stop it to loop? I want to stop to led 10 when I count up and if I continue to click Up switch I want led to stay at led number 10 and not to loop to number 1 led etc. Same, when I click the down switch I want led to stop at 1st led and not loop to led 10.
 

ebeowulf17

Joined Aug 12, 2014
3,307
I edited the sizes of the resistors that are going from diodes and now the counter working Perfectly!
Thank you very much for your help, I wouldn't managed to make this counter by myself.View attachment 134544
I'm surprised to see the resistor values had to jump that much. Makes me wonder what I got wrong - are the 4028 outputs higher than 9V, or were the voltage dividers not working the way I expected, or maybe I misinterpreted the 3914 reference adjustment system. Regardless, I'm glad you found values that work for you, and that the basic concept is working!
 

ebeowulf17

Joined Aug 12, 2014
3,307
There may be a simpler way, but my guess is that you need to use some logic gates (or maybe even some basic transistor logic) that disable the power to the down button when output 0 on the 4028 is active, and disable power to the up button when output 9 is active.

You could use NOT gates. Take a split from the 4028 output 0 and feed it into the input of a NOT gate (or both inputs of a NAND, or some similar arrangement) and then use the output of the NOT gate to feed power to the down switch. When the 4028 is at any value but output 0, the input to the NOT gate will be low, so its output will be high, powering the switch for normal operation. When the output 0 is active, the NOT gate will cut power to the switch, so pressing the switch will have no effect. Do the same thing with output 9 and up button.

You might need to add one more diode, on the output of the up switch in order to prevent a short circuit if both buttons are pressed when the 4028 output 9 is active. Not sure about that - I'm trying to picture this in my mind, but it gets a little fuzzy on this issue!
 

eetech00

Joined Jun 8, 2013
3,953
Hi

Try connecting 4028 output "9" to 4010 input "EN".
Replace the LM3914 with transistor drivers (or a ULN2003) to drive the LED bargraph.

4010->4028->ULN2003(2) or discrete BJT's->LED Bargraph.
 
Last edited:

ebeowulf17

Joined Aug 12, 2014
3,307
Try connecting 4028 output "9" to 4010 input "EN".
Won't that prevent any further input? In other words, you'd prevent any more up presses (good) but also prevent any more down presses (bad.)
Replace the LM3914 with transistor drivers (or a ULN2003) to drive the LED bargraph.

4010->4028->ULN2003(2) or discrete BJT's->LED Bargraph.
Won't that get us right back to only having one LED lit at a time? A key requirement of this project is to have all LEDs up to a certain level on, not just the top LED. In other words, it should look like an audio meter in bar mode, not in dot mode.
 
Top