Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

Is there a relation between LED current and speed?

Status
Not open for further replies.
Hi Roman,

Minor problem with the new code. I have burned the no0.hex and it does suppress the zero, but when the clock gets to 10:xx it shows 0:xx.

Too well suppressed mate ;)

Al
 
Haha! Now how did that happen? Well I did do the change late at night and took all of about 2 minutes... ;)

I'll check the code and get back to you.

(edit) OK, it's fixed, i made the dumbest of bugs, and of course as i was in a hurry I didn't hardware test that change.
 
Last edited:
Hi Roman,

Thanks mate, I know you said it was a dumb mistake but I couldn't see it at all. I admit I don't understand C too well, too many weird brackets in my opinion, but I spent half the night looking at your code and couldn't find what was wrong!

I will check your new code against the bad one just so I can finally understand where the problem was. I need to understand really bad.

Anyway I am still insulating the rear of the display and have just about totally changed how it works in that respect, a lot more work but it does look and function better, just takes about 3 hours to do a single digit!

Again, thanks for all the help mate. I would have never got this project even half way without your help and that of others on the forum, ericgibbs to name but one. Looks like I will be needing a lot more cups and buns when all my mates on here turn up at my place.

Al

Edit, ok mate I see it now, missing 0, but it looked right to me! Doh!
 
Last edited:
Yeah I put
if(hours10 >= 10)
when it should have been
if(hours10 >= 1)
because of course hours is made up from two variables; hours10 and hours.

Glad to be of help. I haven't really put much work in as I already had a couple of multiplexed clock projects done, it was only a small amount of work to cut/paste and modify them to suit your hardware, and only took some minutes to test on the EasyPIC dev board.

It's good to get familiar with the C code, as you can see it's coded very simply and should be easy enough to understand. If you have any questions about the code just ask. That way you can download the free C compiler and add features and changes etc to your clock, which is much easier than rewiring and adding hardware. :)
 
Hi Roman,

Just a couple of questions.

1. What are the asm nop; lines for? Where does the asm come from? There are no lines of assembler anywhere.

2. If every instruction is 1uS, what happens if I add a line? Does this change the timing?

Thanks Al

PS I would have probably chosen C as my main language but the weird brackets use scared me off. I still don't get why they are sometimes so far apart.
 
Hi guys,

I still have a problem with leakage!

I have separated each digit from the others and then only 1 segment at a time lights. This is testing with jump wires , one to the common anodes and then touching each segments groung in turn, and every time JUST one gegments lights!

However when I join the segments together a-a b-b c-c etc then if I touch say the b segments ground to neg then although the b will light brightly one or sometimes two other segments will come on at a lower light level! Sometimes the segments are even on different digits!

This may have been my problem from the start? I wrongly assumed it was ghosting from the multiplexing but I must have had this all along.

I don't see how this is even possible with LEDs! How can the current get from one segment to another. My segments are wired EXACTLY as a 4 digit multiplexed display with a common anode and as I said earlier I have separated the digits and tested them and ALL worked exactly as expected, one segment at a time lighting when tried and NO other spurious ones lighting.

I am completely baffled as to how this is happening and at my wits end as how to stop it. I have even tried using a 4001 diode in line with the segments even though it seems silly since the segments are already diodes.

Has anyone experienced this sort of thing? I really need some ideas on what could be causing this or I will need to resort to remaking the clock and using a big PIC with enough outputs to drive each segment separately, which is no mean feat.

Thanks, Al
 
...
1. What are the asm nop; lines for? Where does the asm come from? There are no lines of assembler anywhere.
2. If every instruction is 1uS, what happens if I add a line? Does this change the timing?

PS I would have probably chosen C as my main language but the weird brackets use scared me off. I still don't get why they are sometimes so far apart.

Hi BigAl, ok 1. the "asm" word tells the compiler to force a assembly instruction into the code, the instruction NOP makes a 1uS delay. This is done to provide the 15uS deadtime between multiplexing, and also to give some uS of settling time to allow the 2 pins to read the buttons (as the 2 pins chnage from outputs to inputs).

2. Adding lines elsewhere won't matter. Adding lines in that first part where the nops are will just increase the deadtime. That probably won't matter as the deadtime is about 3% of multiplex time (15:512).

3. Don't let the weird brackets bug you, all they do is make the code into a "chunk" of any size so an if() statment then controls IF that chunk gets executed. The brackets can look scary if they are nested or poorly laid out, hopefully I avoided both those problems in the simple clock code. ;)

