RCWL-0516 Microwave...
 
Notifications
Clear all

RCWL-0516 Microwave Proximity Sensor - With & Without Arduino

28 Posts
6 Users
10 Likes
2,425 Views
(@dronebot-workshop)
Workshop Guru Admin
Joined: 5 years ago
Posts: 1075
Topic starter  

The RCWL-0516 is an inexpensive proximity sensor that works using microwaves and Doppler Radar. It can be used on its own or with an Arduino, I will show you both ways.

Article and code downloads at https://dbot.ws/rcwl0516

Today we will look at another proximity sensor, the RCWL-0516. This device works using microwaves and the Doppler Effect to detect the presence of humans (and other creatures) in a room. It is inexpensive and can be used by itself or in conjunction with an Arduino.

Don’t be concerned about the microwave aspect, this device emits a very low level of microwave radiation at 3.18 GHz, which is on the low-end of the microwave spectrum. It is perfectly safe to experiment with and to use in your projects.

The device is very inexpensive and can be obtained on eBay, Amazon, and probably at your local electronics shop (which is where I got mine) for around 2-3 US dollars.

The RCWL-0516 operates using the “Doppler Effect”, a phenomenon discovered in 1842 by Austrian physicist Christian Doppler. The Doppler Effect describes a change in frequency observed by a stationary observer when the source of the frequency is moving.

If you have ever heard the sound of a train as it races towards and then away from you, or an ambulance as it races down the road, you will have heard the siren frequency changing as the object approaches, passes, and moves away from you. That is the Doppler Effect in action.

In the RCWL-0515 microwaves are sent out and reflected back. Any moving object in the area will change the frequency of the reflected waves, thus triggering the device.

I will show you how to use the RCWL-0516 on its own, both by itself and with an optional light sensor. You'll see that because it uses microwaves it is still operational even when encased in a plastic enclosure.

Then we will use an Arduino with the RCWL-0516. I’ll show you how to make the device “latch”, great for an intruder alarm or automatic light switch. Then I will show you how I built a remote sensor using an RCWL-0516 and two Arduino's.

Here is the Table of Contents for today's video:

00:00 - Introduction
03:12 - The RCWL-0516 & Doppler Effect
09:33 - Basic Hookup & Demo
12:35 - Light Sensor Hookup & Demo
15:14 - Arduino Latching Device Hookup & Code
20:31 - Arduino Latching Device Demo
23:44 - Arduino Remote - Transmitter Hookup & Code
29:02 - Arduino Remote - Receiver Hookup & Code
32:19 - Arduino Remote Demo

As always there is an article with more details and all the Arduino code, you will find it at https://dbot.ws/rcwl0516.

"Never trust a computer you can’t throw out a window." — Steve Wozniak


   
Quote
(@activ8me)
Member
Joined: 3 years ago
Posts: 5
 

Don’t be concerned about the microwave aspect, this device emits a very low level of microwave radiation at 3.18 GHz, which is on the low-end of the microwave spectrum. It is perfectly safe to experiment with and to use in your projects.

After watching the workshop I bought 10 of these. 

Now this might be a bit controversial, but I still have some reservations regarding the "Don’t be concerned about the microwave aspect".

I am not deep into electronics to come on my own to a qualified opinion regarding the health aspect of this low-end of the microwave spectrum and very low power radiation.

In that respect I would like to get some more qualified opinion. Could I use these devices inside my home always active (lets say to control light or as a burglar alarm etc.) and not be concerned at all by their radiation.

I understand that the Chinese release all these dirt cheap kind of experimental chips. But I doubt that they would care about any health questions.

Thus before I decide where and how to use these devices I would much appreciate to get some opinions on above.

Another small question I have concerning these devices:

I understand that they radiate, sensor in all directions (360°)while they are more sensitive where they should according to specs.

How can one safely limit the device radius? I read that aluminium does block the microwaves but that it should be 1cm from the device away. Does anybody have experience with this?

 

 


   
ReplyQuote
Will
 Will
