icon

Human presence detection using 24GHz mm wave sensor

DFRobot's 24GHz mm wave sensor offers several advantages over traditional PIR (Passive Infrared) sensors, making it a compelling choice for various applications. One significant advantage of the 24GHz mm wave sensor is its superior detection accuracy. Unlike PIR sensors that rely on detecting changes in infrared radiation, mm wave sensors use radio waves to detect movement. This allows for more precise detection, even in challenging environments with varying temperatures or lighting conditions. The mm wave sensor can accurately detect the presence and movement of objects, making it ideal for security systems, automation, and robotics.

 

Despite its advantages, the 24GHz mm wave sensor also has some disadvantages. One notable drawback is its higher cost compared to PIR sensors. The advanced technology and improved performance of the mm wave sensor contribute to its higher price point, which may make it less accessible for budget-sensitive projects.

 

On the other hand, PIR sensors have been widely used for motion detection due to their low cost and simplicity. They are reliable in detecting human-sized infrared signatures within a limited range, making them suitable for many basic motion detection applications.

 

In summary, the choice between DFRobot's 24GHz mm wave sensor and a PIR sensor depends on the specific requirements of the application. If high accuracy and long-range detection are crucial, the mm wave sensor is the preferred choice, despite its higher cost. However, for simple motion detection within a limited range and cost-sensitive projects, a PIR sensor may be more suitable.

 

For our project we are using following placement of the sensor, these placements are very well explained on the wiki page of the product here

 

 

 

 




Explanation of the project:
When the sensor detects any movement it will turn on the LED connected on Pin 13 else LED connected on Pin 12 will remain turn on. And also, out of the two LEDs only one will turn on at a time demonstrating the presence or the absence of the movement. This sensor can detect a movement upto 9m and the delay between each reading is 2-4 seconds. So, it's not that fast as you might think but yes it works!
 

 

 

DISCLAIMER:
A few of the images used in this article are the courtesy of DF Robot only and we have used them for the reference only.

HARDWARE LIST
1 Arduino Nano
1 24 GHz mm Wave Radar
1 Breadboard
1 Jumper Wires
2 LEDs
STEP 1
Buy all the required hardware
STEP 2
Connect all the sensor with Arduino UNO or NANO as per the diagram. After this connect a red LED on pin 13 and green LED on pin 12 with a suitable resistor
STEP 3
Connect your board to your PC and copy paste the below code. Select the correct board and port, hit upload
CODE
/*!
   @file DFRobot_mmWave_Radar.ino
   @ Read whether there is people or object moving in the detection range of the sensor. 
   @ The sensor detection range and output delay time can be configured. Also you can restore the sensor to factory default settings. 
   @n Experimental phenomenon: When the sensor starts successfully, 0 or 1 will be printed on the serial monitor. 
   @ 0 means that there is no human or object moving in sensing area, 1 means the oppposite. 
   @copyright   Copyright (c) 2010 DFRobot Co.Ltd (http://www.dfrobot.com)
   @licence     The MIT License (MIT)
   @author [huyujie]([email protected])
   @version  V1.0
   @date  2020-3-25
   @https://github.com/DFRobot
*/

/*
The below code is electrified with ❤️ by Electroboffin on 3 June 2023
The modification allows the user to add 2 led. One LED on pin 12 and other on pin 13 of Arduino boards. The LED connected to pin 12 will turn on if the sensor detects any movement and the LED on pin 13 will turn on if no one is detected
Find out more about me (Electroboffin): https://links.electroboffin.com
  
  */


#include <SoftwareSerial.h>
#include "DFRobot_mmWave_Radar.h"

SoftwareSerial mySerial(3, 2);
DFRobot_mmWave_Radar sensor(&mySerial);

int ledPin = 13;
int ledPin2 = 12;

void setup()
{
  Serial.begin(115200);
  mySerial.begin(115200);
  pinMode(ledPin, OUTPUT);
  pinMode(ledPin2, OUTPUT);

  sensor.factoryReset();    //Restore to the factory settings 
  sensor.DetRangeCfg(0, 9);    //The detection range is as far as 9m
  sensor.OutputLatency(0,0);
}

void loop()
{
  int val = sensor.readPresenceDetection();
  digitalWrite(ledPin2, val);
  digitalWrite(ledPin, !val);
  Serial.println(val);
}
STEP 4
Boom! It should now be working. Have fun with it!!

RESULTS:

 

 

When movement is detected:

 

When no movement is detected:

License
All Rights
Reserved
licensBg
0