# LED Strip lights (2 Amps) Short Fade on / Fade Off effect

#### eTech

##### Well-Known Member
Thank you. I will look into using PWM.
What are the values of R2 and R1
R1=100 ohm, R2=500 ohm
I cannot get TIP121 (supplier has only 1 TIP120) but I see a comparable part is TIP122. The voltage is higher. I think that means the additional voltage in 122 will burn even hotter than the tip121
It will run hot with either transistor, but not because of the voltage rating your referring to.
Something about adrino that I could not figure out. When I wrote code I could create an installation program so the user could use what I created without the need to have the platform I designed it in. With adrino I assumed it worked the same way. I create a chain of events then burn them to a chip. That chip is removed from the adruino and placed in the circuit board. I can not find however any documentation to say it does work like this. It appears that you burn the data to the adrunio unit and run the program from the adrunio unit. I dont see how you "detach" what you created and apply it to your circuit without the adrunio being part of the project.
The coding structure is proprietary to Arduino, and is in a file called a "sketch". You write and debug the code contained in a "sketch" using (free) Arduino IDE software, then compile the code into "machine code" that the arduino understands. The compiled code is then uploaded into the Arduinos' memory. The Arduino is then rebooted and executes the code. This whole process is done using the Arduino IDE software while having an Arduino device connected via USB cable to your computer. Its very simple, but can get complex depending on the design.

Here is a link that describes more:

Everything You Need to Know about Arduino Code

Last edited:

#### ThomsCircuit

##### Active Member
the 111 is something like a military or aerospace quality version,
I'll remember to take my protein pills and put my helmet on. LOL

#### ThomsCircuit

##### Active Member
This whole process is done using the Arduino IDE software
So confirmed the adrunio unit becomes part of the circuit and cannot be "detached" so other circuits can be designed.
So if I purchase a $5 nano board, write code, compile the nano board stays with the circuit. If I wanted to create another project I'd purchase another nano board. Hypothetical: A friend says make my lights do A,B,C. I connect his LEDS to my adurino. Code, compile, run, reboot. He says thats great, thanks. Id need to give him my adrunio so he could take his lights home and enjoy what I made for him. #### ThomsCircuit ##### Active Member R2=500 ohm Ok thank you. I have not seen this symbol used for a adjustable resistor. In most projects I've done so far the wiper was connected to one of the other pins. Here it is not correct? #### Nigel Goodwin ##### Super Moderator Most Helpful Member So confirmed the adrunio unit becomes part of the circuit and cannot be "detached" so other circuits can be designed. So if I purchase a$5 nano board, write code, compile the nano board stays with the circuit. If I wanted to create another project I'd purchase another nano board.

Hypothetical:
A friend says make my lights do A,B,C. I connect his LEDS to my adurino. Code, compile, run, reboot. He says thats great, thanks. Id need to give him my adrunio so he could take his lights home and enjoy what I made for him.

Well Arduino's are cheap enough to do that - but there's no need to do so.

If you're doing it that way, the Arduino Mini is cheaper, smaller, and uses less power than the Nano - but requires an external USB/Serial module to program.

#### ThomsCircuit

##### Active Member
Now this is interesting. This is how I believed it should work. Create, test, compile, then export to an AVR chip and insert this in your circuit thus being able to reuse your adrino for future projects.

#### Attachments

• ATmega8_01_Pengo.jpg
275.6 KB · Views: 10

#### Nigel Goodwin

##### Super Moderator
Now this is interesting. This is how I believed it should work. Create, test, compile, then export to an AVR chip and insert this in your circuit thus being able to reuse your adrino for future projects.

Pretty well, although you would usually do all the development on the Arduino board, and only transfer it to an external chip once it's fully debugged.

Although you can certainly program a processor and transfer it to a target board for testing, which was how I used PIC's for years, until ICSP became commonplace. I used a parallel port programmer (and WinPicProg software to drive it), which had a ZIF socket fitted, making it easy to program the PIC's.

#### eTech

##### Well-Known Member
Hypothetical:
A friend says make my lights do A,B,C. I connect his LEDS to my adurino. Code, compile, run, reboot. He says thats great, thanks. Id need to give him my adrunio so he could take his lights home and enjoy what I made for him.
No...not necessarily. You could give him the code and he could buy his own Ardino board and lights. You or him could upload your code into it.

#### eTech

##### Well-Known Member
Pretty well, although you would usually do all the development on the Arduino board, and only transfer it to an external chip once it's fully debugged.

