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.

Facebooktwitterpinterestlinkedin

36 thoughts on “Microwave for the Weekend

  1. It’s interesting that the ESP8266/32 wifi modules are setting these off. For reference I have 16 (yes Sixteen) of these inside the metal case of a 2U x86 server, and have been logging for 5 months now and have ZERO false triggers on any of the modules. I tried it as an experiment for a highly secure tamper sensor, rather than the useless microswitch intrusion sensor on most PC cases. I thought that they would false alarm constantly from being in close proximity to the main SMPS, and motherboard with all its RF emanations, however they seem to have incredibly good RF immunity to me. I have the power supplies to all of them them smoothed with a single 47uF + 220nF cap across the supply from a USB port – which I’d expect also to be pretty noisy. I was initially thinking I’d have so many for an M of N trigger response with for example 3 of the 16 triggering a zeroisation. The modules are pointed in different directions so they bounce around the internals of the server, however conveniently they do not penetrate out through the cooling holes or through the fan blades, the circa 10 cm wavelength at 3ghz doesn’t seem to go through any hole up to an inch or so wide.

  2. An rcwl and pir detector are used for outside detection of persons. The rcwl and pir are to avoid false triggers. Only if both detectors confirm a movement it’s valid.

    This works like a charm inside my house but outside my house it’s dead…. The rcwl (a Colpit oscillator) does not work anymore or even sometimes starts oscillating (one minute of / on) . I wonder whether someone has seen this issue? ( I live nearby high voltage lines)

  3. 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

    1. I have the same issue as many others have mentioned, false positives. I have tried all the suggestions, capacitors on VCC, signal, added a resistor too on VCC.
      I’ve tried adding a delay in code, but no matter what I try always receive false positives.

      I had the same issue with the PIR sensor HC-SR501 on a similar circuit, but using the capacitors appear to fix it for the HC-SR501. Yet with an AM312 PIR I never receive any false positives whether I use capacitors or not.

      The circuit I’m using does also include a DHT22, and a false positive does happen at the same time its value is being sent via MQTT, but not every single time. So could be related to WiFi interference.

      It’s frustrating because otherwise the microwave sensor is fantastic, going to test it on an Arduino Mini to confirm it’s specifically related to the NodeMCUs I’m using.

      1. Done a little further investigation and built a very simple test with an Arduino Pro Mini, the Microwave sensor and an LED. It appears to not show any false positives at least over a few minutes test, unlike the NodeMCU.

        I moved the Microwave sensor connected to the Arduino close (2″) to a NodeMCU which was running and it started to show false positives. I noticed it was at regular intervals and with the help of a stopwatch it happened every 30 seconds, it would sometimes miss a 30 second false positive and extend to a minute. 30 seconds is the time the NodeMCU is waiting between submitting Temperature, humidity and light readings to MQTT.

        This appears to show the the Microwave sensor itself is affected by the WiFi signals when in close proximity to a ESP8266/NodeMCU. Otherwise how can anyone explain no false recordings from the Arduino Pro Mini circuit unless in close proximity to the NodeMCU. This is really disappointing but I can’t see how I can really fix this and put the microwave sensor in a small enclosure with a NodeMCU.

        I may have to look at using the Microwave sensor without WiFi and send the data using 433Mhz sender.

        Can anyone else confirm my results?

      2. All sounds plausible to me. I put the sensor some distance from the ESP and thinking about it when I put the lot in a small case it did false trigger. I wonder if a foil separator, grounded between the two would help. The more research the better as these things are useless if not reliable.

        1. Foil seperator (grounded) looks like it worked when the Microwave sensor is connected to the Arduino Mini Pro and placed on top of the seperator directly above ESP8266 on a NodeMCU. Although now with testing below I’m not sure.

          A lot further testing with a NodeMCU and the Microwave sensor confirms (to me anyway) that these things are seriously affected by their proximity to the ESP8266 chip. If they are within an inch of the ESP8266 they are constantly set off and the further away you move them the less they are affected until they are far enough way that they become totally stable.

          I tested some simple foil in a plastic bag with ground to the foil, in between the microwave sensor and the ESP8266 and it was still affected. Possibly improved slightly but not reliable, maybe thicker foil or better shielding could help but then you maybe blocking the WiFi from actually reporting to MQTT if your shielding was too good.

          The Microwave sensors I’m using have the reference: XYC-WB-DC.

          I now have a sad face 🙁

          1. The ESP can negate the RCWL-0516 when transmitting,

            so false triggers but not reported via WIFI

            1. Others have mentioned that the ESP8266 WIFI can in fact cause false triggering – best to keep the two at a distance.

              1. Hi Peter,

                How is your system behaving? I am using it with a Wemos Mini, and as with many, I am getting a lot of false triggers.
                I do need to try the 10r – 330uf stuff, but I am just wondering how you’re experience is now? no false triggers at all? what is the distance you have between the two device’s?

                Thanks!

                1. Hi

                  I’ve moved onto laser based proximity detection so can’t really comment. Blog on that coming up soon.

  4. 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 ??

    1. That’s per square cm, keep in mind power dissipates dramatically as you move away from the source. An inch away from the board you’re already at below those levels. Several feet away like normal use of this board you’re at 1% of 1% of those levels.

  5. 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!!

  6. 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

  7. 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

    1. Wi-Fi is near the same frequencies that it’s using to detect presence. Separate them by a few feet or put some layers of tinfoil in-between the sensor and the ESP32 and see what happens. Obviously don’t completely encase either the ESP or the sensor in foil as they’ll stop working. Just some to block interference between the two may help.

  8. 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.

  9. 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

  10. 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.

    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.

Comments are closed.