...
However when I join the segments together a-a b-b c-c etc then if I touch say the b segments ground to neg then although the b will light brightly one or sometimes two other segments will come on at a lower light level! Sometimes the segments are even on different digits!

Which segments? How are you "joining" 2 segments? At the outputs of the lower 2803 driver? And how are you driving the digit driver transistor? They need to be driven 1 transistor ON, and 3 transistors OFF if you are testing the display.

And which segments are lighting up? Can you provide an example like if you join A1,A2,A3,A4 (as normally connected in the clock) then turn Digit1 transistor ON and the other 3 OFF, then segments X, Y, Z etc light up?.
 
Hi guys,

Colin, the delay won't matter at the moment. I am not connecting the control circuit at all, simply touching wires to various connectors on the ribbon cable that feeds the LEDs. It is a 12 way (4 for digits and 8 for the segments) and the problem occurs still, with NO circuitry connected at all, so it is something in the display for sure.

Roman, as I said to Colin, the problem is not with the control circuit but definately with the LED setup itself. If I connect pos to digit 2 and then neg to segment c then you would expect just segment c only on digit 2 to light. But segment c will light correctly on digit 2 then c on digit 3 may light at about half brightness and c on digit 4 at about quarter brightness, also d on digit 2 will flicker dimly!

The weird thing is that ALL the digits were tested while not joined together and were perfect. They are joined on veroboard each segment being colour coded and all four of the same colour go onto the same strip. Then the digits common anodes are each on a separate strip, making 12 in all which go to a ribbon cable. Then like I said if I touch neg to a segment and pos to any given segment connection the problem begins!

I have actually run a saw blade down the gaps in the veroboard till the white of the board is showing, so none of them are contacting with their neighbouring tracks. I would have thought that it was interference if the controller was running and high frequencies were in play, but this is not the case.

I am at a complete loss as to what could be causing this. I even unsoldered the ribbon cable and tested it for shorts to no avail!

Suggestions please, but remember you can discount the circuitry altogether as I am just testing the bare display with single wires to keep any possible causes to a minimum.

Thanks guys, Al
 
hi Al,
What you are describing sounds like a leakage current thru the reversed biassed LED's into the 'C' LED's on the next digits, thats why it gets progressively weaker.

Do the following test, remove both the ULN2803' s, then power up the project as normal. [leave out the ULN's ]

Connect pin15 of the upper ULN socket [D1, pin 18] to 0V

Connect pin 18 of the lower ULN socket ['a' pin 18] to 0V. only the 'a' segment on D1 should light

You should repeat this for D2 , D3 and D4 and segments 'b to 'f, one at a time.

Lets know what you see.

E.
 
Last edited:
Hi Eric,

Just started doing what you said and there are too many segments on to write them all down.

Just with the wires connected to pin 18 on both ULNs there are 6 or 7 segments flickering and only the one that should be on at full brightness. Damn this is annoying! I really have stripped and restripped all the connections and joints and even though I know it HAS to be one of the digits or something on the display side but I honestly cannot find anything wrong. Have you ever heard of faulty LEDs that can back feed, because if they exist I will have got the buggers!

Al - baffledly
 
Hi Al,
Do you have a datasheet for the LED's that you could post, or type number.??

If you have a 'spare' LED's, connect a limiting resistor in series with it, say a 1K, apply +5V reversed to the LED and 1K, measure any reverse leakage current, try again at +12V
in reverse.

By removing the ULN's in the first test and connecting the LED cathode 'a' to 0V and switching on the D1 drive transistor by connecting the end of the base drive resistor, in 'theory' there is no reverse path thru the other LED's.

Its still possible you have a wiring error, but lets prove the performance of a few LED's in isolation with a test resistor first.

E.


EDIT:

Further checking suggests a wiring error on your LED layout.
 
Last edited:
This is a perfect example of how not to produce a project.
Firstly, you are using code from someone else. A big mistake. As you have found out.
Secondly, I wire up the hardware and test all segments before inserting the micro.
This way I don't get frustrated.
I produced a 12 digit display using a12 digit HP calculator display and the first thing I did was produce a slow-scan routine to check every segment.
Then the delay was reduced to produce 1,2,3,4,5,6,7,8,9,A,B,C.
You can see my website where I teach the reader to design in a logical way so a project is successful.
You cannot jump around like this and expect a circuit to work.
Pino's circuit is one of the worst on the web to start with and I have sent him an email but he refuses to make corrections.
Many of his other circuits are also faulty. He doesn't have a very good understanding of electronics.
 
Morning Eric,

Well mate I set up a spare string of LEDs and at 12v reversed I measure 10uA with my DMM set on uA.

