Motion sensitive light project

Hi guys,

I'm planning on making a simple project - an LED strip that fades in/out by waving your hand over the sensor/movement.
Unfortunately, even though it's simple, I have very little knowledge about these sorts of things, and could really use some help!

Parts I have so far:
-An Arduino Uno
-A Freetronics light sensor Light Sensor Module | Freetronics). I know this isn't really a motion sensor, but it can detect a hand waving over it, so that's fine.
-An LED light strip (12V) http://www.jaycar.com.au/productView.asp?ID=ZD0461
-A 9V battery clip, 2.1mm plug and battery.

The guy at the shop I bought most of this stuff from said that that's all I should need, but I'm not entirely convinced.

What else do I need...and more importantly, how do I put it all together?

Thanks!

Edit:

Also, if I wanted 2 LED strips, how would I add these on? They would be behaving the same.

You will need some transistor to turn the LED strip on/off - your strip will draw 200mA, too much to drive from the Arduino pin direct, and they need 12V (Your 9V battry might make them turn on, but they will not shine)

The sensor will detect light level, not motion. In other words it will not see the differnece between you waving from right to left or left to right. Turning the light off/on in the room will also seem like "a hand waving". If that is OK for you, fine. Alternatives is to use a distance sensor, they can both be optical or ultrasonic.

If you want more strips to behave identically, just wire them up in parallel. (Your transistor may need to be be bigger. Or wire one transistor to each strip and then drive them from the same Arduino pin. If you have pins to spare, use one pin to each and in the sketch do the same to all pins.

Msquare:
You will need some transistor to turn the LED strip on/off - your strip will draw 200mA, too much to drive from the Arduino pin direct, and they need 12V (Your 9V battry might make them turn on, but they will not shine)

Firstly thanks for the help, it is greatly appreciated.
What sort of transistor should I be looking for/what sort of properties does the transistor need to have?
And in order to get 12V I would assume I would need something like this? Arduino Playground - WhatAdapter

The sensor will detect light level, not motion. In other words it will not see the differnece between you waving from right to left or left to right. Turning the light off/on in the room will also seem like "a hand waving". If that is OK for you, fine. Alternatives is to use a distance sensor, they can both be optical or ultrasonic.

Yes, this is fine.

If you want more strips to behave identically, just wire them up in parallel. (Your transistor may need to be be bigger. Or wire one transistor to each strip and then drive them from the same Arduino pin. If you have pins to spare, use one pin to each and in the sketch do the same to all pins.

Thanks very much, I'll look into it.

I just realised that the sensor says "Supply voltage: 3.0 to 5.5VDC"

Does this mean that it will be incompatible with the setup I plan on using?

Thanks

wslyr:
I just realised that the sensor says "Supply voltage: 3.0 to 5.5VDC"

It means it will work fine when connected to the Arduino shield's GND, 5V and AnalogInput pins

wslyr:
What sort of transistor should I be looking for/what sort of properties does the transistor need to have?

Yes, i do not want to mention anything specific - you might not be able to get that one.

My recomendation: A "Logical MOSFET", which means it will turn on full with a gatevoltage slightly less than 5V. A normal MOSFET needs 10V. Here is a little example (way too expensive, but you get some nice screw terminals) https://www.sparkfun.com/products/10256

Msquare:

wslyr:
What sort of transistor should I be looking for/what sort of properties does the transistor need to have?

Yes, i do not want to mention anything specific - you might not be able to get that one.

My recomendation: A "Logical MOSFET", which means it will turn on full with a gatevoltage slightly less than 5V. A normal MOSFET needs 10V. Here is a little example (way too expensive, but you get some nice screw terminals) https://www.sparkfun.com/products/10256

Thanks for the reply! I'll have a look around for those.

I've found this website which shows what I want to do (but replace potentiometer with light sensor) at the end of the page:
http://itp.nyu.edu/physcomp/Tutorials/HighCurrentLoads
and I assume this is the same issue as my project (12V lightbulb, or in my case LED strip).

A few questions regarding this:
a) Is it indeed the same situation, and can I copy the schematics?
b) how do you get the 12v power pack/wall wart to connect to the breadboard?
c) I assume the Arduino would still need power to run off - can it run off USB power while the LED is strip uses the 12V from the power pack/wall wart?
d) Would this work for the transistor: http://www.jaycar.com.au/productView.asp?ID=XC4244 ?

