2# Range Detector Sensors
Table of Contents
1 Introduction
There are two types of sensors used in range detecting. Ultrasonic sensor HC-SR04 and 60GHz mmWare radar sensor.
The HC-SR04 ultrasonic sensor uses sonar to determine the distance to an object. This sensor reads from 2cm to 400cm (0.8inch to 157inch) with an accuracy of 0.3cm (0.1inches). This is used for near range detection.
60GHz mmWave Sensor - Human Resting Breathing and Heartbeat Module has been updated, adding sleep monitoring function. This can detect range of 2000cm with smart algorithm with human detection.
2 HC-SR04
The HC-SR04 ultrasonic sensor is widely used with Power Supply :+5V DC, the Effectual Angle: <15° and normally Ranging Distance : 2cm – 400 cm/1″ – 13ft
There are arduino library implements the algorithm, so I use MKR wifi 1010 as host MCU for this sensor. Here is the code
#include <afstandssensor.h> AfstandsSensor afstandssensor(7, 6); void setup () { Serial.begin(9600); } void loop () { Serial.println(afstandssensor.afstandCM()); delay(500); }
The distance is output in centimeter
In this project the sensor is used.
3 60GHz mmWare radar sensor
The MR60BHA1 60GHz mmWave Static Breathing and Heartbeat radar module applies FMCW detected theory to implement simultaneous personal breathing rate and heart rate detention in high accuracy, providing a fully total private and secure environment, independently from other noisy influences. It is a standard biotic radar system in consumer electronics, healthcare as well as industrial applications.
Frequency Modulated Continuous Wave (FMCW) Radar is a special type of radar sensor which radiates continuous transmission power like a simple continuous-wave radar. Instead of using the time to measure distance (like TOF), FMCW technology emits a radar signal with a frequency that increases continuously to create a signal sweep. After being reflected by the process media surface, the signal’s echo will be picked up by the antenna. As the emitted signal is constantly varying in frequency, there is a slight difference between the frequencies of the echo and the emitted signals. This difference in frequency is directly proportional to the echo delay, thus allowing the accurate measurement of distances.
Here is arduino code
#include "Arduino.h" #include <60ghzbreathheart.h> //#include <SoftwareSerial.h> // Choose any two pins that can be used with SoftwareSerial to RX & TX //#define RX_Pin A2 //#define TX_Pin A3 //SoftwareSerial mySerial = SoftwareSerial(RX_Pin, TX_Pin); // we'll be using software serial //BreathHeart_60GHz radar = BreathHeart_60GHz(&mySerial); // can also try hardware serial with BreathHeart_60GHz radar = BreathHeart_60GHz(&Serial1); void setup() { // put your setup code here, to run once: Serial.begin(115200); Serial1.begin(115200); // mySerial.begin(115200); while(!Serial); //When the serial port is opened, the program starts to execute. Serial.println("Ready"); } void loop() { // put your main code here, to run repeatedly: radar.HumanExis_Func(); //Human existence information output if(radar.sensor_report != 0x00){ switch(radar.sensor_report){ case NOONE: Serial.println("Nobody here."); Serial.println("----------------------------"); break; case SOMEONE: Serial.println("Someone is here."); Serial.println("----------------------------"); break; case NONEPSE: Serial.println("No human activity messages."); Serial.println("----------------------------"); break; case STATION: Serial.println("Someone stop"); Serial.println("----------------------------"); break; case MOVE: Serial.println("Someone moving"); Serial.println("----------------------------"); break; case BODYVAL: Serial.print("The parameters of human body signs are: "); Serial.println(radar.bodysign_val, DEC); Serial.println("----------------------------"); break; case DISVAL: Serial.print("The sensor judges the distance to the human body to be: "); Serial.print(radar.distance, DEC); Serial.println(" m"); Serial.println("----------------------------"); break; case DIREVAL: Serial.print("The sensor judges the orientation data with the human body as -- x: "); Serial.print(radar.Dir_x); Serial.print(" m, y: "); Serial.print(radar.Dir_y); Serial.print(" m, z: "); Serial.print(radar.Dir_z); Serial.println(" m"); Serial.println("----------------------------"); break; } } delay(200); //Add time delay to avoid program jam }
With the output
The distance to human and angle can be got to get precise position for range detection.
4 Sensor fusion and range detection
Another effort on combining the sensor data to get precise environment sensing capability and deploy AI model to get result is called sensor fusion. It would be interesting to find out how it can work in this project.