Monday, April 3, 2017

Coolest motion detection sensor


Intro

Ever want to build an alarm system?
The RCWL-0516 is a human body motion detection sensor. A sensor, that detects, through induction, human body movement. So it should only react if a body movement is detected. Moving objects should be ignored. How cool is that?

Wiring


Straight forward. 
GND => GND
5V => VIN
D2 => OUT

Pin 3V3 on the RCWL-0516 is an output. And the CDS-pin you can attach a light sensor. I will cover it in a later video.


Videos

Wiring & Use


ESP & detection tests





Code

Seriously? You set the pin, the RCWL-0516 is attached to, as an input. And if you register a 'HIGH' signal, you do stuff. Watch the video. Coding is done in 2 minutes.

Q&A

Update 29-05-2017
This sensor seems to get quite an attention. There are some questions that some of my viewers asks. Here is what I found out.

Q: Can you use the RCWL-0516 with an ESP8266? Or will you get randomly false positive results?
A: I've done a short term test with the ESP8266 on a NodeMCU board. It seems to work just fine. 
The ESP greater Version 12-E is shielded and is FCC certified. So it should, by definition, not interfere with other electronics.
 However one viewer reported randomly false positive results on a long shot.

Q: Is the water in the human body responsible for the detection?
A: Probably. I tested it with an empty and with a water filled bottle. And even with a cat. And it seems that the bigger the object the further away it can be detected.

Q: Can it be mounted mobile to detect persons? 
A: No. The sensor seems to be quite sensible to movement itself. Any movement of the sensor itself seems to trigger the output.

Q: Does the radiation of the sensor harm you in long term?
A: No. The Sensor uses about 30 milliwatts (mW). The radiation output is limited to that value. That is far less than your smartphone emits.

Links

Amazon

RWCL-0516
NodeMcu
Arduino Uno

18 comments:

  1. Hi, cool find you got there, I made a question in your YT video, Bernardo is my name. I was wondering how does the sensor behave if its put on a moving platform like a Radio Control car, or if you where to put it on the cocktail mixer that you show in the video, but with lid off and point it like a flash light. Would it detect only humans then? Tnx for your time and sorry for the wierd questions

    ReplyDelete
  2. Actually it isn't a weird question. ;-)
    When I put it in the cocktail mixer I wanted to prove that the metal shields the signal. But when I accidental moved the mixer, the sensor triggered the movement.
    So long story short: the sensor will work only if it is mounted on a fixed position. Else you'll get false positive results.
    To the other question: I'll guess it will detect not only humans. And if my cat wasn't sleeping all day long, I could even prove it :-D

    ReplyDelete
    Replies
    1. Cool tnx for the reply, so it detects living things only.. do you thing it is because of the water content in our body? would it detect a moving bottle of water?

      Delete
  3. Would it detect tree or shrub leave movement when moving by wind? This is a trouble with PIR sensors. There is water in the leaves, but not as much as in your bottle.
    The ESP interference with PIR might be improper ESP PSU decoupling and too thin and long wires with high impedance to the PIR. I had similar issues and had to decouple the power on the PIR itself with 100nF and 10uF to get good power to the PIR.

    ReplyDelete
  4. It is a radar device, it is trigger by Doppler effect, any movement in the room generated a frequency that is higher or lower than the frequency the radar emit. Once it detects energy on its receiver its trigger.
    The radar device has a notch filter to the frequency it emits out.
    Some empty bottle is transparent to the 30 mW RF out, so it is not detected. It has nothing with water. Just mass.
    Simple
    nissim@elinistech.com

    ReplyDelete
  5. I love this sensor too! Have you had any luck sensing 180 degrees or finding this sensor is any format that isn't 360 degree detection?

    ReplyDelete
    Replies
    1. I guess it qould be quite easy to shield the unnecessary 180°. A metal plate in a fixed position should do the trick

      Delete
  6. Can it detect or programmed to detect number of humans in a given area? I have a project that needs to detect minimum 2 humans in a room and if the number falls below 2 then to raise an alarm, can this be done using this out anything else that you can advise in? Thanks

    ReplyDelete
    Replies
    1. No. It cannot count the persons in the room. If you want to start this kind of project, I would recommend video recognition.
      With a Raspberry Pi, a camera module and OpenCV you can detect and count persons in a room quite reliable.

      Delete
  7. This comment has been removed by the author.

    ReplyDelete
    Replies
    1. This comment has been removed by the author.

      Delete
  8. I was wondering if just by putting higher resistance at R-GN really decrease its detection range. Do you have any experience in this? Hope to hear from you soon.

    ReplyDelete
    Replies
    1. Corresponding to the datasheet it does. But I haven't tested it myself yet.

      Delete
  9. Hallo,
    kann man den Sensor auch zur Abstandsmessung nutzen? Hintergrund: ich möchte einen Sensor hinter einer Glasscheibe nutzen, der soll aber nur bei einigen cm eine Bewegung registrieren, sonst nicht.
    Ich finde sonst nichts, was durch Scheiben hindurch detektiert.

    ReplyDelete
  10. Hi,

    Would a strong rain set off the detector?

    ReplyDelete
  11. Where can I find circuit, code to count morebthen 2 human beings using raspberry and camera means complete project details ?

    ReplyDelete
  12. ....To count More then 2 human beings....

    ReplyDelete
  13. Is there a way to limit the detection angle to 45 degrees? Perhaps with metal?

    ReplyDelete