Investigating a RCWL 9196 / RCWL-0516 “Radar” motion detector module

posted in: Android | 138

A new type of “Radar” motion sensor has been getting a lot of attention in the last couple of months, but no one seemed to know how they worked, so I decided to buy a few of these very cheap devices (sub $1) and investigate possible methods of operation.

The boards I bought use the RCWL 9196, but appear to have identical functionality to those with the RWCL-0516 chip on them

This github site https://github.com/jdesbonnet/RCWL-0516/ contains loads of useful information on these boards, and there is also an excellent video by Andreas Spiess on YouTube https://www.youtube.com/watch?v=9WiJJgIi3W0

Where the properties of these devices was explored.

I hope to have taken this at least one step forward with my tests.

The main difference in my approach is that I have connected a wire from the analogue signal output on the only IC on the board, into an analogue input on a STM32F103C8 (aka Blue Pill) board.

The pin I connected to is Pin 12 on U1, (RCWL 9196 and is the output of the 2nd OpAmp in that chip).

(Schematic from Joe Desonnet’s github account)

 

 

My RCWL 9196 board is not exactly the same as this, but the pinout of the IC is the same.

Also the RCWL 9196 is almost identical to the BIS0001

http://www.ladyada.net/media/sensors/BISS0001.pdf

Where pin 12 is labelled as 2Out

 

 

I then wrote a very simple sketch in the Arduino IDE to print both the analogue signal from 2Out and also the normal digital output from the board

 

void setup() {
pinMode(PA0,INPUT);
pinMode(PA1,INPUT);
}
void loop() {
Serial.print(“0,”);
Serial.print(analogRead(PA0));
Serial.print(“,”);
Serial.print(analogRead(PA1)+100);
Serial.println(“,4500”);
delay(10);
}

BTW. The reason I’m writing values of 0 at the beginning of the line of output and 4500 is because the Arduino IDE “Plotter” feature is auto ranging, and if I don’t include a lower an upper bound, the vertical scale constantly changes

Looking at the output when nothing is moving I see this plot

Green is the digital output (in this case its LOW / OFF), and the Red trace is the analog signal, which is close to half the 3.3V Vdd voltage supplied to the board.

Note. The STM32F103C8 has an anlogue input range of 0 to 4096 (12 bit)

 

If I start to wave my hand, starting with a small movement and then increasing, I see this plot.

 

As you can see the hand movement causes an immediate effect on the output of the second OpAmp, but the value has to go above (or below) a threshold before the digital output triggers

 

In this next plot. I was walking towards the sensor, and then stopped.

 

As you can see the digital output holds for around 2 seconds after the end of the input fluctuations.

 

The more interesting thing about this plot are the peaks and troughs at the start where I was walking towards the sensor.

I thought this could be because its sensing the movement of my legs, so I devised a better test where I stood on a chair and dropped an object from the ceiling, and observed the results.

 

I tried a variety of objects, and the best performing object that mimicked the properties of a person moving, turned out to be a damp sponge.

I tried a dry sponge, but it had no effect on the sensor whatsoever, but as soon as I got it wet, it was immediately detected.

 

 

In this plot the sponge is falling about 1m horizontally from the sensor, which is resting on a table about 1m from the ground.

As you can see, there are still multiple peaks and troughs in the output signal.

I know that there was some speculation that these devices work by using the Doppler effect,but this does not appear to be validated my the tests I have done.

So my theory is that the peaks and troughs are caused by reflected signals from objects, interfering with the oscillator / transmitter.
When I say interfering, I mean of wave propagation, where the reflected wave can be in phase with the oscillator or out of phase, resulting in the oscillator drawing more or less current.

https://en.wikipedia.org/wiki/Interference_(wave_propagation)

From Joe Desbonnet’s github repo,he observed that the oscillation frequency is around 3.1GHz with his module. So assuming my module is similar, then the wavelength of 3.1GHz is around 10cm.

However in my tests, I am not sure the peaks and troughs match exactly with that frequency, and the effect I see if more consistent with perhaps twice that frequency.

 

