BCD to dual 7 segment display

MrCarlos

Joined Jan 2, 2010
400
Hello philippe53

there are several alternatives to achieve converting, natural binary numbers to Binary Code Decimal (BCD) in x Digits.
these circuits are called: Binary to BCD decoders, with x Digits .

A is surely easier, the use of a microcontroller.

Another would be to use a RAM or ROM or EPROM, wherein the address would be the binary number. on the data bus, 8 BITs contain the numbers 0 to 15; or More

Another alternative would be to add 6 to each decade in binary:
0-9, nothing is done.
10-19, add +6
20-29, add +12
and so on.

Use 2 types of counters, binary ones, and other decimals. Both connected to the same pulse generator. the binary counter is programmed with the binary number. it is programmed to count down. when it reaches zero, decimal counters will have the number in BCD 8 BIT's.

there is another method named: Shift and Add -3 Algorithm.
very complex and requires several IC's.

Since you only want the 0 to 15(binary), it could do with an adder (74LS83), 2-input AND gates and 2-input OR gate. would follow the method of adding 6 to each decade.
 

Attachments

Thread Starter

philippe53

Joined May 4, 2014
17
I'm still scratching my head because I see the schematic you provided, but I don't see 15 switches. Between SW0 to SW8, is only one switch ever pressed at a given time or are multiple switches pressed simultaneously?
Of course, there are only 8 channels on this schematic, I posted this one because it's more much simple, and I built one like this (in reality, 8 channels for the loudspeakers, and an other print with 4 channels for the amplifiers). There is a 7 segments connected, and everything goes very well.
Only one button is used at a given time, you understand that only one amplifier or one loudspeaker pair can be selected together. But if you press simultaneously two buttons, only one give a high level on the ouput of the 4514, fortunately.
I understand the use of a MCU would be more easy, but as I said before, I've no experience with that. And for your last question, my project is to build several units, some for one amplifier to 15 loudspeakers pairs, some for 10 amplifiers to 10 loudspeakers pairs, some for 4 amplifiers to 6 loudspeakers pairs, and s.o. It's why I must find something easy to realize. As you can imagine, it's more convenient to read a big digit than one button illuminated, if they are numerous.
 

Thread Starter

philippe53

Joined May 4, 2014
17
A is surely easier, the use of a microcontroller.
Thanks for your advice, it seems I have to learn the MCU's.
But MCU's require to be programmed I suppose, and it's not an easy job for me.
I'm wondering if I could use a 3 digits voltmeter (0.1 v would give number one, 0.2 V number 2....). On ebay, such volmeters only cost 2 € (!), and are ready to use.
http://www.befr.ebay.be/itm/4006846...eName=STRK:MEWNX:IT&_trksid=p3984.m1439.l2649

If you like I can post several pictures of my prototype (6 + 4 channels) ?
 
Last edited:

MrChips

Joined Oct 2, 2009
30,813
Why is it so many people have offered you the best solution and you continue to ignore it?

If you are intimidated by having to learn to program a microcontroller but still want to do things on your own, people here on AAC will show you how to get started, step you through and hold your hand along the way.

This is an excellent beginner's project on getting into the amazing world of microcontrollers.
 

elec_mech

Joined Nov 12, 2008
1,500
I'm wondering if I could use a 3 digits voltmeter (0.1 v would give number one, 0.2 V number 2....).
Yes and no. Yes, you could do something like you describe and have the volt meter display a number, the problem is the volt meter doesn't have a latch or a way to save the number, so as soon as you release a button, the value will go to zero.

However, you've spurred a thought. Instead of multiplexing, you could use an MCU with a digital to analog (DAC) output. Then you use a volt meter like you suggest to serve as your display. The MCU will keep the voltage to the volt meter constant, so the display stays the same until another button is pressed. This keeps the code simple (vs. multiplexing) and the IC small. The trick would be to get the MCU to output the correct value to the volt meter so it correlates with the button number.

An 8-pin PICAXE 08M2 might just do this. If the upper DAC range can be set to about 3.2V, then 3.2V/32 steps (PICAXE DAC range) = 0.1V. If you can live with the display showing 0.1 for 1, 0.2 for 2, etc., this could work.