(@will)
Member
Joined: 3 years ago
Posts: 2507
 

@activ8me 

If you're terribly concerned about the radiation, then just make a small, thimble shaped aluminum foil (double thickness) hollowed out to about 2-3 cm deep and stick the device in the bottom with the wires exiting behind.

You can then put one on each side of the door of interest and the cone will limit the area of exposure to directly below the sensor. By having one on either side of the door, you can tell (from which one triggers first and which follows) whether the person is entering or leaving the room. You can then adjust the lights accordingly.

Of course, if you have multiple people entering and leaving and want the lights on when the first enters and off when the last leaves, then your logic will be more complicated.

Anyway, the zone of potential danger is now reduced to two small areas on either side of the doorway, so unless you tend to spend a lot of time lounging in doorways, you're pretty safe.

In the case of burglars, they'd be relatively hazard free as well - unless they're unskilled enough to have to lounge in the doorway long enough to pick the lock or kick repeatedly at the door.

Anything seems possible when you don't know what you're talking about.


   
Inst-Tech and activ8me reacted
ReplyQuote
(@activ8me)
Member
Joined: 3 years ago
Posts: 5
 

@will 

Thank you for the suggestion.

Good advice. I will try that. 

No, I am not terribly concerned about the radiation, I just feel better being safe than sorry. Then it is not only about me or a prototype, but also in respect to implementing this kind of tech in a commercial product. I believe such effects just in general should be taken more seriously and manufacturers should be more serious about those.

With radiation, wireless, G4/5, whatever, in my experience some people react very sensitive to it, others not. And if any secondary effects exist, they might never get identified or only decades later.

I guess that is why in my first post I have called this a kind of controversial subject. Of course, I am surrounded by radiation of multiple kinds and happily using all this over the air technology. So I am by no means just against it. I just believe it should be taken into account.

 


   
Inst-Tech reacted
ReplyQuote
(@yurkshirelad)
Member
Joined: 3 years ago
Posts: 493
 

Which side of the 0516 is the front and which is the back? Rather which side should face the area you want to detect motion? The side with the pin markings seems to be the most sensitive to motion.


   
ReplyQuote
Will
 Will
(@will)
Member
Joined: 3 years ago
Posts: 2507
 

@yurkshirelad 

It would seem reasonable that the PCB side with the antenna would be the most receptive, but I can't say for sure since I've never seen or used one.

Anything seems possible when you don't know what you're talking about.


   
ReplyQuote
(@yurkshirelad)
Member
Joined: 3 years ago
Posts: 493
 

That makes sense. I'd read that it can detect motion from both sides so I thought the direction it faced was irrelevant. I'm not sure that's true though based on non scientific observations.

 


   
ReplyQuote
Ron
 Ron
(@zander)
Father of a miniature Wookie
Joined: 3 years ago
Posts: 6903
 

@activ8me Remember the already tiny amount of radiation reduces as the inverse square. If it is x at 1cm then it is 1/10,000 at 1 meter. A rough calculation of the wattage not allowing for any losses is to measure the input power. I believe it's 5V and IIRC it's powered by a pin so maybe 20 ma making input wattage of 100 milli Watts and at 1M is 10 micro watts (micro is millionth)

At 5cm from the source, it will be 4 milli Watts before accounting for losses. The standard for a microwave oven is IIRC 5 milli Watts so I wouldn't be concerned.

 

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.


   
ReplyQuote
Inq
 Inq
(@inq)
Member
Joined: 2 years ago
Posts: 1900
 

Have a couple of questions about its capabilities.  

  1. Bill said it can supply 100mA at 3.3V.  An ESP8266 - ESP-01 uses 70mA nominally.  I've read that it has some start-up surge.  Has anyone tried powering the MPU from this sensor?  Can it be done?
  2. It has (big) enough chip to have other capabilities.  Does it have any option to do more things?  Since it detects speed (via Doppler) coming toward/away does it have the ability to give us that speed value? - Aka Radar Speed Trap Gun - even on a small scale... say HotWheels or Pinewood Derby?