Doing some tests moving a piece of aluminium foil up and down, approximately 30cm, to 5 cm above the sensor observe these results when moving slowly

 

 

And moving quickly

 

 

What is fairly clear is that the interference is not from a single path, but rather that the aluminium foil (or the damp sponge), is reflecting signals directly from the device, but is also going to be reflecting, some reflections back to the device.

So its a complex pattern of primary and secondary signals, with the strongest effect most likely to be the primary signal straight from the device (transmitter)

Also just to complicate matters, the OpAmp IC is configured so that the output is always trying to return to a steady state.

This can be seen when the device first turns on, and the analogue output initially is at its maximum, and takes around 10 seconds to stabilise to Vdd /2

 

Looking at the schematic and also measuring the voltage from the RF oscillator / transmitter, using an oscilloscope. The oscillator output voltage, rises to around 0.4V very quickly.

However OpAmp 1, in the RCWL9196 is configured as a high gain amplifier (and filter), whose non-inverting input will be initially 0V.

The inverting input is fed from the output of the OpAmp via a resistor and capacitor network, and charges C7 via R6, and the RC network of R4 in parallel with C4

I don’t know if the resistor values on my board are identical to the schematic, but a rough calculation on the RC charge time of the inverting input would be 22uF * 1M = 22 seconds.

But thats the time to get to Vdd not to 0.4V, so I think its highly likely that the 11 seconds startup time, is the time taken to charge C7 to 0.4V.

I observed the fluctuations of the input voltage from the oscillator using my scope, but the change was minimal; at around 4mV, and I was only able to measure this using capacitive coupling on the scope.

So if C7 can charge from 0V to 0.4V in around 10 seconds, then it would compensate for a change in input from the osc (of 0.004V) in 1/100th of 10 seconds, i.e 1/10th Sec (100mS)

This effect is also observable in practice, by moving an object towards the sensor and then holding it. As you normally see a peak or a tough, but very quickly the signal is pulled back to its steady state.

 

I did attempt to increase the value of C7 from 22uF (226) a higher value, in the hope that I could make a much larger time constant, but I damaged the board somehow, whilst trying to do this, so I do not have any results for that test.

BTW. I have 2 boards, but I don’t want to modify the second one in case I damage that one as well.

 

So to sum up…

My hypotheses, is that these devices are a oscillator / transmitter, and that the detection method is by wave propagation interference.

This is consistent with many of the results I observed.

  1. Objects moving towards (or away) from the sensor, produce peaks and toughs rather than a steady state offset; which would be caused by the Doppler effect
  2. The peaks and troughs are complex, as the interference is generated by reflections of reflections.
  3. Waving a length of wire, (which would act as an inductor), near the sensor, produces little or no variation in the output
  4. As the unit has a range of around 4 or 5m, and detection does not seem to diminish strongly with increasing distance, it seems unlikely that the effect is being caused by capacitive coupling between the observed object and the oscillator (and its surroundings_

 

And where does this leave us…

Well, at the moment, I don’t see a use for these devices apart from their intended application of motion sensing.

I think that using the analogue output from pin 12, is beneficial, as it can be used to get some indication of the scale of the detection, and would allow the trigger level, and hold time etc, to be controlled in the application (e.g. Arduino sketch).

 

I think if a method was devised to be able to observe the output from the oscillator, without the current system that always returns the output to a mid point steady state, even if the oscillator is not in that state; that perhaps the device could be used more easily to perhaps determine the speed of an object. By determining the time difference between each peak.

However even with the necessary hardware modifications to facilitate this, there would still be the problem of reflections of reflections; which would cause the data to be difficult if not impossible to analyse

 

 

138 Responses

  1. jpt
    |

    Mostly we’re just too tired of explaining this.

  2. Roger Clark
    |

    True

    I’m not wasting any more time on this.

    I think I’ll just delete any other comments where people have not done their own independent research etc, and show that the frequency produced does correspond to the Doppler shift freq etc, because we have both done test which show that the majority of the output is caused by interference patterns cause by multi path reflections.

  3. Siegfried Bender
    |

    “1. Objects moving towards (or away) from the sensor, produce peaks and toughs rather than a steady state offset; which would be caused by the Doppler effect”
    I think thats a misunderstanding. Doppler doesn’t produce a steady state signal. The difference between the sent out sinus and the received (frequency-shifted) sinus is still a sinus.
    But anyway your investigation was interesting for me. I don’t think its a waste of time. Applications with radar doppler are sometimes a bit different from pyros. I for example had implemented a motion detetor outside the house and had a problem with insects. When they crawl over your sensor, they induce a big signal (r^4-situation).
    Have a nice day

  4. Roger Clark
    |

    I think using the sensor to measure things like insects is very interesting.

    I presume that the sensor would have problems if anything else except the insect is moving, because I did some testing and the sensor detects most objects.

  5. Siegfried Bender
    |

    It was vice versa: I wanted to detect “anything else” but the insects ruined my day.

  6. Roger Clark
    |

    (LOL)

  7. Derek Abbey
    |

    The RCWL-9196 is clearly stated as being a microwave intrusion detector, which uses the Doppler effect to trigger an alarm. It emits a microwave signal, and any disturbance to the returning signal triggers the output. Why all the tests to prove what the unit is intended for?

  8. Roger Clark
    |

    The tests, done by various people, prove its method of operation is not Doppler.
    And they also prove this module is probably only useful for its stated purpose (mainly because it does not use Doppler principal).

    People have used other motion sensors, which do useuse the Doppler principal, for other uses, e.g. vehicle speed detection, but this module does not seem to have other uses.

  9. Serjio
    |

    There is absolutely nothing about the Doppler effect, and this study illustrates this perfectly. It will be difficult to market this device if you tell people that this sensor is not as simple as a radiofrequency radiaте of a high frequency range!

  10. Gary D Rubin
    |

    Thank you Roger for again digging DEEPER into the questions I hypothesize when looking at a new technology, and you even soldered an analog line to look at the signal. I have come to learn that if I think of it, you have probably already did it. And this is yet another case of that. THANKS!!!!

    I actually came here to ask how you plot and show those graphs, what database engine you use (sqlite3?) and how you serve it (flask?) but you get so many questions already I’m sure. I’m on a research path and will figure it out so no need to reply. Just wanted to say I appreciate your contributions for sure and thank you for this offering you gave!!

    In case you are curious, I used a python script to log two sensor trips to test false positives and accuracy based on area activity (this sensor and a PIR) over time, to a sqlite database on my home linux embedded device server. I used websockets and it works well. I’m just at the point where I need to show that data on the served website from my ESP8266, but actually, now that I think about it, I really do not need to do that since I can just serve it from my linux server. I’ll figure it out, there is so much info out there already!

    TAKE CARE! and thanks again!!

  11. Roger Clark
    |

    The graphs are just plotted inside the Arduino IDE, its a standard feature. I just sampled using the A2D converter on a STM32 and printed the value as a number.

    I can’t remember what delay I used between samples, possibly 1 millisecond.

  12. Gary D Rubin
    |

    I was totally unaware of that feature of the Arduino IDE. Must be serial plotter. WOW, never knew it was there! And I am embarrassed by that. Thanks for elaborating!

  13. Roger Clark
    |

    The serial plotter is a handy feature. Its only annoying property is that it auto-ranges, and sometimes it would be better if the range could be specified

  14. Gustavo Ferrero
    |

    Hi, I could’nt find any reference co C-TM capacitor values in order to extend the trigger time, do you have experience on this? brgds

  15. Pete
    |

    Hi Gustavo,
    The “C-TM” timing is proportional to the capacitor or resistor values. So, (for example) doubling the capacitor value will double the delay time. You can find details online in the datasheet for the “BISS0001” chip, which is basically the same chip.

    Pete

  16. telcomcast
    |

    Hi ! Does anyone tested low power solution by powering the module on cycle ?

  17. Anonymous
    |

    molto interessante

  18. Sung Gi, Kim
    |

    How are you?
    rcwl-9196 Microwave ProductionModule.

    I’d like to have the field strength lower than 35uV/m.
    What should I do?

  19. fangis
    |

    Hello Roger

    Thanks for your article, nice graphs and interesting content.
    I am too interested on this somewhat obscure pin 12. I was only able to shortly connect to it using a wire and I could read some values in a program similar to the one you wrote. Here in a wemos d1 mini clone I was getting values around 500 and the scale is from 0 to 1024.

    My interest on pin 12 is that I think one can reduce the threshold and make the sensor more sensitive. Mine detects motion in a range of about 5m , mostly it detects larger motions, but truly I would like to detect even the smaller ones, I also want to detect motion through walls – it seems my rcwl is not so good at that.

    But the pin is small and difficult to access! How did you even manage to solder to such a small pin? In the picture I can’t see how exactly it looks. Anyway I have not soldered before and would try some other solution if available, maybe adhesive tape, I don’t know.

    So please let me know if you have any advice about this!

  20. Roger Clark
    |

    I have been soldering for may years. I have some cheap 3 x magnification “reading glasses” (non prescription), which I use when soldering to tiny IC’s. I use “wire wrap” wire which is very thin. I also steady my hand against the PCB when soldering, so I do not shake.

  21. Christoph Blank
    |

    Do you think this module is suitable for counting cars on a street (with no other traffic)?
    And e.g. mount two of them in opposite direction, maybe 45 degrees to the street (as a “V”), combine both outputs, do statistical learning and detect if it is either a truck or a normal car? I assume it would lead to different signatures…

  22. Roger Clark
    |

    Making these devices directional is a bit difficult. Some people have done it, but you may need to make a large metal enclosure with a wedge shaped opening.

    If you read the analog voltage, like I did, from one of the pins, and sample it many times a second, I think you could determine which direction a vehicle is passing and perhaps how long it is.
    However, if you are on a busy street you may have difficulties analysing the data.

    The range is only around 5m, which may also be a problem for your application.

  23. Anonymous
    |

    helo sir???? can this rcwl measures the distance or range???please help me
    ????????

  24. Roger Clark
    |

    Its a “Motion detector” it does not measure distance / range, its hardware is incapable of doing anything other than measuring whether something in its range has moved.
    Its not possible to determine direction or movement or amount of moment, only that there has been movement.

  25. John Jennings
    |

    Roger, great article.
    I need to run one of these off a 3.7v Li-Ion battery, which is just below the required 4v required per spec.
    Would it be possible do you know to supply 3.7v direct to any other part of the circuit bypassing the regulator (which I can’t recognize on there either) ?
    I know the Li_ion will charge to well over 4v but I want to run at its specification value of 3.7 if possible.

  26. John Jennings
    |

    My question assumes that 3.7v will work ok for the (3.3v)n chip- but maybe not ?

  27. Christoph Blank
    |

    Thanks for the input! The HB 100 seems to be an interesting solution as well, maybe it’s the better choice for vehicle counting/directional detection.

  28. Pete
    |

    John: I believe that running the chip directly from a battery is likely to work fine. But be aware that the microwave oscillator (the transistor) may or may not work at all at a different voltage. If it does work, the frequency will be very sensitive to the voltage. So, anything ‘quantitative’ requires a fixed and regulated voltage. Also, it’s possible that a higher voltage will fry the transistor (not sure, but it’s a risk, because these cheap uWave transistors are sensitive).

    Christoph: Yes, an HB100 is a much more ‘precise’ device, and with a higher RF power output. But be aware that it does NOT have a built-in preamp for the difference frequency output signal, so you would need to add your own amp to do anything useful.

    Pete

  29. Gijs Noorlander
    |

    I just want to say thanks for this great tip of using pin 12 on the IC as analog value.
    I ran a test setup on an ATmega 32u4 unit and it was of great help here in testing.
    Also I never used the Arduino IDE serial plotter before and it is a great tool for quick testing.

  30. Edson
    |

    Do you think it could be used to count stuff passing in a tube or detect and estimate flow of liquid?

  31. Roger Clark
    |

    I suspect it could detect individual objects passing inside a tube, as long as the tube was not made of metal, or another material which blocked the radio waves.

    I don’t think it could detect flow, unless the speed of flow affected the density of the liquid.

  32. Gilbert
    |

    Hi Roger. I’m considering to use this sensor to control the lights in my carport. PIR sensor is no good as those tend to produce false triggers when lights are shining on them (e.g. a car passing in the street). But I’d like to block the rear side of the radar sensor to avoid a trigger when I’m walking by the back-side of the sensor. Can this be accomplished? Add a copper plate to the back maybe (like a piece of unused PCB)?

  33. Pete
    |

    Yes, shielding with any conductive material will work – copper, aluminum, etc. Be sure that the shield does not move, relative to the sensor, else you will get a false trigger.
    Pete

  34. Volodymyr Shvedchenko
    |

    BTW, by changing R9 (I have replaced it by potentiometer with many rotations) you can manage detection range widely (from few centimeters to default 7-8 meters). I have also foound that two detectors interference each other. 🙁 I have tried to make motion detection in different sides of stairs (one sensor in first step and another one in last). Detection of place of motion very unstable and I have preferred to disable one of sensor. 🙁

  35. Guillermo Fabián Enriques
    |

    Según mis pruebas no encuentro nada que me dé certeza de estar sobre un efecto doppler,
    Si estoy encontrando algunas aplicaciones de la etapa analógica , ej:

    * Estudios de agricultura de precisión.
    * Las características de consumo bajo peso reducido es ideal para ser utilizado en Drones,
    * Se complementa perfectamente bien con tecnología LIDAR, Ultra Sonido y Imagen multilaterales.
    * Su costo tan bajo que permite tener un array de ellos.
    * Mucho más

    nota: NO utilizo la etapa digital del modulo en la mayoría de los casos
    a) Recomiendo mucho más trabajar con las dos salidas del los AmplOp 1-2 para el CAD y hacer modificaciones si lo requieren.
    b) Tener en cuenta que se acoplan mediante un Capacitor, por lo que en el segundo AmplOp está amplificando las variaciones del primero.
    c) Con ellas dos es muy viable entrenar una neurona muy simple.

    Si hace un array con unas 10 a 16 unidades conectadas a un Arduino Mega, seguramente se pueden sorprender,. aunque con tres unidades ya es sorprendente las conclusiones que podemos sacar.

    Recomiendo que estén separados entre si como mínimo 10 cm. y hasta pueden haber 1m o 2m según lo que se quiera ver.
    Por ej en un medio urbano como ser en una galería se puede discriminar con mucha precisión cuantos personas es posible que estén y donde, aunque le cuesta mucho discriminar una persona obesa de dos abrazadas o un bebe en brazos de su madre.
    pero no hay duda que es mucho mas económico, menor costo de computo y fácil de implementar que un reconocimiento por imagen. Sobre todo respetando ll anonimato de las personas.

    Es recomendable en este caso usar algunos en el piso, formando triángulos y en las paredes a 0.40m y a 1,60m. tambien en formas de triángulos

    Con un poco de AI se logra tener un sistema que comprenda muy bien la dinámica en un Shoping y saber donde la gente se para a ver, que tiempo, si después se disparan compras que se correlaciona con los registros de ventas y los productos en exposición

    -Nos dan mapas de calor de un lugar que hay que saber interpretar.
    -Se puede inferir el volumen o contenido de agua que tiene un cuerpo que esté en el medio de control (humano adulto 75%+/-5%.)
    -Si se conoce el volumen se infiere la humedad del mismo con un error menor al 2% y mejor según el diseño de método de medición ej en cereales y granos. en Silo o laboratorio y el secado por medición diferencial continua
    -Se puede determinar si es altamente probable que el objeto sea metálico. ej detección de todo tipo de metal dentro de los alimentos
    -es fácil discriminar entre metal y cuerpos biológicos. unos se comportan como espejos otros como cuerpos negros.
    -A menor contenido de humedad los cuerpos inertes son mas traslucidos.
    -Discrimina muy bien la biomasa verde de la seca, asi como el volumen foliar de una planta frutal.

    Nota: ahora trabajo en algunas guías de onda porque es muy ancho el campo de acción y necesito mayor resolución para detectar frutos.

  36. Roger Clark
    |

    I used google translate

    According to my tests I find nothing that gives me the certainty of being on a doppler effect. If I am finding some applications of the analog stage, ex:

    * Precision agriculture studies.
    * The characteristics of consumption under low weight is ideal to be used in Drones,
    * It complements perfectly well with technology to LIDAR, Ultra Sound and Multilateral Image.
    * Its cost so low that it allows to have an array of them.
    * Much more

    note: I do NOT use the digital stage of the module in most cases
    a) I highly recommend working with the two outputs of the AmplOp 1-2 for CAD and making modifications if required.
    b) Take into account that they are coupled through a Capacitor, so in the second AmplOp you are amplifying the variations of the first.
    c) With both of them it is very viable to train a very simple neuron.

    If you make an array with about 10 to 16 drives connected to an Arduino Mega, you can surely be surprised. although with three units it is already surprising the conclusions that we can draw.

    I recommend that they are at least 10 cm apart. and there can even be 1m or 2m depending on what you want to see.
    For example, in an urban environment such as being in a gallery, you can discriminate with great precision how many people you may be and where, although it is very difficult to discriminate between an obese person with two hugs or a baby in the arms of their mother.
    but there is no doubt that it is much cheaper, lower computation cost and easier to implement than image recognition. Especially respecting the anonymity of people.

    It is recommended in this case to use some on the floor, forming triangles and on the walls at 0.40m and 1.60m. also in triangle shapes

    With a little AI, it is possible to have a system that understands the dynamics in a Shoping very well and know where people stop to see, what time, if purchases are triggered afterwards, which correlates with sales records and products on display

    -They give us heat maps of a place that you have to know how to interpret.
    -You can infer the volume or water content of a body that is in the control medium (adult human 75% +/- 5%.) -If the volume is known, its humidity is inferred with an error less than 2% and better according to the design of the measurement method, eg in cereals and grains. in Silo or laboratory and drying by continuous differential measurement -It can be determined if the object is highly probable to be metallic. eg detection of all kinds of metal within food – it is easy to discriminate between metal and biological bodies. some behave like mirrors, others like black bodies.
    -The lower the moisture content, the inert bodies are more translucent.
    -Discriminates very well the green biomass of the dry, as well as the leaf volume of a fruit plant.

    Note: now I work on some waveguides because the field of action is very wide and I need more resolution to detect fruits.

    I agree. Its not Doppler

    I agree, also its good for detecting biomass or similar objects. Its basically detecting water content. It does not detect metal very well.

    I do not know if using multiple devices would give a good result as they are on similar frequencies and may interfere with each other.

  37. Dejan Gjorgjevikj
    |

    Hi,
    regarding the post from Guillermo Fabián Enriques I must say that I am glad that someone else is also trying to find alternate usage of these cheap sensors. Hereby I would like to share the initial research that we have conducted in human activity recognition using machine learning and the analog output obtained from modified microwave (RCWL-0516) and PIR sensors. For anyone interested the hardware used and the findings are published here:
    – Human activity recognition using sensor recordings from passive infrared and microwave radar sensors (http://dejan.gjorgjevikj.com/papers/CIIT_2019_paper_10.pdf)
    – Data Collection Module for Human Activity Recognition (http://dejan.gjorgjevikj.com/papers/ETAI2018-1-1.pdf)

  38. Pete
    |

    Well done Dejan! Note to Roger and others: In section B(2) of Dejan’s second referenced paper, he has correctly described how the sensor’s analog output is a difference frequency, and that difference is defined by the ‘Doppler Effect’.
    Dejan: Have you considered using an FFT algorithm (or similar) to determine the frequency, and thus estimate the *velocity* of movement? This would give you an additional type of data to study. If you do this, consider using a uWave sensor that operates at a higher frequency, which increases the ‘difference frequency’, and it becomes easier to make velocity estimates.

Leave a Reply