But MCU's require to be programmed I suppose, and it's not an easy job for me.
We know programming for the first time can be intimidating and since this is not a homework assignment or a very complicated program (for me anyway), we're happy to program it for you. We can show you how to load the program onto the IC so you can then program IC's as you need them. You can later change the code if necessary.

So if we write the program and show you how to load it onto the MCU, will this meet your needs? The PICAXE only needs about $5 in parts to allow you to program the MCU using a breadboard. The PICAXE runs $3-6 USD depending on the size and the program is free.
 

crutschow

Joined Mar 14, 2008
34,452
..........................
However, you've spurred a thought. Instead of multiplexing, you could use an MCU with a digital to analog (DAC) output. Then you use a volt meter like you suggest to serve as your display. The MCU will keep the voltage to the volt meter constant, so the display stays the same until another button is pressed. This keeps the code simple (vs. multiplexing) and the IC small. The trick would be to get the MCU to output the correct value to the volt meter so it correlates with the button number.
..............
Using that idea, if you absolutely don't want to use an MCU, then you could use a DAC at the binary output of the 4514 latch and then go to a DVM. But you will need to scale the voltage to get a proper readout so the voltage corresponds to the speaker selected, which could be done with an op amp or perhaps just a voltage divider, depending upon the output of the DAC.
 

Thread Starter

philippe53

Joined May 4, 2014
17
We know programming for the first time can be intimidating and since this is not a homework assignment or a very complicated program (for me anyway), we're happy to program it for you. We can show you how to load the program onto the IC so you can then program IC's as you need them. You can later change the code if necessary.

So if we write the program and show you how to load it onto the MCU, will this meet your needs? The PICAXE only needs about $5 in parts to allow you to program the MCU using a breadboard. The PICAXE runs $3-6 USD depending on the size and the program is free.
That's very kind, but I do not want you spend too much time for me - however I don't know how much you'll need -
I'm just afraid of the apparent difficulty (using a MCU) for just displaying six numbers on a display, I though it would be easier.

However, there is a simple way (but not too much catholic) to display the numbers after nine. For the 10, I could use the 0 output to make the zero one's number and for the 1 ten's number just solder 2 diodes from the 10 output to the segments F&E. I could do the same for the 11 (4 diodes, from output 11 to the 2 FE), the 12 (2 diodes for the 1 and 5 for the 2, coming from the ouput 12) and s.o
It would need a total of 36 diodes to do the job, cost of some cents, but many parts to solder. Moreover, I'm wondering if dip diodes can be find to help.

Why is it so many people have offered you the best solution and you continue to ignore it?
Because I'm thinking it's too much to use a MCU for just displaying 6 numbers ! However I would like to see a shematic to have an idea ?

Yes and no. Yes, you could do something like you describe and have the volt meter display a number, the problem is the volt meter doesn't have a latch or a way to save the number, so as soon as you release a button, the value will go to zero.

Every time you push on one of the buttons, a positive pulse is sent to the STB input and as this input goes quickly in low state (because of the capacitor C1 witch does not let go DC), the change of the inputs state doesn't have any influence.
 
Last edited:

MrChips

Joined Oct 2, 2009
30,813
That's very kind, but I do not want you spend too much time for me - however I don't know how much you'll need -
I'm just afraid of the apparent difficulty (using a MCU) for just displaying six numbers on a display, I though it would be easier.
In the time spent just reading this thread the job would have been done and over with.

No diodes are required in the MCU solution.

Circuit diagram?

15 wires plus ground go to the MCU chip.

7 wires go to two 7-segments displays in parallel plus two wires to two displays.
 

Thread Starter

philippe53

Joined May 4, 2014
17
What's the reference of the MCU ?
Surely it would take you some minutes to do the job, but it would take me hours because I've never done it. Please give me a link to a diagram.
 

elec_mech

Joined Nov 12, 2008
1,500
I think there is some confusion.

I didn't "see" your volt meter solution - if you were to hook up to the output of the 4514, then yes, that could work, but you'll need a lot of resistors and time to work out the voltages so you can can see the number you want. Additionally, I doubt this will be an issue, but there is a chance the volt meter and whatever you are hooking the 4514 outputs to will fight for enough power from the 4514.