Thanks.

a) Is it indeed the same situation, and can I copy the schematics?

Yes, if you use the MOSFET, not the Darlington Transistor.

b) how do you get the 12v power pack/wall wart to connect to the breadboard?

It is shown as the black barrel connector on thefar right to the breadboard and on the top in the schematic. NOTE all the Ground/negtive are connected (ie of the 5V Arduino and 12V)

c) I assume the Arduino would still need power to run off - can it run off USB power while the LED is strip uses the 12V from the power pack/wall wart?

Yep. You can also feed the 12V into the barrel connector on the Arduino board - it has a regulator so only 5V reaches the board.

d) Would this work for the transistor: http://www.jaycar.com.au/productView.asp?ID=XC4244 ?

Yes. Took me 20 minutes to get that confirmed. Cant trust the advertising only. (it has a Vgs fullon at 4.5V)

Msquare:
Yes, if you use the MOSFET, not the Darlington Transistor.

Excellent!

It is shown as the black barrel connector on thefar right to the breadboard and on the top in the schematic. NOTE all the Ground/negtive are connected (ie of the 5V Arduino and 12V)

I meant physically, because obviously the breadboard doesn't have a barrel connector, so how would one connect a 12v power pack to a breadboard?

Yep. You can also feed the 12V into the barrel connector on the Arduino board - it has a regulator so only 5V reaches the board.

As in, I only need one power source?
I'm quite confused on this topic. I've heard from some sources that I need two power sources (one to the Arduino and one to the LED strip) and others saying I just need one 12v power source to the Arduino?

Yes. Took me 20 minutes to get that confirmed. Cant trust the advertising only. (it has a Vgs fullon at 4.5V)

I appreciate that. Thank you very much, you've been a great help.

It is perfectly acceptable to have one power source. All your equipment in your house comes from one powersource, the mains, right? :wink:

It is a problem of decoupling, and absorbing spikes. In particular with motors, they will for a brief time when you turn them on draw a lot of power causing a (weaker) powersupply to (briefly) drop the voltage which may upset the Arduino chip (causing the program to behave erratically). So it is a question of having a big enough powersupply (amps and internal capacitors) or adding a few capacitors here and there. Alternativly use seperate cheaper power supplies.

As you only drive LEDs it should be OK. As you can see from above it is a judgement call, I may be wrong, in particular if your supply has not enough "ooomph".

I can not understand your "how to connect 12V to breadboard" question. You just stick the wires in, just like you do with the 5V. Of course you make sure the right voltage goes to the right component, but ensuring correct wiring is true of any breadboard connection.

On the HighCurrentLoads page you linked to, they have paired up the long "power rails" on each side of the breadboard. By removing the lower red wire you can have a 5V rail on the left side and a 12V rail on the right. (You do know how a breadboard is wired inside, right?)

Hmm, interesting.
It has been very confusing for me, with people saying I need either one 12v power source to the breadboard/one to the Arduino only/one to the breadboard and Arduino.
So, would I be correct in assuming that all of these are possible?
Or I could even use 12v to breadboard, USB for Arduino?

No problem. I found the answer here:

And yes, I am aware the breadboards are wired inside :slight_smile:

I hope that helps, I found his tutorial series extremely helpful, that episode covers dimming according to light sensors I know its a bit long but I do suggest u watch all of it

alainagius:
Tutorial 04 for Arduino: Analog Inputs - YouTube

I hope that helps, I found his tutorial series extremely helpful, that episode covers dimming according to light sensors I know its a bit long but I do suggest u watch all of it

Thanks for the link.

Another question: I got the mosfet module, but I am a bit confused at the "gate, drain and source". Which bit goes where according to the schematic show on that previous website?

I am glad to report that I have managed to get this project to work (with USB to Arduino and 12v power pack to the LED strip).

Would this work if I had 12v just to the Arduino?

Or how would I make the 12v power pack go to both the Arduino and LED strip?