See Through with C1001 mmWave Human Detection Sensor and ESP32
Table of Contents
See Through with C1001 mmWave Sensor:
See Through with C1001 mmWave Human Detection Sensor and ESP32- Is the C1001 mmWave Human Detection Sensor really a game changer? To find out, I am going to perform 7 tests, including a false triggering test, a vibration test, and testing it with different thin and thick plastic and wooden sheets. We will also see if it can detect humans on the other side of a wall. And guess what, we will perform all these tests on the Blynk IoT application. So, along with the tests you are also going to learn how to use the mmWave human detection sensor with an IoT platform.
These days, the C1001 mmWave sensor is getting a lot of attention worldwide. In just 4 days, my previous video on the C1001 mmWave sensor gained over 52,000 views. Because this sensor is different from other human presence detection sensors because it can accurately detect if someone is lying down, it can perform precise human life detection, it can measure how long a person stays in one place, it can report if someone has fallen, it can judge their sleep state, breathing, and heart rate based on body movement during sleep, and it can even detect if someone is completely still. I have already shown all of this in a practical demonstration. So, for the technical specifications of this sensor and how to operate it in different modes, you can watch my previous video or you can read the article.
Some people asked me if this sensor can detect the presence of static and active humans through walls and other materials. Another guy asked me if we can connect it to an IoT cloud platform for security purposes. So in today’s article, we will cover both of these topics. So, without any further delay, let’s get started!
Amazon Links:
ESP32 WiFi + Bluetooth Module (Recommended)
C1001 mmWave Human Detection Sensor
C1001 mmWave Official Product Page
*Disclosure: These are affiliate links. As an Amazon Associate I earn from qualifying purchases.
C1001 mmWave Sensor with ESP32:
If your goal is only to implement security, then you do not need to use this relay. But if you also want to automatically control the light in that area along with security, then you can use this relay. Again, be very careful with safety measures. When the 110/220V AC supply is connected, do not touch the relay contacts, as it can be extremely dangerous.
This time, we won’t be monitoring on a laptop; instead, we will be using the Blynk application on a cell phone for monitoring. So, let’s quickly create a dashboard on the Blynk IoT Cloud.
Blynk Web Dashboard Setup for the C1001 mmWave Sensor:
Login into your Blynk account and click on the New Template.
- Write the Template Name.
- Select ESP32 as the Hardware type.
- Set connection type to WiFi and then click on the Done button.
Now, if you want to make any changes; you can simply click on the Configure template.
In my case everything looks good so I am going to continue with the same hardware setup.
Next we can click on the “Set Up Datastreams”.
Click on the New Datastream and select Virtual Pin.
Write a meaningful name; for this particular project you can leave PIN, DATA TYPE, MINIMUM, AND MAXIMUM values to their default values. 0 means the sensor has not detected anyone and 1 means human presence.
Finally, you can click on the Create button.
Our Datastream is ready, you can also create Datastreams for monitoring if the detected person is still or active. But for this particular project, I think its not necessary, as I only want to detect the human presence and perform other tests.
Anyway, once the Datastream is created. Then click on the Devices.
Click on New Device.
Click on from template and form the Template drop down menu select the C1001 Security System and then click on the create button
Copy these Credentials because without these you won’t be able to connect your ESP32 to the Blynk IoT platform. Open the program and paste it at the top of the program.
Next, click on Edit Dashboard and from the Widget Box add an LED to the Dashboard and assign the corresponding Datastream. You can also set the LED color and set its name as per your needs.
Our Dashboard is ready. If you want to use a notification widget or any other widget then you will have to upgrade your Plan. Anyway, the Dashboard is ready and now let’s start with the Blynk IoT Application setup on the Smartphone.
C1001 mmWave Blynk Security Application:
Setting up the Blynk IoT application in the cell phone is quite easy as we have already created the Datastream, now we only need to add the LED and assign it the corresponding Datastream. Just make sure you are in the developers mode. If it doesn’t make any sense to you, then you can watch the video tutorial given at the end of this article.
Our application is ready and now let’s go ahead and take a look at the program.
C1001 mmWave Human Detection Sensor ESP32 Programming:
ESP32 Board installation:
First of all, if this is your first time using the ESP32 WiFi + Bluetooth module then you will also need to install the ESP32 board in the Arduino IDE. For this you can read my getting started article on the ESP32 WiFi + Bluetooth Module.
DFRobot_HumanDetection Library:
Installation of this library “DFRobot_HumanDetection” I have already explained in the previous article.
In order to use your ESP32 or ESP8266 with the Blynk IoT Platform; you will also need to install the entire Blynk library package. While your Arduino IDE is open, go to the Sketch Menu, then to Include Library, and click on the Manage Libraries.
Type Blynk in the search box.
You can see I have also installed this library.
Don’t forget to change the GPRS Credentials in the program “SSID and Password”.
Rest of the code is exactly the same as the previous code, except the Blynk.virtualWrite() functions, because using the Virtual pin I am sending information about if someone is present or not.
C1001 mmWave IoT ESP32 Code:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 |
#define BLYNK_PRINT Serial #define BLYNK_TEMPLATE_ID "TMPL6dVmR33UG" #define BLYNK_TEMPLATE_NAME "C1001 Security System" #define BLYNK_AUTH_TOKEN "VzWGyEvZ_VGVIhI2hu1sNXP-y3futTkS" #define BLYNK_FIRMWARE_VERSION "0.1.0" #include "DFRobot_HumanDetection.h" #include <WiFi.h> #include <WiFiClient.h> #include <BlynkSimpleEsp32.h> #include <HardwareSerial.h> DFRobot_HumanDetection hu(&Serial1); // gpio pins 16 and 17 int relay = 13; char auth[] = BLYNK_AUTH_TOKEN; // Your WiFi credentials. // Set password to "" for open networks. char ssid[] = "Mycell"; char pass[] = "lipo1234"; // Array to store incoming serial data unsigned char data_buffer[4] = {0}; void setup() { Serial.begin(115200); Serial1.begin(115200, SERIAL_8N1, 16, 17); pinMode(relay, OUTPUT); myInitialization(); Blynk.begin(auth, ssid, pass); } void loop() { Blynk.run(); Serial.print("Existing information:"); switch (hu.smHumanData(hu.eHumanPresence)) { case 0: Serial.println("No one is present"); digitalWrite(relay, LOW); Blynk.virtualWrite(V0, 0); break; case 1: Serial.println("Someone is present"); digitalWrite(relay, HIGH); Blynk.virtualWrite(V0, 1); break; default: Serial.println("Read error"); } Serial.print("Motion information:"); switch (hu.smHumanData(hu.eHumanMovement)) { case 0: Serial.println("None"); break; case 1: Serial.println("Still"); break; case 2: Serial.println("Active"); break; default: Serial.println("Read error"); } Serial.print("Body movement parameters: "); Serial.print( hu.smHumanData(hu.eHumanMovingRange)); Serial.println(); delay(1000); } void myInitialization() { Serial.println("Start initialization"); while (hu.begin() != 0) { Serial.println("init error!!!"); delay(1000); } Serial.println("Initialization successful"); Serial.println("Start switching work mode"); while (hu.configWorkMode(hu.eSleepMode) != 0) { Serial.println("error!!!"); delay(1000); } Serial.println("Work mode switch successful"); hu.configLEDLight(hu.eHPLed, 1); // Set HP LED switch, it will not light up even if the sensor detects a person present when set to 0. hu.sensorRet(); // Module reset, must perform sensorRet after setting data, otherwise the sensor may not be usable. } |
Now, to upload the program simply select the ESP32 Dev Module… then select the correct communication port… and finally click on the upload button.
C1001 mmWave Sensor Tests:
Test #1:
If you focus this sensor on a running ceiling fan, it will cause false triggering. As you can see, I am standing far from the sensor, but on the mobile, it shows Human presence because the ceiling fan is ON, and the sensor is right below it. I am sure you won’t be using the sensor like this. Anyway, when installing this sensor on a wall, tilt it slightly downward so that the ceiling fan doesn’t enter the sensor’s detection area.
Let’s turn OFF the fan and see if the status changes.
After turning off the fan, you can see that the false triggering has stopped. Now, I will go near the sensor and let’s see if it can detect me.
This is amazing. So, if you want the C1001 mmWave Sensor to avoid false triggering, don’t use it in front of a fan and other moving objects.
Test #2:
In Test #2, we will check if the mmWave sensor is affected by vibrations. I am going to slightly shake the table.
As you can see, the cell phone is showing human presence even though I am not in the detection area. So, this test shows that you should not use this sensor in places with vibrations or as a handheld human detector. To avoid false triggers, you need to use the C1001 mmWave Sensor in a place without vibrations. You can use it as a portable security system, just don’t use it in areas with vibrations.
Test #3:
I am really excited about this test because this time, I am going to put the C1001 mmWave Sensor inside a box, and we will see if it can detect me from inside the box. This test is for those who asked me if the mmWave sensor can penetrate materials or not. If it can successfully detect me, then we can hide this sensor anywhere and monitor people’s presence.
So, let’s put the sensor inside the box and I will make sure to properly close the box.
On the cell phone, it shows no human presence. I cannot wait any longer; I am going to move closer to the sensor now.
O my God, the sensor detected me even from inside the box! This mmWave Sensor is truly a game changer. I am not going to stop here.
Test #4:
In Test #4, I am going to place this plastic Range Rover model on top of the sensor.
There is a good distance between the bottom and top. If the mmWave sensor can penetrate this, then it can easily penetrate acrylic sheets. So, let’s place the Range Rover on top of the sensor.
On the cell phone, you can see no human presence.
Now I’m going to move closer to the sensor.
Oh my goodness, it also passed Test #4! Now I can even use this sensor inside it, and no one will ever know about my security system. Let’s test it with a hard material now.
Test #5:
For Test #5, I am going to use this thin hard wooden sheet. If the sensor can penetrate this, then I will try a thick wooden sheet as well.
So, let’s place the sheet.
On the cell phone, you can see the LED is OFF, which means no human presence. Now I am moving closer to the sensor.
This is simply mind-blowing; it detected me from quite a distance.
Test #6:
For Test #6, I am going to use this thick wooden block. If the mmWave sensor still detects me, then I will test it with a wall.
So, let’s place it on top of the sensor and see.
I tried a lot, but the sensor couldn’t detect me, which means it won’t detect humans behind a wall either.
If you want to detect moving humans and objects through thick wooden sheets and walls, I recommend using the Microwave Sensor V2.0 because it can penetrate thick wooden sheets and also detect moving humans and objects on the other side of walls.
Personally, I liked the C1001 mmWave sensor more because it has a very long range, it’s highly accurate, and it supports different modes of human detection. So, that’s all for now.
Support me on Patreon for more videos and articles.