Author Topic: up down counter circuit help  (Read 499 times)

up down counter circuit help
« on: July 19, 2020, 02:12:56 pm »
I'm looking to build a scorer for 5-a-side football (and I might use it for table tennis at home). The idea is that it has a big "+" button for a goal being scored and a smaller "-" button in case someone accidentally presses it more than once. A slightly hidden "reset" button would also be useful but that's easily done as a simple "push to break" switch that would cut temporarily cut the power and achieve a reset to 00 that way.

It needs a two digit output (scores are anything up to mid 30s) and the digits need to be big, I'm thinking 7 segment displays like this with a character height of ~100mm:-

https://uk.rs-online.com/web/p/led-displays/7192522/

Ideally it would be powered by a 5V supply in the form of a USB power pack.

I'm happy to do my own soddering[1] but I lack the necessary clues in order to know how to adapt various circuits to different voltage requirements of the 7-segment displays. Not sure what the two different "Forward Voltages" are on the tech specs for that display.

There seem to be a plethora of up-down circuits from dedicated ICs to 74TTL series stuff. I'm lost in a twist world and need someone to make a decision for me.

If I can build one of these I can build a second one (with a different colour 7-segment display, one needs to be yellow for the bibs so the other one needs to be red ideally).

Once that is done the plan is to add a 6-digit 7-segment display (1" high characters, ideally blue) driven by a RTC clock module on a RPi so that there's an accurate clock on display. Then I'll tap the up/down buttons into the GPIO pins on the RPi to capture the button presses (with software de-bounce) to record that as a stream. Then it's adding webcams and a microphone, and then dealing with all of that for post-processing. More details here: https://yacf.co.uk/forum/index.php?topic=61234.msg2087703#msg2087703 as you can see I've been talking about this and not doing it for more than 4 years.

1. Although I'm sure my dad has an ample supply of proper Pb filled solder lying around in his shedde.
"Yes please" said Squirrel "biscuits are our favourite things."

Re: up down counter circuit help
« Reply #1 on: July 19, 2020, 04:57:00 pm »
Use a processor.

This seems like something that an Arduino etc would be good for. It will give far more flexibility than a dedicated counter circuit.

Those big LED displays have four red LEDs in series for each segment, so they take between 7.8 V and 10 V to operate, so running from a 5 V power bank would be a bit of a stretch, but not completely impossible.

You will need a driver IC, either from a counter or from an Arduino. With those displays you need a low side driver, or open drain or open collector circuit. If you run from a regulated 12 V, a resistor for each segment would provide adequate current control.


Quote from: Kim
Paging Diver300.  Diver300 to the GSM Trimphone, please...

quixoticgeek

  • Mostly Harmless
Re: up down counter circuit help
« Reply #2 on: July 19, 2020, 05:04:20 pm »

Does it have to be the 4" LED's? I have 2.3" boards I am working on. They have an 8 bit interface (3 bits address for the digits, 4 bits BCD for content, and an address latch enable.

They are meant as a clock, but you can use them as just a counter if you want. Connect to Arduino or Pi, or SBC of your choice. I'll be getting a batch of 10 PCB's made up (currently have prototype of the smaller version to perfect the circuit to test when final parts arrive). Could put some in the post... or send gerbers...

The boards would work with 4" LED's but you'd have to run wires rather than them mount to the board.

J
--
Beer, bikes, and backpacking
http://b.42q.eu/

Re: up down counter circuit help
« Reply #3 on: July 19, 2020, 05:53:27 pm »
This should give you most of what you need:

https://www.allaboutcircuits.com/textbook/experiments/chpt-7/led-sequencer/

It uses a 4017 IC decade counter and shows the circuit to drive LEDs as well.
It only shows the logic for incrementing and resetting the counter with a push of a switch but you should be able to adjust it to decrement as well.
I think you'll find it's a bit more complicated than that.

Re: up down counter circuit help
« Reply #4 on: July 19, 2020, 06:26:24 pm »
A "processor" for that!

My background is as an old fashioned analog/digital blank paper design injunmuneer.  I was lucky that the end of my design days came about just as everything went to processors/micro-controllers etc (early 1990's) and circuits were emulated instead of being hacked together to see if they worked.  The youngsters, brought up on stringing black box devices together, would come to me to ask how I might do something  - which was nice.  If you need something with a single fixed function ------- keep it simple.

Signing off- a miserable old git, living in the past with a hefty pair of rose tinted specs.

Kim

  • Timelord
Re: up down counter circuit help
« Reply #5 on: July 19, 2020, 07:59:13 pm »
If you want BIG and you're not allergic to software, consider molishing 7-segment digits in whatever size you like out of strings of addressable LEDs, and control them with an Arduino or PIC or similar.  Makes the electronics (if not the mechanical construction) trivial, as they take 5V power and you just have to write data to a serial bus.
Careful, Kim. Your sarcasm's showing...

Re: up down counter circuit help
« Reply #6 on: July 19, 2020, 08:06:43 pm »
this is a circuit for a slot racing lap counter, running at 12V. It would need to be adapted for 5V power and (probably simplified in places) at the input stage to accept up/down button press inputs instead of the hall effect inputs.



Probably this seems old hat to many but this would be the way I'd tackle this problem.

cheers

Kim

  • Timelord
Re: up down counter circuit help
« Reply #7 on: July 19, 2020, 08:17:18 pm »
this is a circuit for a slot racing lap counter, running at 12V. It would need to be adapted for 5V power and (probably simplified in places) at the input stage to accept up/down button press inputs instead of the hall effect inputs.



Probably this seems old hat to many but this would be the way I'd tackle this problem.

cheers

Would need a counter that could go down as well as up.

TBH, circuits like this are a good way to learn electronics (it's certainly how I started), but in the real world they're a complicated (read: many potential points of failure) and expensive alternative to microcontrollers.  YMMV.
Careful, Kim. Your sarcasm's showing...

Feanor

  • It's mostly downhill from here.
Re: up down counter circuit help
« Reply #8 on: July 19, 2020, 08:19:07 pm »
A "processor" for that!

My background is as an old fashioned analog/digital blank paper design injunmuneer.  I was lucky that the end of my design days came about just as everything went to processors/micro-controllers etc (early 1990's) and circuits were emulated instead of being hacked together to see if they worked.  The youngsters, brought up on stringing black box devices together, would come to me to ask how I might do something  - which was nice.  If you need something with a single fixed function ------- keep it simple.

Signing off- a miserable old git, living in the past with a hefty pair of rose tinted specs.

I'm with you on that.
Such a trivial logic function belongs in hardware.



Re: up down counter circuit help
« Reply #9 on: July 19, 2020, 08:30:03 pm »
A "processor" for that!

My background is as an old fashioned analog/digital blank paper design injunmuneer.  I was lucky that the end of my design days came about just as everything went to processors/micro-controllers etc (early 1990's) and circuits were emulated instead of being hacked together to see if they worked.  The youngsters, brought up on stringing black box devices together, would come to me to ask how I might do something  - which was nice.  If you need something with a single fixed function ------- keep it simple.

Signing off- a miserable old git, living in the past with a hefty pair of rose tinted specs.

I'm with you on that.
Such a trivial logic function belongs in hardware.

until you find out how many connections fewer that need soldering with a microcontroller, how little they cost and how difficult it is to change or correct hard wired circuits.
Quote from: Kim
Paging Diver300.  Diver300 to the GSM Trimphone, please...

Feanor

  • It's mostly downhill from here.
Re: up down counter circuit help
« Reply #10 on: July 19, 2020, 08:42:16 pm »
And that's one of the great things about doing electronic design: you can choose exactly how much you want to do in hardware, and how much in software.

And we will all have different opinions on where the line is.

Re: up down counter circuit help
« Reply #11 on: July 19, 2020, 10:29:08 pm »
this one more readily accepts up and down inputs so might be a better starting point?



cheers

Re: up down counter circuit help
« Reply #12 on: July 19, 2020, 10:32:59 pm »
And that's one of the great things about doing electronic design: you can choose exactly how much you want to do in hardware, and how much in software.

And we will all have different opinions on where the line is.

But surely logic ICs are just hardware. Really really tiny hardware but still just hardware. There is no software running on them just apply a voltage on some pins and you get a voltage on some other pins.
I think you'll find it's a bit more complicated than that.

Kim

  • Timelord
Re: up down counter circuit help
« Reply #13 on: July 19, 2020, 10:47:06 pm »
Zero is an acceptable value, for software at least.  You probably need at least some hardware :)
Careful, Kim. Your sarcasm's showing...

Re: up down counter circuit help
« Reply #14 on: July 19, 2020, 10:47:19 pm »
Let's not forget the specification for the op 100mm LEDs. F 7.5 to 10 Volts @ 20 mA whether microcontroller or standard display driver the hardware will require some custom molishing. A 5 volt power supply was also  in the original brief.

Re: up down counter circuit help
« Reply #15 on: July 19, 2020, 10:57:08 pm »
Exactly. 100mm 7-segment displays are an absolute must. And i'd rather not have a microcontroller for the up/down counter part. It's not necessary.

5V supply is almost a given too, mostly because the whole thing (with a RPi) will run off a USB power pack, but I can compromise on that if it's really unworkable. Having to stick 6 or 7 AA batteries in there for the display part is easily done if necessary.
"Yes please" said Squirrel "biscuits are our favourite things."

Re: up down counter circuit help
« Reply #16 on: July 19, 2020, 11:07:56 pm »
You don't need AA batteries there are ways of stepping 5 volt usb pack to say 12V. But swich mode constant current led drivers would be better for battery life. If you are leaving the display on all the time current draw will add up. I think you need a power budget at this stage of design.. You are using it outside? Readability of display in bright sunlight is another factor to consider. I have read your design brief link. Not sure  why you are adverse to microcontroller when you are  already using pi for video capture. With that hardware  python code to toggle pi gpio with  BCD expanders to give enough segment drives need 28 outputs for team yellow '88' and team red '88' hope my hacked together ideas are some help

Re: up down counter circuit help
« Reply #17 on: July 20, 2020, 12:06:13 am »
The USB power pack already contains a boost converter to give 5 V from the 3.5 - 4.2 V that the Li-Ion cells inside it put out, so adding a 5 V to 12 V converter isn't a problem.

Something like https://www.ebay.co.uk/itm/Mini-Voltage-Converter-Step-Up-Module-5V-8V-9V-12V-Power-Boost-Convert-Module-UK/193540864083 would do.

You need about 300 mA at 12 V for two digits of the LEDs. That will mean about 1 A at the battery, but that seems fine as 10,000 mAh power banks aren't expensive.

You need to control the LED current for each segment. The simplest way is to have a reasonably generous supply voltage, such as 12 V, and put a resistor in series with each segment. The specification says that the LED voltage will be typically 7.8 V, so that leaves 4.2 V across the resistor, so 210 Ohms is needed. That takes no account of tolerances, but would probably be fine. 65% of the power would go to the LED and 35% to the resistor. Brightness will vary if the 12 V supply varies, or the there is voltage drop in any cables, but there is a regulator in every step-up converter, and I don't think you are using long cables to take the LED current.

Another way to control the LED current is with a constant current driver for each segment. There are some ICs that do that for you, such as the AL1794AFE-13 which would interface logic or a microcontroller directly to 4 LED segments, but it is in a package with a pin spacing of 0.5 mm. LED drivers like that will give constant current to the segments, and need less voltage to work. That one only needs 0.5 V, so the supply voltage could be 9 V or so and it would work fine. That would reduce the current taken from the power bank as there is less voltage.

You could have a current-controlled boost circuit for each segment. That is the most efficient, but also the most complicated as it would need an inductor for each segment, and a driver IC, and all the ones that I have seen wouldn't work with a common anode LED display. However, that arrangement would mean that the boost regulator for 12 V wouldn't be needed.
Quote from: Kim
Paging Diver300.  Diver300 to the GSM Trimphone, please...

Kim

  • Timelord
Re: up down counter circuit help
« Reply #18 on: July 20, 2020, 12:14:43 am »
While we're here, it's worth noting that the readability of LED displays can be greatly improved if you put an appropriate colour filter directly on top of the display modules.  For example, a couple of sheets of #106 lighting gel for red LEDs, or some more rigid coloured plastic as part of an enclosure.  Light from the LEDs shines through almost unimpeded, but it prevents most of the ambient light reflecting off the module, so you see the displayed digit on a uniform background, rather than having to squint at an '8' with some segments lit up.
Careful, Kim. Your sarcasm's showing...

Re: up down counter circuit help
« Reply #19 on: July 20, 2020, 08:22:06 am »
Kim beat me to it...Greenback those modules are a diffuse source. I suggest you have a play with discreet LEDs 10 in series  per segment. I happen to have several hundred AE Class 2 LEDs agilent  HLMP-E033-SV000 they are painful to look at close up. 5.5cd 30 deg. viewing angle. You could experiment diffusing  with tissue paper behind the filter or Matt the filter. Regards LED PSU the voltage should be set to string drop @ desired current plus about 10%. Then select resistor to drop the 10%. That way you minimise power losses. If you use software to drive this then  add ons such as a segment chaser could be included when a goal is incremented. If you define your processor outline code and input/outputs and post here you are sure to get help with coding. Pm me if you want a smaple of LEDs.

quixoticgeek

  • Mostly Harmless
Re: up down counter circuit help
« Reply #20 on: July 20, 2020, 08:47:46 am »
this is a circuit for a slot racing lap counter, running at 12V. It would need to be adapted for 5V power and (probably simplified in places) at the input stage to accept up/down button press inputs instead of the hall effect inputs.



Probably this seems old hat to many but this would be the way I'd tackle this problem.

cheers

Funnily enough the circuit I mentioned above uses 4511 chips to do the BCD to 7 segment decoding. With a 74hc137 for address decoding of the digits...

J
--
Beer, bikes, and backpacking
http://b.42q.eu/

Re: up down counter circuit help
« Reply #21 on: July 20, 2020, 09:01:19 am »
Kim beat me to it...Greenback those modules are a diffuse source. I suggest you have a play with discreet LEDs 10 in series  per segment. I happen to have several hundred AE Class 2 LEDs agilent  HLMP-E033-SV000 they are painful to look at close up. Naturally a narrow viewing angle. You could experiment diffusing  with tissue paper behind the filter or Matt the filter. Regards LED PSU the voltage should be set to string drop @ desired current plus about 10%. Then select resistor to drop the 10%. That way you minimise power losses. If you use software to drive this then  add ons such as a segment chaser could be included when a goal is incremented. If you define your processor outline code and input/outputs and post here you are sure to get help with coding. Pm me if you want a smaple of LEDs.
You should be aware of the tolerances when using a resistor and such a small fraction of the voltage across the resistor. There's a calculator at https://www.mtrak.co.uk/led_calculator.html that includes tolerances. I put it there because I was so appalled by the terrible one that the search engines find.
Quote from: Kim
Paging Diver300.  Diver300 to the GSM Trimphone, please...