Although you can certainly program a processor and transfer it to a target board for testing, which was how I used PIC's for years, until ICSP became commonplace. I used a parallel port programmer (and WinPicProg software to drive it), which had a ZIF socket fitted, making it easy to program the PIC's.

Hi

Not disagreeing with you, but for the benefit of the OP, I think this may be an oversimplification. Whatever microcontroller chosen would also have to have circuitry to support it, so that would have to be considered. The Arduino board already has that built in.

#### Nigel Goodwin

##### Super Moderator
Hi

Not disagreeing with you, but for the benefit of the OP, I think this may be an oversimplification. Whatever microcontroller chosen would also have to have circuitry to support it, so that would have to be considered. The Arduino board already has that built in.

The required support circuitry is VERY minimal, and if you use a PIC is almost non-existent (as many PIC's have internal oscillators).

#### eTech

##### Well-Known Member
The required support circuitry is VERY minimal, and if you use a PIC is almost non-existent (as many PIC's have internal oscillators).
True, its minimal to you and I, but it isn't non-existent.

#### ThomsCircuit

##### Active Member
The PWM frequency is also set far too low, just so the change in duty cycle is visible in the simulation; C1 should be 0.1uF or lower to eliminate flicker.
The frequency being set too low would have what affect on the circuit?

I understand flicker. C1 0.1uF I've got them.

I can see by the blue line that the fade is 1 second. Thats just fine.

I will set Q1 to the same darlington as in eTechs design TIP122 as it was suggested that this NPN was suited for a PWM.

I'll connect the (+) of the LED strip to the emitter of TIP122

Confirming the switch is a positive (high) latch. Ill connect my circuits output (triggered relay) to SWITCH1 of this circuit.

Thank you so much for your time.
T.B.

#### rjenkinsgb

##### Well-Known Member
The frequency being set too low would have what affect on the circuit?
The light would visibly strobe on and off during the fade period.
If you want the fade a bit longer, just make C3 a bit bit bigger.

The switching would be more efficient with the load in the transistor collector, rather than emitter; there will be less output using emitter follower mode,

If the LED lamp must be grounded, you could swap the output device to PNP and reverse the +/- signal inputs to the comparator, so "off" is high.

#### ThomsCircuit

##### Active Member
If the LED lamp must be grounded, you could swap the output device to PNP
This is the led strip i use. They can vary from amps and wattage but im using about a third of this roll. apx 2amps. and yes there are positive and negative leads so it will be connected to ground. if thats what you meant by grounded.

In my original circuit the relay completes the ground. When I noticed your PWM circuit was triggered by a positive switch I adjusted my circuit so the relay completes the positive. If its possible to trigger your circuit with a negative latch that would better suit my circuit. Will using a PNP accomplish that? It doesnt appear that its that simple but i could be wrong.

#### ThomsCircuit

##### Active Member
The switching would be more efficient with the load in the transistor collector
Oh, I see that now. When i looked at it earlier i thought it was a diode. i see now its an LED.

#### rjenkinsgb

##### Well-Known Member
If you want it "on" when a switch to ground closes, swap the switch and R10, so the input to R3 is high for off and low for on.

Then either swap the + & - inputs to the comparator, or use a PNP output transistor (with load to ground).

#### Nigel Goodwin

##### Super Moderator
True, its minimal to you and I, but it isn't non-existent.

It's minimal to anybody, there's a crystal and two capacitors for an Arduino chip, and nothing at all for many PIC's - simply choose the correct battery voltage and you don't even need a regulator, and decoupling seems pretty optional with PIC's. The 'extra' parts are basically the driver for the LED's, which you need regardless of circuit type.

#### ThomsCircuit

##### Active Member
If you want it "on" when a switch to ground closes, swap the switch and R10, so the input to R3 is high for off and low for on.

Then either swap the + & - inputs to the comparator, or use a PNP output transistor (with load to ground).
I'll draw up a schematic and post it.

#### ThomsCircuit

##### Active Member
Ok I made the corrections you suggested. I normally do not get this right so if I did ill be surprised.
Update C1
PNP transistor TIP127
Relocated R10 and R3
I dont think Resistor to Emitter is needed.

#### ThomsCircuit

##### Active Member
UPDATE:
I mi-staked the trigger on the 555 for a ground. fixed.
Also forgot to reverse LM311 IN+ & IN-

Last edited:

Replies
10
Views
11K
Replies
8
Views
8K
Replies
59
Views
9K
Replies
5
Views
2K
Replies
21
Views
6K