1

Here is what I want to do or get it done (since I am not a embedded guy)...

  • create a prototype with Arduino to detect open window/door of my room using camera(image processing/object state detection)?
  • that prototype will take pictures of room door/window at certain interval and than using some algorithm to decide whether they are open or not and will sound an alarm if it is open.
  • prototype should work in dark as well
  • No false alarms
  • Form factor should be small (the final product should not be bigger than smoke detectors that we have it in our room)

My questions are..

  • Is it possible? :)
  • What all things I need to create a prototype?
  • Which camera should I use? Camera should be really small.
  • Are algorithms available to detect it?
  • 1
    Not possible, the Arduino is far from powerful enough. What you need is a computer, not a microcontroller. Think Raspberry Pi or BeagleBone Black. – Majenko Oct 31 '15 at 14:44
  • Also, one has to ask the question: Why?! What's wrong with technology that's been around for a good century or more: the reed switch and magnet? – Majenko Oct 31 '15 at 14:45
  • @Majenko tecnically both Galileo and Edison+Arduino shield qualify as Arduino, so you cannot just equate Arduino and microcontroller. – Igor Stoppa Oct 31 '15 at 14:54
  • @IgorStoppa Technically some F1 vehicles qualify as Ford. I wouldn't want to drive one round town though. Also, good luck getting hold of one. – Majenko Oct 31 '15 at 14:55
  • @Majenko certainly the availability of non-microcontroller Arduinos is several orders of magnitude higher than F1-Fords. But I'd rather go for the F1-Fiat, anyways :-P – Igor Stoppa Oct 31 '15 at 14:58
1

Your answers :-)

  • yes, it's possible and should not be too complex
  • for a simple prototype, you do not need an embedded device, just a PC with a webcam
  • a webcam with few megapixels should be enough
  • try OpenCV

After your prototype is ready, you can use a small PC-like platform. Examples: Minnowboard, Edison, BeagleBone, RaspBerry PI 2, Arduino Yun, Galileo 2

A word of warning: depending on the expectations you have, you will have to pick more powerful models. Computer Vision is computationally intensive. The examples I gave are roughly sorted by performance and, unsurprisingly, cost. OpenCV is available for many architectures, but afaik, it is particularly optimized for x86, since it's mostly sponsored by Intel.

Disclosure: I work for Intel, so I am more informed on Intel products, but by no means I'm trying to do advertisement, this answer is simply given to the best of my knowledge.

1

I wonder if you haven't overspecified the device? Is there a reason that it must be photo-interpretive? Because if you only need to know whether a door or window is open, a couple of switches and some simple wired logic, or the very most basic of micro-controllers, if you choose to go that way, will be more than adequate, less expensive, more reliable in the long term (Ok, I know you won't be in a dorm room for long), less prone to false or missed alarms, totally unaffected by the ambient lighting or the lack of it, unobtrusive (no cameras - plural - in the middle of the room).

But I get that it might not be as much fun to make, if that is one of your top criteria!

0

I doubt you could make such a thing, especially with no embedded experience.

  • You want to use a camera, but it should "work in the dark" - problem there. You would need to somehow "light" the room with (say) infra-red, but then technically it wouldn't be dark any more.

  • It should be really small, but has to have the power of image capture and image processing. Maybe a dedicated board designed by people with a lot of experience, and using surface-mounted devices, could do that. I strongly doubt you could do it on an Arduino of any type.

  • No false alarms? Without knowing your windows that might be hard to say, but considering windows are usually made of glass, detecting the difference between a closed window, and a wide-open one, might be marginal as you would still see the scene outside through the glass.

  • As the sun rises and falls the image captured would change considerably, quite probably leading to false alarms. Imagine a sudden thunderstorm, where the next image is much darker than the previous one. The image comparison would register a "difference".

  • Imagine a picture taken during a storm with lightning flashes corrupting the image.

  • What is someone enters the room and walks in front of the window? That would register as a difference, but doesn't mean the window is open.


What seems much more practical to me would be variants of existing technologies, eg.

  • Magnets and reed switches

  • Shine a laser on the window and detect if it moves (the angle would probably change).

  • Use distance-detection, such as pinging devices. An open window would change the distance (a bit).

  • Use passive infra-red to detect the movement when the window opens.

  • Vibration detection mounted on the window glass, or possibly the window frame.

  • Temperature measurement to detect a difference in temperature as the window opens.


The camera sounds to me the least practical.

0

Here is what I want to do or get it done (since I am not a embedded guy)...

Welcome to the world of embedded... things. I highly appreciate your interest in the embedded world, after all it's more interesting as just PC things :)

  • create a prototype with Arduino to detect open window/door of my room

You've come to the right place, Arduino (embedded stuff) is very good at input/output. And that seems like a fun project!

using camera(image processing/object state detection)?

Wait, where did this come from? Humans are good at observing, their main sense would be vision (I guess?) to do so. Microcontrollers are somewhat better at logic signals. They are good at taking sensor signals and turning them into whatever you like. There is a possibility you'd just like to do something with image processing/detection. If so, please mention that :)

  • that prototype will take pictures of room door/window at certain interval and than using some algorithm to decide whether they are open or not and will sound an alarm if it is open.

Arduino can read out a simple "Door sensor" and check if the door is, or is not closed. This will both shrink your project and make it easier. Arduino can sound an alarm. You can even add a keypad (for a disable code).

  • prototype should work in dark as well

The drawback of human vision. Is that it does not work so well in the dark. Sensor's based on the touch of the door or a magnetic contact on the door are not affected by darkness.

  • No false alarms

If your sensor won't fail, the alarm won't go off by accident :)

  • Form factor should be small (the final product should not be bigger than smoke detectors that we have it in our room)

Use an arduino nano or micro.

My questions are.. - Is it possible? :)

Yup! You can check for existing projects on the web. You can put in your own implementation though.

  • What all things I need to create a prototype?

Whatever you need is what you will need. An sensor as input, an arduino to process it and an "alarm". There are a trillion configurations for this, you can choose to just go by one or check what fits your needs best.

  • Which camera should I use? Camera should be really small.

Unless you really want to get going with camera detection/object tracking, you shouldn't use one. (Especially with arduino it can be quite frustrating.) You should use a PC or raspberry Pi or Android phone.

Or use arduino with said sensor.

  • Are algorithms available to detect it?

Yes. For this, it's again application specific. You should check out some resources, check what others use and determine what would work best for you. Try it out and if it won't work you can ask it :) (probably on normal stack-overflow since it's not really arduino related, maybe robotics stackexchange).

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.