Here is my implementation of the RCWL-0516 circuit for detecting motion, as seen in this DBWS video. Thanks very much @dronebot-workshop; I really enjoyed this experiment! I just followed Bill's examples for my circuit, but I thought I'd post my observations.
As others have noted, these are quite cost-effective little devices. I got a 10-pack. One seemed just defective, but that's not too bad. All the others worked. In my photo, I have three "extra" jumpers connected to the breadboard but just left open, sticking up into the air. I have found these very handy for testing the bare modules, BEFORE going to the trouble of soldering on the headers. In any case, 9 out of 10 work fine.
I used an Arduino Nano clone with USB, and with 5V for power to the RCWL-0516. I do use 3.3V for the little green LED, but I figure that doesn't make too much difference. The module was mounted vertically on the breadboard, using right-angle headers.
After running the experiment with the latch via push button, I noticed that even though I pushed the button, pulling my hand away triggered the motion detector again. I guess this makes sense, but I could never "escape" from the trap I'd built! So I added a few seconds delay for me to get away to a safe distance.
I wanted to test how far away it would work, i.e., the maximum distance where I could trigger the device. For this kind of testing, it got really old running up and pressing the button. So I put in a millis() timer to "forgive" myself after 8 seconds, even if I hadn't pressed the button. With this in place, I found I could trigger it from about 9 meters, which was out the door of my small lab/spare bedroom, and down the hall as far as I could go. The module is quite sensitive. I don't admit this easily, but a vertical shake of my shoulders did not trigger it, and a horizontal shimmy would always trigger the device. Do not picture this in your mind; I am not Kristi Yamaguchi. 😉
I will post a separate note about issues with moving this setup to an ESP8266 and real world plans. Ciao, John.
In theory, theory and practice are the same.
In practice, they're different.
For some reason, I have been unable to get the RCWL-0516 to work. I'm using the breadboard setup identical to Bill's video. When I apply ca. 5V to the power input, I'm seeing 3.3V from the regulated output. However, the sensor output only reliably triggers when I put my finger about 1/4 inch from the antenna.
I've tried 10 of these boards from two different vendors, but I get the same results from all of them. It would seem clear I'm doing something wrong, but for the life me I can't figure out what. I've tried different power supplies and looked through the long list of discussion topics on the GitHub site for the RCWL-0516.
Any suggestions would be appreciated.
Maybe try this simpler circuit ...
Anything seems possible when you don't know what you're talking about.
@donpk I will try the simpler circuit tomorrow.
First computer 1959. Retired from my own computer company 2004.
Hardware - Expert in 1401, and 360, fairly knowledge in PC plus numerous MPU's and MCU's
Major Languages - Machine language, 360 Macro Assembler, Intel Assembler, PL/I and PL1, Pascal, Basic, C plus numerous job control and scripting languages.
Sure you can learn to be a programmer, it will take the same amount of time for me to learn to be a Doctor.
@will That's actually the circuit I'm using, which is the same one used in DroneBotWorkshop video. It doesn't get much simpler: ground, 5V Vcc and the RCWL-0516 output which I've connect to an LED via a dropping resistor.
Umm .. the sketch says to use pin 12 for the RCWL connection and pin 3 for the LED. The RCWL should connect directly to the Arduino pin, not be routed through the LED and a resistor.
To me, your description sounds as if the wiring is incorrect.
OK, I understand now, you're not already using the same circuit as the article I sent you, because it's using an Arduino to read the sensor an you're not using a uController of any kind.
So, I'd suggest that you tip the sensor PCB board back a bit so that the antenna is pointing up and away from the desk.
Anything seems possible when you don't know what you're talking about.
I'm using the simple circuit Experiment 1 from Bill's article:
If I can't get that to work, there's no point in hooking it up to an Arduino.
Have you tried tipping the board back so that the antenna is not vertical or horizontal ? The surrounding area is not covered equally well in all directions.
Anything seems possible when you don't know what you're talking about.
First computer 1959. Retired from my own computer company 2004.
Hardware - Expert in 1401, and 360, fairly knowledge in PC plus numerous MPU's and MCU's
Major Languages - Machine language, 360 Macro Assembler, Intel Assembler, PL/I and PL1, Pascal, Basic, C plus numerous job control and scripting languages.
Sure you can learn to be a programmer, it will take the same amount of time for me to learn to be a Doctor.
@donpk Have you read the OP?
First computer 1959. Retired from my own computer company 2004.
Hardware - Expert in 1401, and 360, fairly knowledge in PC plus numerous MPU's and MCU's
Major Languages - Machine language, 360 Macro Assembler, Intel Assembler, PL/I and PL1, Pascal, Basic, C plus numerous job control and scripting languages.
Sure you can learn to be a programmer, it will take the same amount of time for me to learn to be a Doctor.
I'm not sure. What is the "OP"?
OP = Original Post (or Poster, depending on context)
Anything seems possible when you don't know what you're talking about.
First computer 1959. Retired from my own computer company 2004.
Hardware - Expert in 1401, and 360, fairly knowledge in PC plus numerous MPU's and MCU's
Major Languages - Machine language, 360 Macro Assembler, Intel Assembler, PL/I and PL1, Pascal, Basic, C plus numerous job control and scripting languages.
Sure you can learn to be a programmer, it will take the same amount of time for me to learn to be a Doctor.
@donpk I just tried the simple circuit, and it does not work very well at all. I triple checked the circuit, the LED comes on on power up, but then almost never reacts from a few inches away at least. I have a few of these and will try some more but I will first rewatch Bill's video to see his results.
First computer 1959. Retired from my own computer company 2004.
Hardware - Expert in 1401, and 360, fairly knowledge in PC plus numerous MPU's and MCU's
Major Languages - Machine language, 360 Macro Assembler, Intel Assembler, PL/I and PL1, Pascal, Basic, C plus numerous job control and scripting languages.
Sure you can learn to be a programmer, it will take the same amount of time for me to learn to be a Doctor.