# How to wire up an simple LED with ever changing voltage

Discussion in 'The Projects Forum' started by princess blacklung, Aug 13, 2009.

1. ### princess blacklung Thread Starter New Member

Aug 13, 2009
7
0
Hello all.
I have found these forums very useful for reference in the past, but this time I have a project that even my google skills couldn't solve. Just a quick note, I am the noobest of the noob when it comes to electroics, but I did try in earnest to educate myself before posting here.

My (simple) project:
I am wiring up a simple LED to a tattoo machine. If you have never seen a magnetic coil tattoo machine, it is of an extremely simple construction. There is a power supply, a switch, and the machine itself. When the switch is activated, current runs through the machine and it moves. The speed of the machine is controlled by adjusting the voltage on the power supply up or down. This is where my project gets derailed.

Normally when wiring an LED all you need to do is calculate your resistence and plug in the proper resistor to avoid smoking your LED and you're all set... but for this machine, the voltage is constantly being adjusted - in my case anywhere from as few as 8 volts to as many as 15 volts.

The LED I want to light up is a bright sucker - 5000mcd. (Vf:3.2-3.4, If:20mA) pretty standard though. This should light up my immediate work area brilliantly.

In this case, the required resistance would change every time the power supply was touched (which during a single tattoo session can be quite often) so maybe resistors aren't the way to go. I would be happy to post pictures or diagrams if it is useful in explaining what I'm trying to do.

Here is a link for what I am trying to make: sorry it's an ebay link but it will give you an idea
http://cgi.ebay.co.uk/NEW-Tattoo-ma...ItemQQimsxZ20090730?IMSfp=TL090730143001r4715

(PS - some guy here in my country is trying to sell these things for like \$60 even though they seem to cost only about \$2 in parts - that's why I'm so keen to make my own)

2. ### Gaspode42 Member

Aug 10, 2009
12
0
Hi

Just a random thought but is you take your variable supply and put it through a regulator (for example a 7805 will take 7.2 to 35 volts) you will the have a fixed voltage (say 5V) to drive your led. However the higher the voltage gets the warmer the regulator will be so you would need to put a heat-sink in it! At a fixed voltage you would then seed something like a 100Ω resistor (if my math is correct!). Anyway that just my idea for what it's worth

3. ### CDRIVE Senior Member

Jul 1, 2008
2,223
99
I doubt that he will need a heat sink to drive a single LED.

Jul 7, 2009
1,585
141
20 mA at 3.3 V is 66 mW, so the heat sink can probably be dispensed with. I think the voltage regulator is probably the way to go. Look at an LM317 data sheet for the recommended circuit.

Other options:

1. You might be able to find a used wall-wart at a second-hand store (or have one laying around). Couple with an appropriate resistor and you're done.
2. Two D batteries might be enough to give you the light you want. An alkaline D battery has nearly 2 A*hr capacity, so you'd get 100 hours of use from a set. Of course, you'd need to remember to turn a switch on and off.

5. ### ELECTRONERD Senior Member

May 26, 2009
1,146
16
Your power supply needs a load. Usually this is schematically depicted as a resistor. Once you give it a proper load, it will stop varying the voltage output. I have a power supply that did the same thing. When I measured the voltage with my meter it said that it should be a regulated 12V but it was constantly varying. So when I connected it to my radio I measured the voltage again and this time it was a regulated 12V. So I would take a look at the specifications of the power supply and if they say what voltage you have on the output just calculate the resistor value. Although, the LED might be a high enough load, which I suspect might be true. Then, you might have to use a variable resistor to determine what load is necessary until the voltage stops varying.

Aug 4, 2009
3
0
What you want is a current regulator as opposed to a voltage regulator. Just google current regulator for details.

7. ### jj_alukkas Distinguished Member

Jan 8, 2009
751
5
You need 20mA and 3.3V, right???

The easiest solution is to get LM78L05, 100mA, +5V regulator in a TO92 transistor case and use a 85-100 ohms resistor. YOu are done.

The biggest advantage of this over other options is that you need only 2 components and one is a resistor and the other is as small as a resistor with no heatsink required.

LM317 requires you to run it in constant current mode and is bigger and costlier.

8. ### jj_alukkas Distinguished Member

Jan 8, 2009
751
5
How do you expect to calculate a resistance even WITH a load but the voltage drop for the calculation varying??

9. ### rspuzio Active Member

Jan 19, 2009
77
0
A simple solution (only one more part in addition to the resistor) is to
use a field-effect transistor and resistor combination to limit the current
on how this goes, please refer to the textbook:

As for the transistor, most any JFET with a current
rating bigger than 20 mA and a voltage rating bigger than
15V (>25mA and > 25V to be on the safe side) should do.
The exact value of the resistor needed will depend on the

Last edited: Aug 14, 2009
10. ### ELECTRONERD Senior Member

