Microwave for the Weekend

tmp2DA0If you read the blog about the Maker Faire, I just came back with a bag of goodies and one of them is a microwave movement sensor.

Not the two-board solution I discussed a while ago that never really worked – this is a small, neat single board called an RCWL-0516 and here’s a Chinese link though if you get in touch with the fellow I mentioned at the Faire where I got mine – ABX-LABS (Ebay shop) he might have them. About £1 anyway.

So this board has 5 wires and not a lot of information out there, some of which is in Russian. I did found out enough to know that this unit is oscillating at around 3 Gig and you only need to use 3 of the 5 wires!

The unit will pick up movement up to 7m away and in the right circumstances can see right through wood! No silly comments about being irradiated please.

So I set it up on my bench, the 3 wires of interest are ground (obviously) VIN and VOUT. Stick 5v on VIN (will not work on 3v3) and a LED on VOUT – and you’re done – it works.

Well, that was easy and of course it WAS too easy. I took the board and applied it to one of our ESP8266 boards which have 5v – and took the output to Pin 14 which in the case of my software, is a de-bounced input which can send an automatic MQTT message on change.  Job done – except – it would not work. It seemed over-sensitive but after more careful checking – it really wasn’t taking too much notice of movement – instead triggering fairly regularly ALL ON IT’s OWN!  I tried putting a cap across the power, I tried putting a cap across the output – all to no avail.

In the process of having a gripe with Aidan that we’d been ripped, I put the board on my standalone test to show him it working – and decided to route ground and signal back to the ESP – it worked perfectly – then it twigged -  ESP8266 boards are prone to putting spikes on the power lines when transmitting!  I put a 10r resistor in series with the power and a tiny 330u 6v cap to ground at the Microwave board end – problem solved.

If you want to do something clever, the 16 pin logic chip – I stuck a scope on it and pin 12 gives off some interesting analog stuff!

In terms of sensitivity it pretty much works 360 degrees though supposedly it is most sensitive on the component side of the board direct on.

I spend half of my time waving my arms about at the normal room IR sensor to keep lights running – this I think will be MUCH better.

Have fun.

Facebooktwittergoogle_pluspinterestlinkedin

