Hey guys ive built my own seven segment display using 360 LED's. They are multiplexed from an atmega328 through mosfets, high side and low side switching. it works properly and all but what concerns me is that when i display some numbers, for example 3, the other two segments that would make up an 8 will light up but very dimly? what could be causing this?
A schematic of how you wired it is necessary to answer your question.
calvingloster:
Hey guys ive built my own seven segment display using 360 LED's. They are multiplexed from an atmega328 through mosfets, high side and low side switching. it works properly and all but what concerns me is that when i display some numbers, for example 3, the other two segments that would make up an 8 will light up but very dimly? what could be causing this?
The only thing we know about it is that it has 360 LEDs. That's not much to work with...
It would probably take me about 2hours to draw a schematic, the display is wired up as common anode. That is the positives of each segment of each digit are all joined together. Then I have 4 ground wires which I use to switch between each of the four digits
360 LED in 4 digits of 7 segment in common anode, so how many LED per segment? how these LED connected?
calvingloster:
It would probably take me about 2hours to draw a schematic, the display is wired up as common anode. That is the positives of each segment of each digit are all joined together. Then I have 4 ground wires which I use to switch between each of the four digits
You don't need to draw every single LED, just draw a few LEDs for one segment and say something like "X LEDs are hooked up to each segment".
A sample's fine, as long as we get the gist of what you're trying to do. It's much more accurate that just words.
A "schematic" is still our language... no matter how much time it takes.
You're probably getting 'ghosting'. I assume you are 'scanning' the common anode/cathode and pulling segments low/high.
You get ghosting when you change to a different digit before changing the segment pattern.
Just before changing digit turn off all segments, set next digit and then set the segment pattern. This way you avoid ghost segments.
Hope that helps.
360 leds? 5mm? / 1watt?
Mosfets for 360 5mm leds.... how many fets? (What a waste)
Are they really on, or just appearing to be lit by the brightness of the adjacent LEDs?
If you shade them from adjacent LEDs, does the problem go away?
You are talking about the display in this thread?
http://forum.arduino.cc/index.php?topic=204401.msg1504843#msg1504843
You could try a simple change at this function call, make sure all the cathodes are off, turn on the cathodes, and then turn on the anodes:
int disp(int segm, int number){
if (segm == grndA){
// turn off all digits
digitalWrite(grndA,LOW);
digitalWrite(grndB,LOW);
digitalWrite(grndC,LOW);
digitalWrite(grndD,LOW);
//move the anode writes here
:
:
// and then turn on the cathodes:
digitalWrite(grndA,HIGH);
digitalWrite(grndB,LOW);
digitalWrite(grndC,LOW);
digitalWrite(grndD,LOW);
}
Yes it is that exact display, and i did sheild the LED's from the other LED's and i still see them slightly lit up. Here is a simplified diagram of 2 three segment displays. i just drew 3 segment displays to make the drawing simpler
CrossRoads:
You are talking about the display in this thread?
Motocross lap timer - Exhibition / Gallery - Arduino ForumYou could try a simple change at this function call, make sure all the cathodes are off, turn on the cathodes, and then turn on the anodes:
int disp(int segm, int number){
if (segm == grndA){
// turn off all digits
digitalWrite(grndA,LOW);
digitalWrite(grndB,LOW);
digitalWrite(grndC,LOW);
digitalWrite(grndD,LOW);
//move the anode writes here
:
:
// and then turn on the cathodes:
digitalWrite(grndA,HIGH);
digitalWrite(grndB,LOW);
digitalWrite(grndC,LOW);
digitalWrite(grndD,LOW);
}
Im abit confused, in your text you say "make sure all the cathodes are off, turn on the cathodes, and then turn on the anodes" but the code you have supplied turns the cathodes off, then the anodes are turned on according to what number you want to display and then turn the cathodes on again?
Can you maybe explain to me why i need to do this? must the ground be switched on last or what? i dont understand this
I think i might have figured out what your code does that mine does not? please tell me if i am correct:
ok so my function switches the desired ground on and THEN the anodes according to which number i want to display. Then when the program switches to the next ground the previous anodes are still on for the few nano seconds before the new anode selections are made? So basically the LED's that are lit up dimly are lit up for a very brief moment like as in a few nano seconds or as long as program takes to set the new anode value's?
Yes, I may have gotten the + & - names swapped as I typed it up.
Turn off the cathodes, set the anode info, turn on the selected cathode.
What you described as a few nanoseconds is more like tens of microseconds with all the digitalWrites.
The code could be made much faster - using direct port manipulation - or by shifting the anode info into a shift register with SPI.transfer( ) - but as you have it working, try just changing the order of when the cathodes are turned off & on.
The other thing that might help is pullups on the cathode to 12V to ensure the LEDs are off as the cathode drive's open collector/open drain outputs are floating when deselected.
CrossRoads:
Yes, I may have gotten the + & - names swapped as I typed it up.
Turn off the cathodes, set the anode info, turn on the selected cathode.
What you described as a few nanoseconds is more like tens of microseconds with all the digitalWrites.
The code could be made much faster - using direct port manipulation - or by shifting the anode info into a shift register with SPI.transfer( ) - but as you have it working, try just changing the order of when the cathodes are turned off & on.
The other thing that might help is pullups on the cathode to 12V to ensure the LEDs are off as the cathode drive's open collector/open drain outputs are floating when deselected.
So is this known as "Ghosting"? thanx for the advice, one more question, if i use a 20mhz crystal will this theoretically make the ghosting dimmer as the program executes faster?
No, probably more viewable as the displays are switched on faster.
Only a guess tho.
Make the simple software change, see if it helps.
CrossRoads:
No, probably more viewable as the displays are switched on faster.
Only a guess tho.
Make the simple software change, see if it helps.
But if they are switched on faster they are also switched off faster so maybe? But kewl thanx I will change the software tomorrow and let you know how it went
But also switched on more often was my thinking.