May 26, 2009
1,146
16
All it needs is a adequate load. Once you apply this load, the voltage will stop fluctuating. I agree, a transistor should work fine. The transistor will help provide an adequate load while driving the LED.

11. ### CDRIVE Senior Member

Jul 1, 2008
2,223
99
It might be best to re-read his first post in this thread. The TS does not have a constant voltage supply, nor does he want one, except for the LED portion of his circuit. As said previously, the 7805 is all this guy needs.

12. ### ELECTRONERD Senior Member

May 26, 2009
1,146
16
Look,

I had a power supply that had the same problem. I fired up the power supply and took measurements with my meter and the voltage was bouncing all over the place. When I hooked it up to my radio and measured the voltage again it stopped fluctuating. What does that imply? That my power supply need an adequate load. I'm saying that he should put a variable resistor on there and see how much of a load is necessary until the load stops fluctuating.

13. ### Heavydoody Active Member

Jul 31, 2009
140
11
The voltage supply is varied intentionally at the device to adjust speed. Its not a matter of the voltage fluctuating due to a lack of loading. He (she?) wants to drive the LED off the same voltage fed to the device which the artist will be adjusting as needed during the session. Hope that clarifies the situation.

14. ### CDRIVE Senior Member

Jul 1, 2008
2,223
99
That's exactly why I suggested that he re-read the TS's first post.

15. ### princess blacklung Thread Starter New Member

Aug 13, 2009
7
0
Thanks to everyone for your responses!!

I found that the LM317 came up a lot when I was trying to figure out this problem which made me think it might be a viable solution.

So far jj_alukkas's solution seems to be the most convenient as I am going for a lightweight attachment.

I see that a seperate battery case was suggested, but my goal is to make something simple that attaches to the machine and feeds off it's power.

I'm off to the store to pick up spare parts today - I'll post how it goes.

16. ### princess blacklung Thread Starter New Member

Aug 13, 2009
7
0
PS - yes, it's she, not he.

Also re: the voltage 'fluctuation' yes, that's coming from the controls on my power supply, not a malfunction. (It's actually a brand new power supply, with a nice digital display - really slick - really smooth)

A pedantic side note about tattoo machines in case you care, the reason that the voltage has to run smooth because it will eventually translate directly into the speed of your machine. If the voltage fluctuates all over the place, you'll hear and feel it in your machine and you wouldn't be able to pull a smooth line in the skin.

17. ### Audioguru New Member

Dec 20, 2007
9,411
896
Years ago they made constant current diodes (with a FET inside). Are they made anymore?

18. ### rspuzio Active Member

Jan 19, 2009
77
0

It seems so --- for instance, see Central Semiconductor
and Linear Systems.

http://www.centralsemi.com/product/cld/index.aspx
http://www.linearsystems.com/products.html#GlossB

The Newark catalog has a few in SMD packages but,
unfortunately, they are a bit small for the application
here. The largest they have is 4.7 mA:

http://www.newark.com/jsp/search/productdetail.jsp?SKU=06J8375&CMP=AFC-GB100000001

4 or 5 in parallel would work, which isn't so bad but, unfortunately,
they are not stocked and would take a few months to come in.

Just out of curiosity, I had a look at a few retailers online and found
very little in the way of current regulator diodes. Therefore, a
practical alternative would be to roll one's own from FET's (and
perhaps resistors). For instance, the ubiquitous MPF102 has
$I_{DSS} = 10 mA$ so one could make a 10 mA
regulator by connecting the gate to the drain. Two such
units in parallel would provide the 20 mA need to run the LED
in question.

19. ### Heavydoody Active Member

Jul 31, 2009
140
11
These are described here, but I don't understand how they could be used by themselves to regulate voltage since their purpose is to regulate current to a set value. If a program resistor was chosen for a current of 20mA and 12VDC was applied you would still have 240mW being disipated by an LED rated for one fourth that. Please elucidate.

20. ### rspuzio Active Member

Jan 19, 2009
77
0
> I don't understand how they could be used by themselves to regulate >voltage since their purpose is to regulate current to a set value.

Regulating the current to a set value (in this case, 20 mA) is exactly what
we want to do here in order to have the LED work properly. The point is
that, since the current through a diode depends exponentially on the
voltage drop, the only reliable way of running a LED is via a current
source, such as a constant voltage source plus dropping resistor or a
current limiting diode or a regulator IC hooked up to regulate current.

> If a program resistor was chosen for a current of 20mA and 12VDC was
> applied you would still have 240mW being disipated by an LED rated
> for one fourth that.

No, if 20 mA are flowing through the diode, the voltage drop across the
diode will be 3.3 V, so the LED will dissipate 66mW, which is just fine.
240 mW is the dissipation across the whole circuit --- the remaining
174 mW will go into heating the dropping resistor.