help! four 7 segment unusual crisis

Hello there, i know your thinking about me why asking about 7 segments since there are many tutorials out there but this one is not so ordinary 7 segment programming problem.

First, i will tell you the setup of the circuit i’m about to create.

it’s a circuit where you have a sensor (any type of sensor) and is divided by 10.33 programmatically so Cap value of the sensor is at 99 and will display the value of the sensor on 7 segments.

And here i have two pairs of “two-7 segments”:

  • first pair (first two-7 segments) are color GREEN for displaying sensor value if amount is = 0-49
  • second pair (second two-7 segments) are color RED for displaying sensor value if amount is = 50-99

The idea here how i manipulate the 2 pairs of ‘two7segments’ is that i only used (1) 74HC595 bit shifter (8-bit output) connected to (4) BCD-to-7 segment:

  • (2) BCD are for Green display = 2-two 7segment (0-49)
  • (2) BCD are for Red display = 2-two 7segment (50-99)

Now, what i wanted to do is this:

what i want is simply used the GREEN display… so my sensor value will be fixed at 0-49.

first 4-bit output of 74HC595 is connected to the 4-inputs of the (2) BCD for green two-7segments. Each two BCD’s ‘BE’ (pin4) are connected to each other … and is connected to a single pin of arduino,

~so let’s say i declared pin = 4 of arduino connected to the two BCD’s ‘BE’ (pin4) as HIGH, these two BCD’s are activated and will light up properly the two-7 segments connected to them.

‘BTW the supply to the two-7segments are COMMON, 5v/gnd, thus two-7segment shares same supply’

since 4-bit output of 74HC595 is connected to the 4-inputs of (2) BCD [the two BCD’s 4 inputs shares the same 4-bit output from the 74HC595 also meaning if the 1st BCD receives = 0010, then the 2nd BCD receives = 0010 also],

~ that means setting up 4-bit output data for displaying number (2) = [D,C,B,A] : [0,0,1,0] to the (2) BCD’s (since both are connected) then it will display “22” on the green display (two-7segments); but what if i wanted to display “27” but (2) BCD’s are connected to each other as well as having common supply, is it possible for me to display it.

naturally, to display 2-distinct number such as ‘27’ in two-7segment display the following code will do ASSUMING the two-7segments DON’T have common supply (5v/gnd) and DON’T HAVE common inputs from 74HC595 (first 4-bit outputs):

for( int timer = 0; timer < 100; timer++) { //total amount of 1 second after finishing the for loop

digitalWrite(first_Segment, HIGH);
// pin 1 of arduino, connected to common cathode/anode of the first 7 segment as supply
// first BCD is connected to this first 7segment

digitalWrite(second_Segment, LOW);
// pin 2 of arduino, connected to common cathode/anode of the second 7 segment as supply
// second BCD is connected to this second 7segment

// display’‘2’’ [0,0,1,0] to (1) BCD from 74HC595 4-bit output only is used
// the remaining 4-bit output are for the other BCD’s of RED display

digitalWrite(2,0);
digitalWrite(3,1);
digitalWrite(4,0);
digitalWrite(5,0);
delay(10);

digitalWrite(first_Segment, LOW);
digitalWrite(second_Segment, HIGH);

// display’‘7’’ [0,1,1,1] to (1) BCDs from 74HC595 4-bit output only is used
// the remaining 4-bit output are for the other BCD’s of RED display

digitalWrite(2,1);
digitalWrite(3,1);
digitalWrite(4,1);
digitalWrite(5,0);
delay(10);
}

these code will display ‘27’ DEFINITELY because the logic behind displaying two-7segments that are multiplexed is that you must manipulate separately the common anode/cathode(supply) pin of the 7segment coding them HIGH and LOW alternately … AND if (2) BCD’s are NOT connected to the same 4-bit output of the 74HC595. This is same process as shiftout but it takes alot of coding.

So how can i display ‘27’ in two-7segments where these segments have their own BCD’s but their inputs are connectedly the same to the 4-bit output of 74HC595 and shares a common supply of 5v/gnd?

Thank you, it’s been hard for me since this is the first time i encountered this, i can’t revise the circuit for me to program it the way i know it should be because it’s not mine.

edit: Layout of the circuit is on the attachment :slight_smile:

noise_meter_doc2.doc (43.5 KB)

Sounds like you need steering diodes but without a schematic its hard to say, can you supply a drawing showing how everything is connected?

Here is the schematic

Edit:
a more clear schematic of the circuit is on the .doc attachment

noise_meter_doc2.doc (43.5 KB)

Hi, What BCD to 7seg IC are you using?

Tom.... :) PS Download ExpressPCB, its free and a good schematic editor.

TomGeorge: Hi, What BCD to 7seg IC are you using?

Tom.... :) PS Download ExpressPCB, its free and a good schematic editor.

:D it's a CB4511B series of BCD-to-7 segment Decoder, the segment i used is actually an anode type so i had to use a darlington array which is an buffer inverter since CB4511B BCD outputs cathode.

my concern is that these segments are supplied by one voltage source which is originally a 12v but i put it on 5v since it will be just the same, that means i can't manipulate the voltage source of the segments programmatically since segments dont have their voltage source connected to digital pins of arduino.

klubfingers: Sounds like you need steering diodes but without a schematic its hard to say, can you supply a drawing showing how everything is connected?

i uploaded a clear schematic of the circuit in my attachments which is in .doc file, all connections there are cleared to be connected. I used an array inverter for the outputs of the BCD-to-7 segment IC because my segments are anode type connected by a same power source which cannot be manipulated through programming.

Ditch this entire circuit. You don't need the BCD decoders or the inverters. You only need 2 HC595's and 4 transistors, all the rest can easily be done in software.

aarg: Ditch this entire circuit. You don't need the BCD decoders or the inverters. You only need 2 HC595's and 4 transistors, all the rest can easily be done in software.

that will be my answer also but i can't i have to stick with the circuit because it's not mine and it's already fabricated, i can't redesigned it. If the circuit was mine i had already changed few of these already. That's why im having a hard problem now T_T

Your schematics are incomplete. They are more like wiring diagrams, listing pin numbers rather than pin functions. So I'm not too interested in digging through it. It's probably also making it harder for you.

But, since you already have a good head start on this, consider this. Can you time multiplex the outputs so that at any given time, one desired output is illuminated, and the other is not? If yes, then that is the easy path to success. Rather than mucking around with what is already a mess.

Thanks for the reply Sir aarg :) i already got how to code it, thanks. This thread can now be closed. Thanks for those who viewed and replied.