Go Down

Topic: Need help powering a 7.5V 7 Segment LED with Arduino Mega (Read 5286 times) previous topic - next topic

officialxian

Hello, Arduino Forum!

I'm a bit new to Arduino, so hang in there with me, please.

Backstory (not required reading): I am working on a project for a FIRST Robotics club I mentor. The club has a sign, "This team has gone xx days without an accident!" But they only drew enough numbers to go up to 7. So every 7 days the count is reset.

What I'm Trying To Do: I'm trying to make two 7-Segment LEDs display numbers counting up with each press of a button.

My Problem: The LEDs require 7.5v and (clearly) the Arduino Mega only puts out 5V max. I did some research, and would like some advice regarding what I should do. Should I use an inductor to boost the power, or should I use transistors and an externam power source so power the LEDs? :~ Thank you in advance.

Reassurances: Yes, I did some searching and couldn't find a definitive solution to my problem.

Additional Information: If someone can give an explanation of the best answer in Layman's Terms, that'd be great. As I said, I'm new to Arduino and am not so familiar with the roles of everything and whatnot. Thanks!!!

-xian

johnwasser

First question is:  Is the 7-segment display Common Anode or Common Cathode.  Are the common terminals Positive (Anodes) or Negative (Cathodes).
Send Bitcoin tips to: 1G2qoGwMRXx8az71DVP1E81jShxtbSh5Hp

officialxian

