ESPHome Auto-Restart Script
Introduction Running various services at home can be a great convenience, but it’s incredibly frustrating when the network goes down and you’re not there to restart everything. I’ve …
I recently bought a tiny 60GHz radar module to use in a project. This is a really neat little board that claims to be able to read breathing and heart rate data from a subject with 90% accuracy.
It’s made by the Chinese firm Seeed Studio but it was in stock at DigiKey and shipped really quickly. It’ll be shipping back just as quickly.
I was pretty inspired by the documentation on the manufacturers’ website - the translation leaves a bit to be desired, but it seems like all the right information is there.
I hooked it up to an Arduino, established a serial connection at 9600 bps, and got absolutely nothing. It sounded like it was working, I could almost hear high-pitched chirps coming from the board, but it didn’t produce any output.
I attached my Saleae Logic Analyzer and took a quick look - it was transmitting but at 115kbps and not 9600. A quick fix and I could start to see some kind of useful data coming in.
I did discover the manufacturer has a github library that can sort of decode the messages.
I made some simple modifications to make this work with the ESP32 (using Serial2 instead of Serial1). Here’s the updated header in case someone has a similar question, but I’m not going to contribute back the rest of my changes because the board is practically unusable.
#include "Arduino.h"
#include "60ghzbreathheart.h"
#include <HardwareSerial.h>
#define RXD2 16
#define TXD2 17
void BreathHeart_60GHz::SerialInit(){
Serial2.begin(115200, SERIAL_8N1, RXD2, TXD2);
}
// Receive data and process
void BreathHeart_60GHz::recvRadarBytes(){
static boolean recvInProgress = false;
static byte ndx = 0;
byte startMarker = MESSAGE_HEAD; //Header frame
byte endMarker = MESSAGE_TAIL;
byte rb; // Each frame received
while (Serial2.available() > 0 && newData == false)
{
rb = Serial2.read();
/// rest of the file remains the same
Here’s the output (while pointed at my office wall and far away from me)
The manufacturer provides a pretty impressive demo using their Windows software. I wondered if it perhaps did some kind of firmware upgrade or calibration procedure that the Arduino software doesn’t.
I ordered a USB<->Serial converter hoping that I could see it work properly and then maybe go back to the logic analyzer to decode the differences in protocol.
Here’s a video showing how well that went:
This is pretty much useless for any of the purposes shown. It might suffice for detecting motion in limited circumstances, but I couldn’t get even slightly close to reproducing what the manufacturer shows it’s capable of.