I’m trying to interface an Arduino to a 7 segment display with 6 digits all configured as common anode.
This means that positive 5 volts needs to be on the column and ground on the segment.
The board has built in resistors and works on 5 volts fine.
My current idea is to use a 74LS138 3 to 8 decoder from the Arduino for the columns.
It is inverting outputs meaning that it would need to be inverted before it would work.
So, could I just put a 74LS04 Hex Inverter on the output of the decoder and then attach some mosfet based circuit to give the 160mA or so required to power the 8 leds that might be on at once?
Then I could just sink the segments into GPIO pins to select which segments are on. LOW = ON (Max one led)
You will need a transistor for each of the digits because the 74LS138 cannot source enough current for seven segments or eight if you include a decimal point. Using a PNP transistor or P-channel MOSFET automatically inverts the logic.
You can sink the segments directly if only one digit is lit at a time.
If I remember our discussion and understand your circuit, the following should work - at least in theory
P channel fet high side switch.
Some theory:
A possible part (note Supertex is now part of Microchip):
Some important circuit notes:
For the 74138, use the 74HC138. This is the CMOS version of the part. CMOS output swings rail to rail whereas TTL has an offset. The inverted / active low output of the 74HC138 will be inverted by the P channel fet. A logic low (ie gnd) on the fet’s gate will turn on the fet on. A logic high (ie +5v) on the fet’s gate will turn the fet off. This assumes that everything is running off a single pwr rail of +5 volts.
Note that since you are using a microcontroller, you can implement the 74LS138 as a function in the arduino. And you would have flexibility to add hex and octal, etc.
The 138 let’s you get away with 3 external pins to control the 7-segment display. If one implements the 138 in the microcontroller, 8 external pins will be needed.
Good idea but I don’t think it will work. It looks like it expects common cathode displays and expects them not to have a resistor built in. Also, I would like to PWM in some manner individual segments and this seems to only dim the entire panel row.
Would this work instead of an inverting decoder? Looks like this is non-inverting but CMOS and only $0.51 for 1.
I just need to figure out the P-Channel and N-Channel MOSFet parts now for the in and out.
I thought about using this and it might be a good choice if you just want to display numbers.
I’m wanting to do effects as well and be able to dim each segment independently.
This will need to be done inside the Arduino in the code but each segment needs to be addressable.
'238 has active hi outputs ie noninverted
'138 has active lo outputs ie inverted.
HCT/ACT family is CMOS w/ TTL compatible inputs.
Generally good design practice says don’t mix TTL and CMOS parts.
Pick a family and use throughout the dsign.
Here’s a TI design guide. Includes a table on which families can drive what.
This may be of interest to those designing w/ different voltages in their system:: Voltage translation guide: