Multiple motion detection: arduino/webcam?


I am a novice with Arduino, having followed only a few tutorials. These have been enough to get a grasp of what can be done, and so I want to try to create an installation.

My setup is as follows: I want to have 10 water pumps equally spaced out in a line about 1m apart. I want to have some form of motion detection monitoring the pumps, so that when a person comes near, the pump will turn on - creating an interactive fountain.

I have done motion detection in Flash AS2, using differences in consecutive images in a video feed, to decide if motion has occurred, and I have briefly investigated Flash communicating with the Arduino.

However, this solution requires a PC to be available. The environment in which I plan to place this project is dirty, dusty and really not suitable for my expensive laptop, the only PC I have!

I have read on this forum and elsewhere on the net about using motion detection switches - mostly dealing with using a servo to turn something towards the motion, normally with 3 motion detection switches. My needs are a little simpler.

So I signed up here to ask if it is a feasible idea to obtain 10 motion detection switches (ideally infra-red for night use as well as day) and hook them up to a single Arduino controller, which in turn will detect which are being triggered, and turn on the appropriate pump - or, should I attempt the Flash route?

If I do use 10 x motion detection units, will length of cable separating the units from the arduino cause any degradation of signal? I envisage the maximum length of cable from a detector to the arduino of about 15m

Thanks for any suggestions you can offer.

I am not sure what kind of "switches" you are referring to, can you post a link? your description isn't very clear.

That is a long run, and in an electrically noisy environment could pick up a lot of noise, if the signal is digital you could use differential signalling to reduce noise.

It all depends on your switches that detect people. There are ultrasonic units that can detect objects that are in frontal view of them that be useful.

I guess you could use a PIR sensor, maybe stuck at the end of an open tube of some sort to reduce the 'operating angle' so it can ignore movement unless it's right in front of it.

Find one with either a relay contact output or any open-collector output (basically like a switch output) so that it only signals when it detects someone.

Wiring this 15m to the Arduino will be no problem.

Thanks - a PIR sensor masked with a short tube should do what I want.

As I am both new to electronics & Arduino, my vocabulary is not that great, but in this sense, I would want a on/off switch (ie, motion detect or no motion detected) and it does seem as if I can do this using the open-collector output method suggested by ru

I'm in South Africa, where we do not have a large amount of cheap/easily available sensors, but I have some leads from the list of arduino suppliers to see if I can get PIRs.

The environment should not be electonically "noisy" - my installation will be the only electrical thing in the immediate area.

Thanks for your advice.

Let us know how you get on :)

Thanks, no doubt I will have lots of questions!

15m is a long way to go with a CMOS output that isn't specifically designed to drive long wires.

The 75179 is fairly cheap, widely available, and intended to give you a reliable signal over long lines.

Another possibility is to use a very strong pull-up at the sensor end, with an NPN transistor to ground (this assumes the sensor output is active high). That will provide a strong signal to help overcome any noise your wires pick up.

Using a shielded or twisted-pair wire can also help by reducing the amount of noise you need to overcome. With so much Ethernet networking being done these days, Cat5 cable tends to be one of the cheapest sources for wiring things like sensors.

Parallax PIR is about $10 each... they detect "movement" and can be used to trigger I/O like turn on an LED, or pull a relay... these should be able to go further than 15m no problem.

The problem is that you need 10 PIR, and 10 relays, which will require 20 I/O pins... the standard Arduino will not provide enough, you'll have to step up to an Arduino Mega.

Ofcourse, there's the other option of using 10 regular arduino... but when I say arduino, I dont mean the full priced $30 one... I mean once you complete all the schematic and planning, you can build 10 barebone ATMEGA168 or 328 chip with crystal and the required stuff for the I/O, which will come out to like $6 in parts. So you can make 10 of these for like $60... the same cost of an Arduino Mega.

Either route you go, it'll be cheaper than having water onto a laptop... which I assume cost more than $60. You'll have to use a 5v 120v or 240v capable relay, should be under $10 each... this is all depending on what you're using to control your fountains... 10 individual pumps, 10 solenoid valve or something.

I'm interested, sound like a good plan. It'd be even cooler if you use the Arduino to make it dance normally when there is no interaction for a certain time... like a "timeout" dance.

Explain why we even need a micro-controller at all here?

I suspect that it is not a simple on/off fountain, where the pump is always off until the motion is detected and then the pump is always on.

I imagine that the fountain will be doing fountainy things, but that part of the algorithm for the water dance will be which motion sensors have triggered. This would allow the fountain to be interactive. You move around the fountain, and the water dance moves with you.

That's true... I didn't think about that... or my thoughts were too complex from his simple descriptions.

Maybe a simple IR detector flood lamp security thing will be fine wiring to the water pump. No need Arduino here...

but if you want to be cool and make the fountain do dancing stuff... add a Arduino.