3 lines of code = InqPortal = Complete IoT, App, Web Server w/ GUI Admin Client, WiFi Manager, Drag & Drop File Manager, OTA, Performance Metrics, Web Socket Comms, Easy App API, All running on ESP8266...
Even usable on ESP-01S - Quickest Start Guide


   
Inst-Tech reacted
ReplyQuote
Inq
 Inq
(@inq)
Member
Joined: 2 years ago
Posts: 1900
 
  1. Eh! 🙄  Finally found something about power 3.3V - "3.3V output is for reference only - do not use to power other devices."
  2. Same reference seemed to say it was only - 1 activity, 0 idle on the output.

Unless some inspired hardware person knows how to Hack this and dig out velocity??? 😏 

3 lines of code = InqPortal = Complete IoT, App, Web Server w/ GUI Admin Client, WiFi Manager, Drag & Drop File Manager, OTA, Performance Metrics, Web Socket Comms, Easy App API, All running on ESP8266...
Even usable on ESP-01S - Quickest Start Guide


   
ReplyQuote
Ron
 Ron
(@zander)
Father of a miniature Wookie
Joined: 3 years ago
Posts: 6903
 

@inq I don't have a scope, but my reading is that the output pin has a range of 0 to 3.3v. I suspect it is possible to translate the voltage to distance. Going further if you want velocity, then two samples delta t apart called v1 v2 v3 etc, then acceleration is the delta t between v's.

I am upper lip deep in my own project at the moment or I would try that math, if somebody has a sensor and wants to try lets hear what the results are.

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.


   
ReplyQuote
(@yurkshirelad)
Member
Joined: 3 years ago
Posts: 493
 
Posted by: @zander

@inq I don't have a scope, but my reading is that the output pin has a range of 0 to 3.3v. I suspect it is possible to translate the voltage to distance. Going further if you want velocity, then two samples delta t apart called v1 v2 v3 etc, then acceleration is the delta t between v's.

I am upper lip deep in my own project at the moment or I would try that math, if somebody has a sensor and wants to try lets hear what the results are.

 I didn't realise the output voltage was dependent on the distance of the subject. I'll have to investigate this with my toy scope. Thanks @zander.


   
ReplyQuote
Inq
 Inq
(@inq)
Member
Joined: 2 years ago
Posts: 1900
 

@yurkshirelad, @zander - If I understand the video correctly, it's doing Doppler-shift not range finding.  I.E.  When he moves his hand in front of it, it lights up, but if hand is kept still in front of it, the LED will go off.  But that is a great find that its voltage changes on that "out" pin! 👍  

Maybe its analog and the voltage is a function of velocity????  I might have to break-down and get a couple.  😎

3 lines of code = InqPortal = Complete IoT, App, Web Server w/ GUI Admin Client, WiFi Manager, Drag & Drop File Manager, OTA, Performance Metrics, Web Socket Comms, Easy App API, All running on ESP8266...
Even usable on ESP-01S - Quickest Start Guide


   
ReplyQuote
Ron
 Ron
(@zander)
Father of a miniature Wookie
Joined: 3 years ago
Posts: 6903
 

@inq I don't remember my results, but that makes sense. Now how do I explain the units in my truck, they signal distance via colour changes.

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.


   
ReplyQuote
Inq
 Inq
(@inq)
Member
Joined: 2 years ago
Posts: 1900
 

I don't recall Bill referencing this github link, so I might have just stumbled across it.  I'm reading through it now.  It also uses the issue tracker (up to 41) as a mini-forum of questions.

https://github.com/jdesbonnet/RCWL-0516

3 lines of code = InqPortal = Complete IoT, App, Web Server w/ GUI Admin Client, WiFi Manager, Drag & Drop File Manager, OTA, Performance Metrics, Web Socket Comms, Easy App API, All running on ESP8266...
Even usable on ESP-01S - Quickest Start Guide


   
ReplyQuote
Page 1 / 2