24 thoughts on “Microwave for the Weekend

    1. Wow, thanks for this! I spent a ton of time pulling out my hair trying to get these modules to work and I had worked out the problem with the power spikes, but I hadn't thought of adding any filtering for some reason.

      I suspect this would also solve the same issue using those PIR sensors, which behave virtually the same.

  1. Hi Pete,

    Please live the sensor in a room for 24 hours and check how many false positive alarms do you have. I experience false positive alarms on PIR sensors when the wind bow or the sun comes out from the clouds (this is a normal behavior for a PIR sensor, but still a false positive result)

    Is the microwave sensor sensible to object movement (like a chair) or just to human body movement ?

    How about small animals like a cat or a dog ?

    3V3 Vout is analog or digital output ?

    1. I think for £1 it is worth getting one to experiment:-) I plan (once I've finished the unpleasant job of moving everything to a new Pi because (a) my Pi2 is acting up for once and (b) I finally need more speed so moving to a Pi3 after discovering that a NanoPi NEO2 simply does not have enough RAM for what I need) to database the changes of state so I can tell if it false triggers overnight. The plan would be to use these for movement detection in my office for lighting as the PIRs are just not sensitive enough to notice I'm there but dozing off.

      1. When you test, could you also see if it is pet friendly, i.e. does not trigger with a pet. (Sorry - we do not even know if you have pets!) - Could you crawl into the room to simulate a pet ? hahaha ! 😎

        1. I have some, it will most definitely trigger with a pet. They are very sensitive to actual movement, though I don't see many false alarms.

  2. Hello !
    What do you mean by "I put 330u 6v cap to ground at the Microwave board end"?
    Where exectly have you inserted the capacitor? Thank you, best regards

  3. Your third from last paragraph includes "Here’s a really informative blog on the subject but the above is really all you need to know." but there is no link. Which blog did you find so informative? Thanks.

  4. I've been struggling for WEEKS with a miniature DIY motion detector device built with RCWL-0516 + ESP32E + mini 5V P/S ( http://www.ebay.fr/itm/401301418281 ).
    It sometimes worked flawlessly for hours then started giving me false triggers repetitively ... I even tried to get the radar sensor out of the casing in case it would work better when distant from the ESP, but to no avail 🙁
    I thought this sensor was definitely prone to interferences and not reliable enough to be used in a motion detector device in the long run.
    ***
    Then I decided to wire an on-the-fly pi-filter ( see https://www.dropbox.com/s/9bth6k8vvs6nznv/RCWL-0516.jpg?raw=1 ) and it worked flawlessly for 48hrs and I never had any more false triggers !
    ***
    However, as soon as I ***RE***cased the whole thing together (ESP + RCWL + P/S), it started giving me again false triggers, particularly when the sensor stood very close to the ESP32E ... it's just disappointing for I wanted to make the whole device dense and compact.
    If I can't get rid of those interferences between the ESP and the sensor, I will definitely have to rethink my layout and keep the RCWL-0516 outside of the casing 🙁
    ***
    Would you have any further suggestion ?

      1. hey there great article! however i was looking for caps and can't find any 300u 6v caps. and 10r resistors? Sorry, not a master in electronics but im guessing you mean 10 ohm resistor? and 300uf v caps? Even searching for 300uf caps I can't find any. Do you possibly have a link to where i can buy some on ali?
        Thanks

        1. Hi there - the article is really directed to those who have this kind of stuff lying around. 300uf 6v capacitors or thereabouts are all over Ebay.

          10r - 10 ohms...

          Pete.

          1. thanks for all of this. I ordered some caps and resistors plus a 3.3 boost to 5 and now have it working beautifully in my sonoff s20

  5. ESP wifi can cause false alarms. To avoid them put a small capacitor to GND on trigger pin, or test inside the code, if the trigger pin is still UP 200ms after the initial rise.

    1. Hi Ion,

      so every movement longer than 200ms is a movement/motion?

      I come up with this code:

      long lastRise = 0;
      long lastMsg = 0;
      int radarPin = D2;

      void setup() {
      pinMode (radarPin, INPUT);
      }

      void loop() {
      int reading = digitalRead(radarPin);
      long now = millis();
      if(reading == HIGH){
      if(now - lastRise > 200){
      if (now - lastMsg > 5000) {
      if(now - lastRise != 201){
      Serial.println("Motion detected");
      Serial.println(now - lastRise);
      lastMsg = now;
      }
      }
      }
      lastRise = now;
      }
      }

      As you can see i check for the 200ms - but whatever i use there (200,400,900) theres always one value that matches 201 401 or 901... Thats the reason why i use another if. Maybe i did a mistake in code?

      Do you have an example oft working code?

      Thanks in advance
      Andreas

  6. I never had issue with false trigger because I kept the MW sensor little far from ESP board. ESP RF will interfere with MW sensor board and we get lot of false triggers. I had issue with some set of PIR sensors false triggering and I added 104 (ceramic) cap and 47uf and there is no single false trigger till now. This same combo works with this MW motion sensor. Good Luck!!

  7. I have a question, these modules are rated @ 20mW and according to info. I got from internet the safe limit if microwave radiation is below 10mW Cm2. So how safe it is to use these modules inside home, where we get exposed to these at-least more 13 hours. Thoughts ??

  8. I tried nearly anything from capacitor to resistor from gnd to vin from gnd to trigger pin...Different power supplies an so on... As soon as i put the sensor in the kitchen it always detects motion without a human oder animal in range - Kitchen is the only room with a good distance to anything else and where the wifi is at good strength.

    If i use that sensor on pc with seriel monitor on and dont move, it works, just in the kitchen it triggers a lot of false alarms.

    My suggestion - does the fridge/freezer interfer with the radar - or does the microwaves detect parts of the running fridge/freezer? Last option is to unplug the fridge/freezer... i dont want to do this yet ... 🙂

    regards,
    andreas

Leave a Reply

Your email address will not be published. Required fields are marked *