From what I can tell, they are common anode. They're from some obscure Chinese vendor, bought off eBay (not by me). From what I can tell, they are  these http://www.yxztdz.com/EnProductShow.asp?ID=206.
And based on this (http://www.engineersgarage.com/contribution/anjali/seven-segment-testing) I think it's common anode. From what I've seen I have the SM4123-1.

officialxian

UPDATE

After doing a continuity test I found that pins 1 and 5 are common. Therefore I have the SM4123-1 7-Segment LED listed here (http://www.yxztdz.com/EnProductShow.asp?ID=206). So I'm pretty sure it's common anode.

CrossRoads

Need a 7.5V wallwart and TPIC6B595 to sink current from the cathodes.
http://www.dipmicro.com/store/DCA-07510
http://www.dipmicro.com/store/index.php?searchStr=tpic6b595&act=viewCat&Submit=Search
Designing & building electrical circuits for over 25 years.  Screw Shield for Mega/Due/Uno,  Bobuino with ATMega1284P, & other '328P & '1284P creations & offerings at  my website.

officialxian

Okay, what exactly does the TPIC6B595N do? Again, sorry I'm new to all this.

fungus


Backstory (not required reading): I am working on a project for a FIRST Robotics club I mentor. The club has a sign, "This team has gone xx days without an accident!" But they only drew enough numbers to go up to 7. So every 7 days the count is reset.


Why "reset" it?

You could get a pen and draw a '+' after the number 7 on the last one.


Okay, what exactly does the TPIC6B595N do? Again, sorry I'm new to all this.


Mentor of a robotics club who doesn't know how to use google...?


After doing a continuity test I found that pins 1 and 5 are common. so I'm pretty sure it's common anode.


Nope. There's four variants there, 1+5 common could also be common anode.

You need to get +5V and GND from your Arduino and find out which way the voltage goes between pin 1 and 7.

5V should be enough to light it up dimly.

No, I don't answer questions sent in private messages (but I do accept thank-you notes...)

fungus


Need a 7.5V wallwart and TPIC6B595 to sink current from the cathodes.


He'll need more than 7.5 volts - each segment will need a current limiting resistor as well.

No, I don't answer questions sent in private messages (but I do accept thank-you notes...)

officialxian


Why "reset" it?

You could get a pen and draw a '+' after the number 7 on the last one.


Yes, we could do that, but that would take the fun out of making a digital counter ourselves. Same idea as one of the other mentors wants to add a digital lock to the door, so we can scan RFID cards to get into the room, he ordered a scanner/keypad from eBay, but turns out the thing is all self-contained. Not what we wanted because we want to be able to interface with an Arduino and make this our own thing.


Mentor of a robotics club who doesn't know how to use google...?


Okay, touche, you got me there. Gimme some slack though, I had literally just woken up. I'll do some Google-ing now. BTW, I'm only a 'mentor' because I'm not in school. LOL I'm there to learn as much as the kids are (it's a high school club).


Nope. There's four variants there, 1+5 common could also be common anode.

You need to get +5V and GND from your Arduino and find out which way the voltage goes between pin 1 and 7.

5V should be enough to light it up dimly.


I did some testing with the Radioshack Electronics Learning lab I have, and confirmed that is is common anode. Therefore it's the SM4123-1, right? I know it's either SM4123-1 or SM4123-2, because it says "SM4123" on it. So now to set it up with my arduino to see how bright they are when using the Arduino power source. My first problem was that I didn't know it was common anode, and so I had it set up wrong.

CrossRoads

TPIC6B595 is an open-drain output shift register.
So it's basically a 74HC595 with outputs that can handle 50V and 150mA.
74HC595 (and Arduino) can only handle 5V outputs.
Your display has a lot of LEDs in series to make each segment, so a 9V source and 75 ohm current limit resistor might be a good match to achieve 20mA current flow:
(9V - 7.5)/75ohm = 20mA
Another option would be adding ULN2803 as output buffer to 74HC595.
Designing & building electrical circuits for over 25 years.  Screw Shield for Mega/Due/Uno,  Bobuino with ATMega1284P, & other '328P & '1284P creations & offerings at  my website.

johnwasser


Another option would be adding ULN2803 as output buffer to 74HC595.


Since they are using an Arduino Mega and only need to drive 14 segments they can probably just use one output pin per segment rather than using a shift register.  That could be done with two ULN2803's or a bunch of small NPN transistors.
Send Bitcoin tips to: 1G2qoGwMRXx8az71DVP1E81jShxtbSh5Hp

officialxian



Another option would be adding ULN2803 as output buffer to 74HC595.


Since they are using an Arduino Mega and only need to drive 14 segments they can probably just use one output pin per segment rather than using a shift register.  That could be done with two ULN2803's or a bunch of small NPN transistors.


Okay, so I don't need the shift register?

Another question, that I'm seriously stumped on, is about buttons. I want to use two momentary switch buttons to trigger the adding of a day, or to reset the count to 0. Every example I see is using a special type of button that has an extra "digital I/O" pin, I think it was called. Is there a way to do this with just a regular 2-pin button (just a basic switch)? If so, please help or point me in the right direction. Thanks!!

wes000000

#12
Jun 01, 2014, 12:05 am Last Edit: Jun 01, 2014, 12:08 am by wes000000 Reason: 1
Why only two displays, why not at least 3 or maybe 4? Are you expecting to have any accident once per 99 days?

http://www.instructables.com/id/7-Segment-Display/

This is a tutorial giving the basics of driving 7 segment displays and using a shift register. You will need to use components appropriate for your expected voltage and current and not assume the ones in the tutorial will work.

http://www.instructables.com/id/How-to-use-a-push-button-switch-with-arduino/

Shows how to setup momentary switch. Not sure which buttons you were looking it...? Some momentary switches have 2 pins and they simple connect when you press the button. Others have 4 pins. And when you press the button either the diagonal pins connect or the pins next to each other connect when you press the button. This can easily be tested with a multimeter in continuity mode.
"I have not failed. I've just found 10,000 ways that won't work." - Thomas A. Edison

officialxian


Why only two displays, why not at least 3 or maybe 4? Are you expecting to have any accident once per 99 days?


Not necessarily once every 99 days, but right now we don't have the resources for 3 or 4, or more. Everyone agreed when we took a pole that 2 should probably be enough. Thanks for the links, I'll take a look in a minute.


Not sure which buttons you were looking it...?


I was looking here. Maybe I just misunderstood the example?

Thanks for the help, I'm going to check this stuff now and see if I can't figure it out without bothering you guys too much more.

-xian

wes000000

The schematic shown here: http://arduino.cc/en/Tutorial/Button is probably overly complicated for your needs. That is to say you can remove the external resistor which simplifies things and it easier if your're just starting out and don't have spare resistors laying around.

The Arduino has built in pull-up resistors. What that means is when you set the digital pin mode to input (http://arduino.cc/en/Tutorial/DigitalPins) you can also enable pull up resistors so that the pin idles at a HIGH state. When using button inputs you always have to define a pin idle state so that when you press the button the state can invert and in your code that inversion of state is how you know the button has been pressed.

What you want as your idle state can depend, but the Arduino doesn't have internal pull down resistors it has internal pull up resistors so that is what you need to use unless you want to add an external resistor.

I would recommend before doing anything with 7 segment displays or shift registers to simply setup a button and write some basic Arduino code to print to the serial monitor when you press that button. There a billion tutorials on YouTube and on the internet on how to setup a basic button input to the Arduino.

Once you have the button down you can start adding complexity and other components, but start small and work you're way up.

I say all of this because you asked about the button having a "digital i/o pin" but no button has a digital i/o pin. A button in it's basic form is a broken wire and when you press the button you are closing that wire and making a it a complete connection. That is useful because you can enable pull ups, then connect one side of the button to the pin on which you enabled pullups and then the other side to ground . This way in code you can read the pin you set pullups on and connected your button too and if it is HIGH (5V) you know the button is not pressed. If it is LOW (GND)  you know the button is pressed.
"I have not failed. I've just found 10,000 ways that won't work." - Thomas A. Edison

Go Up