Interfacing HB100 Doppler Radar with Arduino

I have doubts in the below code which I found on this website HB100 Microwave Motion sensor Interfacing Arduino

The code is:

// connect If pin to 7 pin of Arduino board
#include “FreqPeriod.h”

double lfrq; //LFRQ
long int pp;

void setup() {
Serial.begin(9600);
FreqPeriod::begin();
Serial.println("FreqPeriod Library Teast");
}


void loop() {
pp = FreqPeriod::getPeriod();

if (pp) {
Serial.print ("Period: ");
Serial.print (pp);
Serial.print ("           1/16microsec/ frequency: ");

lfrq = 16000400.0 / pp;

Serial.print (lfrq);
Serial.print ("       Hz ");
Serial.print (lfrq/31.36);
Serial.print (" Mph ");
delay(200);

In this code can anyone say what is "lfrq" and why we are using the number 16000400.0 to find it and what actually is that formula we are using to get the what is it so called as lfrq.

"local frequency" "low frequency"?

The processor clock speed.

I don't know why they put it in as a magic number, and not a constant though.

I did a quick cross-reading of the article you linked to

Well if an object is moving the frequency of the electromagnetic waves reflected from the moving object is changed a little bit.

The articel says:
Frequency of Doppler shift is proportional to velocity of motion. Typical human walking generates Doppler shift below 100 Hz.

This video seems to explain it pretty good

The number "16000400.0 " looks like related to the clockfrequency of the microcontroller which is 16 MHz

The electromagnetic frequency of the sensor is an ultrahigh frequency of 10500 MHz
about "lfrq" my guessing is: low-frequency = the lower frequency which is called the doppler-shift-frequency

pp seems to be the period of the doppler-shift-frequency

best regards Stefan

Besides the software you will need to build a high gain amplifier to make it work.
My first attempt was to build below amplifier from antique stuff out of the analog components bin, but that did pick up some noise.
HB100_radar_with_2x8x8_matrixdisplay.pdf (165.8 KB)

The second attempt worked much better and provided me with a wireless radar speed meter.

1 Like

can we have the exact code for connecting the HB100 sensor with the Arduino UNO please.

Hi @kaarthi_1337

welcome to the arduino-forum.

Your question sounds very egoistic and very demanding.
The Arduino-Forum is no command and get for free shop!

It does not help do add the word "please" at the end of such a sentence.
From your name I assume that english is not your native language.
So maybe you have written this sentence because you didn't know more words.
Still even if this is the case it sounds very egoistic and very demanding.

If your english is limited use google-translate.
If you think about gogle-translate

"I don't need google-translate!"

You are of course completely free to experience that you are only really helped if you contribute your own work.

Read this. If you follow these rules you will get good and helpful answers

6 posts were split to a new topic: HB100-doppler-radar-with-arduino

maybe he'd share if you did. right? or contribute? or learn something thanks to you.

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.