Hi!
I'm a complete noob when it comes to electronics so this might be an easy question. I've searched the Web but probably with the wrong words because I did not find what I was looking for.
Anyway, I have an arduino UNO and a couple of two digit common cathode seven segment displays with ten pins. Two of these pins are common cathode and depending on which one is set to LOW it decides what display is active (right?). This means that these output pins from the display needs to be hooked to an I/O pin on the Arduino. Do I need some protection on this pin since all leds will be lead to this one? Will the I/O pin be able to handle all that input or will the board be damaged?
No.
You would normally put the common cathode to the collector of a transistor with the emitter to ground. Then the base to the Ardunio output through a resistor. Do this for each cathode.
Wire the anodes to the Arduino through a resistor to limit the current through the segment.
Watch out, there's a mistake on the schematic on that page.
Wiring up your circuit like that is a good learning experience, teaching you about transistors, resistors and multiplexing. But if you wanted to drive those displays as part of a real project, the advice would be to use a max7219 chip or something similar. This would simplify the circuit and relieve the Arduino of the burden of performing the multiplexing.
Thanks for the answers!
Seems like I will have to learn about transistors and how to use them. Are there different kinds and sizes? What do I need/want?
How large should the resistor on the base be?
PaulRB:
But if you wanted to drive those displays as part of a real project, the advice would be to use a max7219 chip or something similar.
So what is a max7219? Later, I'm planning on using a shift register (74hc595) to reduce the number of pins needed on the Arduino. Is that something similar?
Max7219 is kind-of similar, but much better, for driving leds than 74hc595.
There are many types of transistor. The type shown on the page Mike linked to are fine, bc337 also fine. They should be npn type bjt or n-channel fet. For base resistors, probably around 1K~5K for bjt.
The error i though I saw on the schematic was that it showed a ground symbol on the common cathode line of the right hand digit. My mistake, it's fine. Actually the ground symbol is connected to the emitters of all 4 transistors, which is correct.
MAX7219, shift register based IC that multiplexes data shifted in across up to 8 7-segments displays.
Only needs 3 control lines - SCK, MOSI, chip select
Send data to it using SPI.transfer() :
There are 5 registers to write to in setup - intensity (brightness), decode mode (your mapping, or the chip's mapping to create 012456789HELP- and blank), scan limit (how many displays), test mode (turns on all segments), and normal/shutdown mode. Then in loop you send to 1 of 8 registers at a time for each digit of the display.
Are there different kinds and sizes? What do I need/want?
Yes there are thousands of different types of transistors, the ones in the link are fine.
Using 1K as a base resistor should be fine for most Arduino circuits.
Thanks for the answers and info! Now I got some reading to do.
CrossRoads:
MAX7219, shift register based IC that multiplexes data shifted in across up to 8 7-segments displays.
Only needs 3 control lines - SCK, MOSI, chip select
Send data to it using SPI.transfer() :
There are 5 registers to write to in setup - intensity (brightness), decode mode (your mapping, or the chip's mapping to create 012456789HELP- and blank), scan limit (how many displays), test mode (turns on all segments), and normal/shutdown mode. Then in loop you send to 1 of 8 registers at a time for each digit of the display.
$3 at taydaelectronics.com
I did not understand much of that but the parts I did understand sounded good. If it simplifies the circuit and reduces the number of included components its well worth investigating.
Do you have any links tog guides "for dummies"?
But I got answer to my original question so maybe this thread is finished and I should start a new thread for any new questions.
PaulRB:
Why not do both? The transistor way and then the max7219. You will learn a lot. Either way, it is fine to continue on this thread.
What would be the benefit of doing both? Orange do you mean just as a learning excercise?
I looked up the max7219 and it seems neat. Some initial questions though: how large should the resistor be. It seems to depend on the leds, but how? Is it only the current/Voltaren of each that matter, or also the number of displays(leds)?
Exactly how/where should the capacitors be included in the circuit?
There should be a 0.1uF ceramic capacitor between the power and ground pins of every chip in a circuit.
The resistor used depends on the way you do things. With the MAX7219 there is only one resistor needed on the chip to control the current, see the data sheet for what values give what segment current. With the transistor way you need a resistor for each segment as shown in that link, the value in the link will work.
Grumpy_Mike:
There should be a 0.1uF ceramic capacitor between the power and ground pins of every chip in a circuit.
The resistor used depends on the way you do things. With the MAX7219 there is only one resistor needed on the chip to control the current, see the data sheet for what values give what segment current. With the transistor way you need a resistor for each segment as shown in that link, the value in the link will work.
Who is Orange!
What does it mean "capacitor between the power and ground pins of every chip in a circuit."? Where should it be? On the power pin from the Arduino? Isnt a capacitor blocking the current in the wire? Should it be in parallell to a wire? (So many questions. )
So the size of the resistor is only determined by each led in the circuit individually. The number of leds is not important?
What happens if the resistor is the wrong size? Can the Arduino be damaged or "only" the leds?
Im asking since I dont have any data sheet for my displays (bought them cheap on ebay) so I have to "guess" the values.
"Orange" was just an autocorrect error (I cant get my pad to understand that I want to write in English). It was supposed to be "or".
That means one wire of the capacitor on the 5V pin and the other wire of the capacitor on the ground pin. I simply do not understand what you don't get about that.
What happens if the resistor is the wrong size? Can the Arduino be damaged or "only" the leds
The range of resistors is wide, but if the resistor is too small then you can damage bothe the display and the Arduino. If the resistor is too high the display will be very dim or not visible.
Sorry if I'm a little slow but these things are new and unknown to me. Thank you for having patience.
I think I have to do some reading before I carry on with this project. I guess most questions have been answered and explained before.