If you want to go with a non-MCU solution, crutschow makes a great recommendation.

I don't think you're understanding us fully. We will design a simple circuit using an MCU and write the program. We understand this sounds like a lot to you, but it is not to us. All you need to do is buy the needed parts, download the program into the MCU, and test. We can help you debug and modify the code if needed.

Want to see a schematic, no problem, but first we need you to post a COMPLETE schematic of what you have in mind. You originally stated 15-16 switch inputs and a dual (two digit) display. Now you're saying six digits. Do you mean three individual circuits with two digits each for your total project or have we missed something and you need to display 000000 to 999999? Or something else entirely?

Please, please, please do not post a schematic that only shows part of what you want now. We need to "see" what you have in mind in its entirety if we are to be of any real help. We'll also need know how big you want your digits. Are we talking somewhere in the 0.28" to 0.8" digit height or bigger? Once we have that, I can put together a schematic showing an MCU solution. From there you can decide if you want to explore an MCU solution further or not.

We are not telling you to use an MCU and wishing you luck on picking an MCU, drawing a schematic, and writing code on your own. We got this. :D
 

Thread Starter

philippe53

Joined May 4, 2014
17
I can buy the components, make the printed board, but I can't program the MCU.
I built a prototype, I called it 6/4, because it can route one among six amplifiers to one pair among four speakers pairs, or conversely. So, there is a single digit that works from 1 to 6, and a second digit from 1 to 4.
This system is for my own usage, I can choose the amplifier and the loudspeaker I want to listen, and it's enough.
But for my hi-fi shop, I must have bigger dispachings, and I'm thinking at a 10/10 system for the principal room, in this case, I can display 1 to 10 on the first double display and also 1 to 10 on the second display. No need of MCU, I can drive the displays to light number 10 with only 2 signal diodes.
But I've also a bigger room with more loudspeakers, and I'll need a more bigger dispaching, for routing 15 to 20 loudspeakers pairs, driven by the same amplifier. I though 15 because it corresponds to the ouputs of the 4514 (in reality, there are 16 ouputs, and I can use all of them). I must drive a double display to show what pair is "on" at a given time. To do that, I can take the signal 1/ from the push buttons 2/ from the 4 input data lines of the 4514 3/ from the outputs of the 4514, where there is always an ouput on high level (only one at a given time).
Did you understand what I need ?
In future, perhaps a more bigger system, and I don't know if I can modifiy only the program to do what I will need, displaying for example, 1 to 25 or 30.
 

elec_mech

Joined Nov 12, 2008
1,500
Modifying the program to show 25-30 instead of 16 is certainly possible. The more we know about your possible future needs, the better we can design a solution to meet your needs now and in the future. The question is how will you input a 25-30 value. A 4-line BCD will only give you 16 values, so you'd have to add a bit (five input lines) to give you up to 32 values. Knowing this from the start will help us incorporate it now so you don't have to do much in the future.

I'm assuming the first half of your last post just talks about the past and has no bearing on what you need now. I'm not trying to sound harsh, I'm just trying to focus on what you need now. I assume this is it:

But I've also a bigger room with more loudspeakers, and I'll need a more bigger dispaching, for routing 15 to 20 loudspeakers pairs, driven by the same amplifier. I though 15 because it corresponds to the ouputs of the 4514 (in reality, there are 16 ouputs, and I can use all of them). I must drive a double display to show what pair is "on" at a given time. To do that, I can take the signal 1/ from the push buttons 2/ from the 4 input data lines of the 4514 3/ from the outputs of the 4514, where there is always an ouput on high level (only one at a given time).
So you need a two-digit display (00-99) to show which set of 20 pairs of speakers is selected, correct? And this could grow up to 30 (or more)?

Assuming you'll stick with the 4514 in your future set up (two 4514's for 30 speakers?) and continue to feed them with a BCD input, then you'll need 5 lines XXXX to represent 0-31 in BCD. This would be the simplest way to interface to the MCU. Alternately, you could replace all the diodes with what is called an I/O port expander and connect that to the MCU. The MCU would then look at the port expander to see when a button was pressed then update the display. The MCU could then output a BCD signal to your 4514's or the 4514's could also be replaced with port expanders which could be programmed to work like the 4514's. Possibilities abound.
 

MrChips

Joined Oct 2, 2009
30,813
Now that you have identified the possible need for future expansion, I can offer another solution but still requiring a microcontroller.

Use an 8-bit parallel-in/serial-out shift register such as CD4021.
This gives you expansion capability. Each CD4021 will give you an additional 8 inputs. Meanwhile the MCU can display the selected channel from 00-99.

The number of I/O pins required of the MCU is now reduced to two 8-bit ports. Actually, you only need 10 output pins and one input pin.
 

MMcLaren

Joined Feb 14, 2010
861
With a microcontroller based solution, you might also consider using a rotary encoder + dual-digit display for input selection and another rotary encoder + dual-digit display for output selection. That could potentially be a single chip solution (plus four 8-bit relay driver ICs).
 

Thread Starter

philippe53

Joined May 4, 2014
17
How about a rotary selector switch instead of single push-buttons?
The rotary encoder is not very recommanded, because when you're doing a demo (comparison between the loudspeakers 3 and 15 for example), the 15 must be heard immediately after the 3, and conversely : "now, you're listenning to the 3, now the 15, now the 3, whom do you prefer ?"
For numerous amplifiers/loudspeakers, push buttons are not the best solution too : too much buttons kill the buttons :>). In this situation, a little 4x4 matrix keypad is welcome, and of course here we absolutely need a microcontroller solution.
I imagine too a IR remote to switch the sources but I think it would be much more work !
Don't forget to include a little delay : when the relay 2 closes, the relay 1 opens but the relay 2 must only close after the relay 1 is really open, to avoid any short circuit.
To resume, a 20 in/out dispaching can be easily done with discrete components. I think 20 push buttons on a front pannel is a maximum to stay easy to work with.
After 20, a microcontroller solution is needed, with a keypad to control it. And a remote control is an advantage (often, the dispaching stays behind the loudspeakers, because of the lenght of the wiring), and a digital display is more easy to read than illuminated buttons.
 

elec_mech

Joined Nov 12, 2008
1,500
I liked the rotary encoder suggestion. That made me think of a BCD thumbwheel switch, but as the OP mentioned the need for quick selection, this wouldn't work either.

Since you mentioned a keypad, you could hook up a 3x4 keypad (see below) to an MCU, enter in the desired speaker and press # to switch to that speaker. But wait, you want quick switching. Assuming this will be like the eye doctor's office ("which sounds better, A or B?") and you only need to compare two quickly at a given time, you could use the * button as a back button (like on a TV remote).

Say you demo speaker 3: press 3 then #. Then you demo speaker 15: press 1, then 5, then #. Now your customer wants to compare them, so you press * to switch back and forth quickly between 3 and 15.

You could then have the MCU programmed to do some fun things like listen to every speaker, one at a time for x seconds, by entering in, say, 99 (since you'll never have that many speakers connected to this one system).

Alternately, I don't think a remote option would be hard to implement. The PICAXE has routines to easily decode Sony IR codes, so that wouldn't be hard to add. Could still use a back function to allow quick changing for comparison between two speakers. Just have to make sure no one walks off with the remote.

Based on your previous comments I'm sure this more elaborate than you'd prefer, but I'll mention it anyway to give ideas to others who might pursue this - you could replace the 7-segments with an LCD that not only shows the speaker number, but the make and model of each speaker as well. This could be programmed in or you could add an SD card or USB flash drive reader to upload new info as you change speakers. If you were to go all out, you could use a negative backlight RGB LCD to add a coolness factor and change the color of the display on a whim or to correlate some aspect of your speakers in some way, e.g., red is basic, green is mid-range, blue is audiophile.
 

Attachments

MrChips

Joined Oct 2, 2009
30,813
Not having fully understood what philippe53 is trying to do and with more and more design requirements popping up I can see this is a moving target.

May I offer another solution:

A (m x n) matrix of soft buttons on a touch panel or computer screen. This totally simplifies the switch inputs and allows for infinite expansion. A simple serial interface to a relay board controls any combination of switching required.

With such an elegant solution you can tailor design your configuration, go into mass production and sell at a premium price with fantastic profit margin.

I'm off to the patent office, dated this day May 7th 2014, 1240 UTC.
 
Top