My little sister is doing an art project in which she probably has to use arduino or something related, she is absolutely not tech-savvy so I will try to do it with her. I am very new to all of this, I heard from someone that arduino should be capable of doing this. If my question is posed in the wrong section or should not be asked at all, please (re)move it.
I'll describe the project as follows.
She has a box in which she places a phone.
If the phone receives a message/call/e-mail/etc. its screen will light up.
Whenever the screen lights up, she wants a few LED lights to turn on (outside the box and maybe a few meters away from the box). These LED lights should start at a low brightness level, then go to the highest brightness level and then back to being switched off. This change in brightness should happen smoothly and in a time span of about 1 minute.
I think this should be easily doable. It would need a light sensor or photocell, some LED lights and something programmable to which we can attach the light sensor and LED lights. I think I should be able to program using the arduino software, but I know nothing about the hardware. Can you give me some guidance on what components to chose or how to use them?
She has already bought an LED strip (see the figure below), which is 300 mA per meter LED strip (you can cut it every 5 cm). Can we use this in stead of the normal LED lights?
Is it possible to use 4 pairs of LDR and LED strip using only one arduino? This would mean that there are 4 phones in 4 separate boxes with 1 LED strip per box, but using one piece of software controlling the dimming of LED lights and reading LDR output.
The 'standard' arduino Uno has 6 analog inputs and 6 'analog' outputs. so yes you can connect 4 LDR's and 4 LED-strips.
The Ledstrip will need a bit of a boost because a standard arduino pin can not handle the 300mA of the ledstrip.
A pin can only handle ~40mA , so you either have to make the strip much shorter or add an extra transistor as a buffer.
The LED strip looks a lot like one I got from eBay. If they are similar, then it is an automotive product and runs off of 12V.
Astro showed you a clean and simple schematic using discrete components that are cheap and easily available and doesn't require a seperate power supply. I would suggest that you take his advice.
Just my two pence...
When the phone rings and the phone display lights up and the LEDs begin to brighten, what do you want to do if you answer the phone? Turn OFF the LEDs or continue the routine?
You can use a photodiode to detect screen, I have done one project using a photodiode to detect lights and it works very well (it can detect a 5W led bulb 3ft (1 meter) away). Unfortunately, I don't know the part number of the photodiode. I did try BPW21R with even better results (6 ft or 2 meters away), too, but it is expensive.
Of course, the LDR idea can work with the code.
here is the thread with software. Though it is about sound detection, the software should work with photodiode/LDR if you just replace the piezo sensor with whatever you use.
caller id support , different caller, different led on.
SMS gateway support, different led on base on number.
email gateway support, different led on base on email address.
Voice mail support, different led on base on how long the message is.
It is no long phone, it is call center.
p.s. U need first forward number to VOIP box, then u could turn phone off and throw it out the window. every thing should still work.
I'll answer your replies in order. Thank you all for your help.
@astrofrostbyte
Good idea to use a transistor. I don't understand the schematic you made, can someone explain the schematic to me? Sorry, I know very little of electronics.
The transistor is called Q1 2N2222?
I see that you put 4 LED lights in parallel, does this represent 1 LED strip or 4 LED strips? It seems logical to me that I put 1 LED strip on 1 output of the arduino. The LED strip already has resistors built into it, I think.
What are the 3 boxes on the left side? One is the output and one supplies the voltage? What does the GND box stand for and what does it do?
@MaJiG
The LED strip is indeed 12V. You cannot answer the phone as it is stored away in a box unreachable until a later time. Whenever the screen of the phone lights up the LED strip should be turned on and off smoothly as I described before. I do not know what her intention is when the screen turns on for a second (or third, etc.) time during the LED strip sequence, but that is of later concern I think. This has to do with the programmable side of the project.
@mjkzz
Thank you for the thread on the software, it will come in handy when I need to program it.
@sonnyyu
The phone in the box is always different and we do not want to setup things before they put it in the box. Think of an exposition where customers come to look at her project and they insert their own phone in the box. This could be any random person on the exposition. Thank you for the input though.
The transistor is called Q1 2N2222?
Yes the 2N2222 is a very common 'powerfull' transistor. see if you can get a few.
I see that you put 4 LED lights in parallel, does this represent 1 LED strip or 4 LED strips? It seems logical to me that I put 1 LED strip on 1 output of the arduino. The LED strip already has resistors built into it, I think.
This is just a generic/basic schematic I quickly found online. It just demonstrates the use of a transistor to switch a load (in this case multipe leds)
Since your ledstrip needs a higher voltage the schematics need a bit of tweaking.
Maybe you can draw a circuit picture and post it here ?
*What are the 3 boxes on the left side? One is the output and one supplies the voltage? What does the GND box stand for and what does it do? *
The boxed are just pin labels,
The GND label stands for ground and is the same as the GND on your arduino.
The 'digital out' label , for your circuit you would connect it to one of the 'analog out' pins (PWM) say 2, 3, 4 , 5 or 6
the +5V would be replaced by a higher voltage , in your case 12 Volt, but a lower voltage maybe down to 9Volt will also work.
Yes i't similar to that Kit, but I think the excersise is based on 'My little sister is doing an art project'. So building it your self is the key here, and actually she can do 4 channels with fading led's soon much cooler than one realy...
If your LED stripe is short, using 2N2222 is fine, but if it is long one, 2N2222 might not be good because they might over heat. I have a 3ft long LED stripe and when I power it up using my lab power supply, it draws 0.24A when all channels (RGB) are lit, it might be a problem for 2N2222 at that current. MOSFET is probably better choice as they have very low "turn-on" resistance so less heat generated.
mjkzz is correct , I was assuming that you have one ledstrip and that you would cut it up in 4 pieces. Still the 2N2222 will work, 240mA with a Vce of ~.5 = 120mW, the Rth(j-c) is 350K/W would give a 42Celcius temperature rise. (base resistor must be 330R)
She will be using 4 LED strips of each 1 meter long (so 300 mA).
I want to understand the schematic you gave me astrofrostbyte. This is what I understand:
You should connect the positive side of the LED to a power source (e.g. the +5V shown in the figure). Then connect the negative side to the collector side of the transistor. The transistor scales down the current (so the Amperes) to the base side to something in the range of 40 mA which is connected to the OUT of the arduino. My big question is how do you control the brightness of the LED strip, should I not send out an electric signal of the arduino to the LED strip or does it act like some kind of ground? To me it seems a bit backwards.
Can you tell me if I understand the schematic correctly?
She will be using 4 LED strips of each 1 meter long (so 300 mA).
OK, that was not clear to me.
You should connect the positive side of the LED to a power source (e.g. the +5V shown in the figure).
Your model of ledstrip needs more than 5V, in previous posts 12Volt was mentioned.
Then connect the negative side to the collector side of the transistor. The transistor scales down the current (so the Amperes) to the base side to something in the range of 40 mA which is connected to the OUT of the arduino.
Yeah roughly, the transistor scales about a factor 100. So 100mA in the collector will need 1mA in the base.
My big question is how do you control the brightness of the LED strip, should I not send out an electric signal of the arduino to the LED strip or does it act like some kind of ground? To me it seems a bit backwards.
The base of the transistor is controlled by a pin of the arduino, the Arduino has an analog_out which is not really an analog out but uses PWM (pulse width modulation) , which simply means it switches on and off really fast.
This way we simulate an analog voltage, the led is switched on and off very fast so your eye does not notice it.
If your program the line analogWrite(2, 60); 60/255 = ~25% of the time the led wil be ON. to it will appear dimmed to your eye.
Can you tell me if I understand the schematic correctly?
I will stil ask you to draw a schematic , just handdraw it in paint or so. just to validate
I've made a start for you here : http://i45.tinypic.com/j7uhl1.png
Do you know where you are going to buy/get your transistors from , maybe we can get a better type to match your requirements ?.
** What is the resistance value of the LED strip, I would guess it is R1 = U/I = 12/0.3 = 40 Ohm.**
yep pretty close, but I assume the resistors are build into the Ledstrip, i can see them on the photo
** What would a good value for the resistor R2 be? I see you've given it a value, but how do you compute that value?**
if you have 300mA running into the collector the base current needs to be ~100x lower so 3mA.
You control the signal from the arduino which gives 5Volt.
The base-emittor (voltage drop) is 0.6Volts.
So R = U/I = (5-0.6)/0.003 = ~1500 Ohm (max)
To make sure the transistor is switched ON very good ( low voltage drop over Collector-Emmitor we take a value much lower.
Also the current amplification (x100) can sometimes be lower. and maybe you will choose an transistor with lower amplification
So I took 470R to have allot of margin.
** Why do I have to connect the emitter of the transistor to the ground twice (that is how I read it).**
The voltage over the Base emittor comes from the arduino and needs to go back to the arduino (via GND)
** I see you've discussed choosing a different type of transistor due to temperature reasons, a MOSFET, does this complicate the system in any way?**
No not really , the thing is that there are millions of different transistors/Fet's etc , and most of them will work in your circuit.
Thats why I asked where you were planning to buy your stuff online, so we can take a peek which transistors they sell.
I read the webpage you gave me Lakes. I will use the notation of this image in trying to find the values that I need.
The load current Ic is given by the specifications of the LED strip and is equal to 300 mA. The supply voltage Vs = +12V.
The maximum current given by the IC is 40 mA. The supply voltage of the IC is Vc = +5V.
The transistor's minimum current gain hFE(min) must be at least five times the load current Ic divided by the maximum output current from the IC, thus
hFE(min) > 5Ic / (maximum IC current) = 5300 mA / 40 mA = 37.5.
Using this page (Transistors) I find that a suitable NPN transistor is 2N3053 with Ic(max) = 700 mA and hFE(min) = 50.
An approximate value for the base resistor should be
RB = (VchFE(min))/(5Ic) = (550)/(50.3) = 166.66 Ohm.
Can you tell me if this is correct and point me in a direction where I should buy the components online?
Most led strip is voltage driven, they have built in resistors, so no worry about that, simply connect 12V power to it. So in your circuit, you don't need a resistor in series with led strip.
In term of resistor at the base, since NPN transistors are current driven, you probably want to make that resistor very small to make sure it turns into saturation mode (less resistance).