# Help with LED control schematics

I am making a LED Light Stick with IR control to change the colour. This is the schematics I made. Is there any mistake ? Do i misunderstand anything ? If yes, please forgive me, I am a complete noob and here to learn. I am going to add a 5v regulator to the Attiny85 power supply. And 380ohm resistor from pin5,6,7 to the corresponding transistor’s base pins. I planned to use S8050 NPN transistor.

How i calculate the things:

1. The RGB LED Strips i using is rated at 15W/metre @ 5V . Power supply i am using is 6V which is 4xAAA battery .I apply P=IV and get 2.5A/metre of current. Then I calculate current used in 60cm of LED Strips (2.5/100*60) and I get 1.5A current per 60cm. I devided the value by 3 and get 0.5A for each Red, Green and Blue pin.

2. Next step, I found the S8050 DC current gain (hFE/Beta) which is 40 and apply the formula Ic/Ib = B (Ic = 0.5A , Ib = unknown, B=40). I get the Ib of 0.0125A. Which mean i need 0.0125A of current in order to Fully-On the transistor at Ic=0.5A @ 6V.

3.To find the resistor value from Attiny85’s Pin, I apply formula Ib = (Vb-Vbe)/Rb (Ib=0.0125, Vb=5 because the power supply of Attiny85 is 5v not 6v , Vbe=0.7V , Rb = Unknown) and i get value of Rb = 376ohm approximate to 380ohm.

Another issue is that i didn’t really know how to write the code. analogWrite seem didn’t work for ATtiny85 sincce there’s just 2 analog output for the controller. Or delayMicroseconds will work ? But i could’nt figure out how to write the code. I am very new to arduino. I know i should start at the basic first but i really need to get this project done. And please forgive my language. I didn’t know English very well.

Thanks a lot.

1) sounds ok 2) you actually want to saturate the transistor so look at the data sheet and see what is says about the saturation voltage. Their will be a gate current associated with this voltage, that is a good indication of the current need to supply to the base. 3) you can't supply 6V to the ATtiny chip, it will exceed the maximum voltage. You are better using just three AA batteries, everything will run off that voltage fine. You will not get much time out of AA batteries at that sort of current though.

For the IR detector you need a seriese resistor in the supply and a large capacitor to ground. See what it says in the data sheet.

A word of caution, I don't think the IR remote library works on that processor because it lacks the hardware timers, not 100% on this so check.

Mike is correct, ir lib does not work on tiny 85. There was another thread with the same question recently. The OP of that thread was recommended to switch to an Arduino pro mini.

If you want to stick with the tiny and forget the ir, you can use DrAzzy's tiny core which supports 3 x pwm outputs with the '85.

Are you certain you understand the spec of your rgb strip? Most are 12V not 5V. The ones that are 5V are usually the "neopixel" type (ws2812b etc) and those do not require transistors or pwm outputs.

For power, I would try using two 3xAA holders wired in parallel to increase the capacity. Avoid regulators if you can, they waste battery power.

Thanks a lot for the information.

1.Yes, the LED strips i using is rated at 5V. I choosed 5v because i need a smaller battery size in order to fit in the Light stick's handle. I will consider buying 2 150mAh Lipo battery and solder them in series then use a voltage regulator. LiPo is better.

1. I found some Instructables showing how to run IR Library in tiny85.

here is the link for it. I think I'll give it a try or change my controller board.

Like I said before, avoid regulators, they just waste power. You can get some pretty small dc-dc convertors, they are much more efficient. Some can step the voltage down, some can step it up.