These LEDs are the string type that are available on a roll with a sm 5050 LED every 35mm along. They have limit resistors built in and can be cut every 3rd LED. When run in the normal direction they draw 60mA at 12v.

I can't find the specs for them yet but will look through my info and find them and post later.

I have built a small board that allows me to test the LEDs with jumpers. So I can test any sinle or multiple segments at ease.

If you can suggest any tests for the actual display then I will gladly try them.

Thanks, Al
 
Hi Colin,

When I built the first clock on this design it did indeed have faults! Eric helped me and redesigned the circuit to work correctly and with the hardware I had available at the time. As to testing the LEDs, I did test each segment separately and found no problems at all, it was only when I physically connected all the segments together when the problems arose. I have since checked the wiring of the segments and cannot find a fault. I even cut ALL the wires to one segment and tried it on its own, then it worked as it should.

I am certain that the circuit is not at fault as when I plug in my original display, which is built in the same way and modular with the same connector then the circuit works fine and no problems with the display at all.

I am baffled as to the causes and am hoping that maybe Eric can come to some conclusion.

Al
 
hi Al,
Can you confirm that the controller PCB works OK with the original smaller display, or does the big display have a new controller PCB.??

The photo's you posted of the back of the PCB, shows a number of suspect track shorts.??

I would suggest that you run a file over the cut ends of the PCB to clear any possible swarf links in the copper tracks.

Also using the back of a utility knife scrap between all gaps between the copper tracks from end to end.

Its a pity its so HUGE, it will take more than a 1st class stamp to send it down to me .!!
 
To BigAl; what is the actual voltage of your main supply (that runs the LEDs)?

OK, let's break it down logically. Your display is wired in a very normal fashion. As you have disconnected all the electronics, what you have is a box full of multiplexed LEDs, and 7 resistors.

If you ground the resistor for segment C (as you said) and other digit C segments light up, (and this happens for any segment you test) the only possible cause would be that the LEDs have some reverse leakage current. This is because there is no positive to the anodes of the other 3 digits, so to get a positive there (to light their LEDs) that positive must be leaking back through some other segment(s).

Try as a first test reducing the display voltage to 5v. That will be less likely to leak back through the LEDs and may remove the symptom.

As a second test (and a fix!) you can add 7 diodes to each display, each diode in series with that one segment. 1N4148 will probably do, depending on your segment current. alshtough that needs 28 diodes yuo can test with just one digit first, so only needs 7 diodes to test it.

To Colin; I agree with you about the benefits of a well structured design process. But I disagree that BigAl's clock is a "bad circuit" as it is a very typical multiplexed clock using typical and proven drivers like 4 transistors and ULN2003 driver chips. The schematic is on post #20.

There is nothing at all wrong with his clock design (or the software!) and if there is an electrical fault it is possibly just that the 12v supply is a bit high for the particular LEDs used and is causing some reverse leakage current through them.
 
Hi Guys,

Eric, I have done all the suggested fixes even down to running a junior hacksaw blade along the track gaps, and yes I can confirm that the circuit works perfectly on the other display which is as you know just strings of 5 LEDs.

Roman, I cant drop the voltage to the LEDs to 5v, they are ready made strings of 3 superbright 5050 LEDs, the sort available on rolls of 5m and so on. I will however try the diode solution. I didn't know that any LEDs could leak current backwards unless overdriven to a large degree voltage wise? These are designed to work at 12v and don't have any way of me breaking into the chain to change anything. They just barely light at about 6.5 to 7v.

Anyway off to try the diodes, I have thousands of them so it won't be a problem if it works!

Thanks, Al
 
Hi Guys,

Right, after spending most of the evening soldering and unsoldering I have now got diodes on every segment!

Looks promising in the respect of leakage with only the sements lit that should be! Well almost! Seem to have got a couple mixed up somehow! Doh! Think I should have used better colours than these wires as I was getting colour blind towards the end. :)

But thats the least of hardships, I can soon sort the errant ones out and actually have a fully working display finally.

I will hopefully finish it tomorrow and will post a video of the working display as soon as I can.

Thanks to everyone for all the help. I really couldn't have done it without you.

Your humble student, Al
 
Last edited:
Excellent! :)

It's unusual for the LEDs to have reverse leakage like that, but obviously it does happen. Are there any other parts on those LED strips? Like caps? Do you have a photo of one of the LED strips?

Anyway it's always good to see a solution, and if you need suggestions with the code for adding features etc just ask. :)
 
Status
Not open for further replies.

Latest threads

New Articles From Microcontroller Tips

Back
Top