Davide Cogliati
Published © GPL3+

Sight movement awarness pad

Detecting moving objects for visual impaired person is extremely important. It's a must of safety detect if something is moving around.

IntermediateFull instructions provided10 hours143

Things used in this project

Hardware components

Seeed Studio XIAO ESP32S3 Sense
Seeed Studio XIAO ESP32S3 Sense
×1
PCBWay Custom PCB
PCBWay Custom PCB
Designed a special HW to interface the XIAO ESP32S3 and the vibration motors, buzzer and power leds.
×1
DFRobot 5.8GHz Microwave Radar Module
×1
LED, Blue
LED, Blue
×2
Buzzer
Buzzer
×1
Wire, Wrapping Wire
Wire, Wrapping Wire
×1
SMD components.
Components to be mounted on the designed PCB from PCBWay are 0805 sized and are resistors, capacitors, transistors.
×1
Battery holder for 3xAA size
×1
AA Batteries
AA Batteries
×1
5PCS 10x2.7mm Mini Vibration Motors 1027 DC 3V Micro Mini Tiny Flat Coin Button-Type Vibrating Motors
×10

Software apps and online services

Arduino IDE
Arduino IDE
OpenCV
OpenCV
Design can be upgraded to computer vision using a lite version on the Xiao ESP32S3. All hardware is present, need only code development and flash the Xiao board. The device is complete of all, now just a challenge to code it for Computer Vision.

Hand tools and fabrication machines

Soldering iron (generic)
Soldering iron (generic)
3D Printer (generic)
3D Printer (generic)
Multitool, Screwdriver
Multitool, Screwdriver
Solder Wire, Lead Free
Solder Wire, Lead Free
Wire Stripper & Cutter, 32-20 AWG / 0.05-0.5mm² Solid & Stranded Wires
Wire Stripper & Cutter, 32-20 AWG / 0.05-0.5mm² Solid & Stranded Wires

Story

Read more

Custom parts and enclosures

HACKPAD-vibra

This is the vibrating motors support and centering plate.

HACKPAD-sotto

This is the electronics and battery holder enclosure mounted on the rear of the pad.

HACKPAD-wave

Microwave sensor protection cover

HACKPAD-lens

Sensor, buzzer, and camera enclosure

HACKPAD-1

Baseplate were electronic circuit and sensors, vibrating motors and vibrating fingers are mounted

HACKPAD-led

Led round holder.

Designed PCB for interfacing XIAO ESP32S3.

Designed PCB for interfacing XIAO ESP32S3 and the vibration motors, buzzer, power leds avoiding the XIAO board to be damaged from excessive current drain and electrical surges.

HACKPAD-sopra

This is the finger structure used for the project.

Schematics

Hardware designed circuit for the Sight Movement Awarness Pad.

This circuit show the interaction between the parts that make up the hardware of the device.

VIDEO: TESTING ON A CHILDREN WALKING

In this video a test is made on a children walking in order to configure the sensor detection parameters. Efforts should be done with the sensor (DFRobot ) maker to optimize some features.

WEARING THE PAD

A way to use the pad wearing it with a strap around the neck.

Datasheet DFRobot SEN0521 Microwave radar sensor.

This is the datasheet for the selected sensor in the Sight Movement Awarness pad.

BUILDING-DEVICE-PLAN

A main exploded view of the principal pieces to assemble the Sight movement awarness pad.

BUILDING-DEVICE-STEP-BY-STEP

Building step by step the sight movement awarness pad so to understand how it was designed.

BUILDING-DEVICE-COMPLETE-intructions

This is the complete device with test (debug mode of code) and instructions on how it works.

VIDEO : starting the sight movement awarness pad, what happens.

In this video the start - initialize of the device where you can see the audio, light pulses and hear the vibration of the pad. It takes 5 seconds to initialize the sensor.

Code

Arduino code for the rev.1 of the Sight Movement Awarness Pad

Arduino
This is the code used to develop the device and to make it work.
#include "DFRobot_Microwave_Radar_Module.h"
#include <Arduino.h>
 
#define D3  RX
#define D2  TX
#define DEBUG 1  //0 = turn off serial plot mode
//-----------------------
//I/O pin for touch pad
//-----------------------
 
DFRobot_Microwave_Radar_Module Sensor(/*hardSerial =*/&Serial1, /*rx =*/D3, /*tx =*/D2);  // <---------------- PIN TX/RX

 
int i;
void setup()
{
  Serial.begin(115200);

    if(1)
   {
    delay(1000);
    Serial.print("Starting  SERIAL EXP32S3,,,");
    }
    delay(1000);
    //Initialize sensor
  while ( !( Sensor.begin() ) ) {
    Serial.print("Communication with SEN0521  failed: check connection");
    delay(3000);
  }
   Serial.println("STARTED ok!");
  int i=0;
  
  i = 8; 
  int PIN_depart = 3; //  object is going far away
  int PIN_proxy = 3;  //  object is coming toward us
  int PIN_10m = 9; 
  int PIN_8m = 8; 
  int PIN_6m = 6;
  int PIN_4m = 5;
  int PIN_2m = 4;
  int PIN_1m_led = 7; 
  int PIN_TRIGGER =1;
  //---------------------------------------
  //setup I/O state for XIAO EXP32S3 SENSE
  //---------------------------------------
  pinMode(PIN_depart, OUTPUT);
  pinMode(PIN_proxy, OUTPUT);
  pinMode(PIN_10m, OUTPUT);
  pinMode(PIN_8m, OUTPUT);
  pinMode(PIN_6m, OUTPUT);
  pinMode(PIN_4m, OUTPUT);
  pinMode(PIN_2m, OUTPUT);
  pinMode(PIN_1m_led, OUTPUT);  
  pinMode(PIN_TRIGGER, INPUT);  
  //-----------------------------
  //HW is working ?
  //-----------------------------
  
 for (i= 1; i<7; i++)
 { 
  digitalWrite(PIN_depart, 1);
  digitalWrite(PIN_10m, 1);
  digitalWrite(PIN_1m_led, 1);
  
  delay(200);
  digitalWrite(PIN_depart,0);
  digitalWrite(PIN_10m, 0);
  digitalWrite(PIN_1m_led, 0);
  
  delay(200);
   }
 
 //-----------------------------------------------------
 //SETUP THE DFROBOT SEN0'521 MICROWAVE RADAR 5.8 GHz
 //-----------------------------------------------------
  /**
     @brief Restore factory settings
  */
  Sensor.factoryReset();

  /**
     @brief Configuration distance, 0~11m, default is 6m.
  */
  Sensor.detRangeCfg(11);

  /**
     @brief Configure the detection sensitivity. The greater the value of 0~9, the higher the sensitivity. The default value is 7.
  */
  Sensor.setSensitivity(9);
  Sensor.setInhibit(0);
  /** 
     @brief Configure output delay time
  */
  Sensor.outputLatency(0.05 ,0.5); //(1, 15);

  /**
     @brief Configure interface polarity of output control signal.
  */
  Sensor.setGpioMode(1);
}
 //---------------------------------------------
 //end setup sen0521 board
 //---------------------------------------------
void loop()
{
  unsigned int val=0;
  unsigned int distance=0;
  unsigned int distance_scan=11;
  unsigned int MAX_scale = 15;
  unsigned int min_scale =0;
  unsigned int Move_dir =0;
  //----------------------------------
  //XIAO ESP32S3 SENSE ASSIGNEMENT
  //----------------------------------
  int PIN_depart = 3;//object is going far away
  int PIN_proxy = 3; //object is coming toward us
  int PIN_10m = 9; 
  int PIN_8m = 8; 
  int PIN_6m = 6;
  int PIN_4m = 5;
  int PIN_2m = 4;
  int PIN_1m_led = 7; 
  int PIN_TRIGGER =1;
  //----------------------------------
  unsigned int detect_stage =0;            //detection stage during autoranging
  unsigned int detect_timeswitch =0;       //detection autoranging time to reset procedure
  unsigned int ranging = 0;                //flag autoranging ON=1, 0= OFF
  unsigned int trigger =0;                 //flag if trigger signal from sensor on detection was set/reset
  unsigned int distance_before =0;         //distance at step 1 on distance autoranging
  unsigned int distance_after =0;          //distance at step 2 on distance autoranging

  //---------------------------------- 
  //plot layout: PLOT
  //----------------------------------
  //*****************************************
  //SET UP THE PLOTTER X-Y READINGS (X= time)
  //*****************************************
     if (DEBUG) //IS DEBUG MODE ACTIVE = True ?
       {
           Serial.print(MAX_scale,DEC);
            Serial.print("  ");
            
            Serial.print(min_scale,DEC);
            Serial.print("  ");
            //*****************************************
            //SETUP LABELS NAME
            //*****************************************
            Serial.print("MOVE");      //MOVE object detection
            Serial.print("  ");
            Serial.print("Distance");  //max. detection distance programmed 
            Serial.print("  ");
            Serial.print("Autorng");      //auto-ranging FLAG: 1= autoranging ON, 0= autoranging OFF
            Serial.print("  ");
            Serial.print("Det.stg");      //autoranging detection stage, it modifies the max. detection range
            Serial.print(" ");
            Serial.print("trig");      //trigger state 1= OBJECT DETECTED STILL/MOVING  0= NO DETECTION-RESET DETECTION
            Serial.print(" ");
            Serial.print("Dir");       //DIRECTION of move: 1= approaching, 0= still or departing
            Serial.print(" ");
            Serial.println("DetTime"); //auto-ranging TIME window, then resets autoranging      
        //**************************************************
      }


  //----------------------------------
  while(1)
  {
  
  val =0;  //RESET DETECTION flag...
  val = Sensor.readPresenceDetection();  //get detection if ready.
  trigger = digitalRead(PIN_TRIGGER);    //READOUT the detection pin of SEN0521
  
  
  //------------------------------------------------
  //AUTODETECTING DISTANCE RANGE
  //------------------------------------------------
  if(ranging == 1)  //is currently running the autodetecting?
    {
    detect_timeswitch = detect_timeswitch +1; //detection time for autoranging
    if (detect_timeswitch > 20)            //over time for autoranging
      {
       ranging =0;                         //reset ranging operation
       detect_timeswitch=0;                //reset autoranging time counter
       detect_stage =0;                    //reset the detection stage for autoranging
       distance_scan =11;                  //restores max. distance of exploration
       Sensor.detRangeCfg(distance_scan);  //set the sensor distance back to 11 m (max. depth of sensor)
       Move_dir =0;                        //reset move direction 0 -> 1 is aproaching, 0= still or departing
       distance_before =11;                 //distance at step 1 on distance autoranging
       distance_after =11;                  //distance at step 2 on distance autoranging
      } 
    } 
  if (val)    //if val=1 then detection occurred !
              //trough the "ranging" flag this distance is modified to get
              //information on movement direction.
   {
    //
    //-------------------------------------------    
    //EVALUATE MOVEMENT DIRECTION
    //this is done comparing successive
    //"distance_scan" detection results
    //-------------------------------------------
     i= distance_before - distance_after; //distance value is shortened any time there is a detection
                                          //until there is no more detections.
     if ((i ==0)| (i <0))
       Move_dir =0;    //no distance update with autoranging, object departing or still,
     if (i>0)
        {
          Move_dir =1;                       // distance_after is shorter and object still 
                                             // detected, it is very close or approaching...
          distance_before = distance_after ; // update new value for next test !!!
          
        }  
    //--------------------------------------------
    //select approaching or departing fingers row 
    //-------------------------------------------- 
    //
    if (Move_dir == 0)
       digitalWrite(PIN_depart, 1);
    if (Move_dir == 1)
       digitalWrite(PIN_proxy, 0);
    //-------------------------------------------- 
    //--------------------------------
    //WARNING FLASHES and BEEPS
    //--------------------------------
    digitalWrite(PIN_1m_led, 1);
    delay(100);
    digitalWrite(PIN_1m_led, 0);
    delay(100);
    digitalWrite(PIN_1m_led, 1);
    delay(100);
    digitalWrite(PIN_1m_led, 0);
    //--------------------------------------------------------
    //select FINGER to vibrate upon distance range programmed
    //--------------------------------------------------------
    if (distance_scan ==11)
     {
    digitalWrite(PIN_10m, 1);
    delay(1000);
    digitalWrite(PIN_10m, 0);
     }
   if (distance_scan ==10)
     {
    digitalWrite(PIN_10m, 1);
    delay(1000);
    digitalWrite(PIN_10m, 0);
     }
   
   if (distance_scan ==9)
     {
    digitalWrite(PIN_8m, 1);
    delay(1000);
    digitalWrite(PIN_8m, 0);
     }
   if (distance_scan ==8)
     {
    digitalWrite(PIN_8m, 1);
    delay(1000);
    digitalWrite(PIN_8m, 0);
     }  
  if (distance_scan ==7)
     {
    digitalWrite(PIN_6m, 1);
    delay(1000);
    digitalWrite(PIN_6m, 0);
     }  
  if (distance_scan ==6)
     {
    digitalWrite(PIN_6m, 1);
    delay(1000);
    digitalWrite(PIN_6m, 0);
     }  
  if (distance_scan ==5)
     {
    digitalWrite(PIN_4m, 1);
    delay(1000);
    digitalWrite(PIN_4m, 0);
     }  
  if (distance_scan ==4)
     {
    digitalWrite(PIN_4m, 1);
    delay(1000);
    digitalWrite(PIN_4m, 0);
     }    
    if (distance_scan ==3)
     {
    digitalWrite(PIN_2m, 1);
    delay(1000);
    digitalWrite(PIN_2m, 0);
     } 
   if (distance_scan ==2)
     {
    digitalWrite(PIN_2m, 1);
    delay(1000);
    digitalWrite(PIN_2m, 0);
     }
  if (distance_scan < 2)  //object very close....
    {
    digitalWrite(PIN_2m, 1);
    delay(1000);
    digitalWrite(PIN_2m, 0); 
    //--------------------------------
    // WARNING FLASHES and BEEPS
    //--------------------------------
    digitalWrite(PIN_1m_led, 1);
    delay(100);
    digitalWrite(PIN_1m_led, 0);
    delay(100);
    digitalWrite(PIN_1m_led, 1);
    delay(100);
    digitalWrite(PIN_1m_led, 0);
    }
        
   }
  
   //--------------------------------------------------
   //self adjusting range window to get distance info.
   //approaching or departing?
   //--------------------------------------------------
   if(val)  //detection
    {
    ranging =1;     //start autoranging until/anytime  val=1 or expires detection time. 
    // Sensor.rePos(); 
    //--------------------------------------------------
    //every detection increases the "detect_stage"
    //to test a closer distance and get information on 
    //movement direction
    //--------------------------------------------------
    detect_stage= detect_stage +1;
    //------------------------------
    if (detect_stage == 1)
        distance_scan= 9;  
        
    else if (detect_stage == 2)
        distance_scan = 8;
        
    else if (detect_stage == 3)
        distance_scan =7;  
           
    else if (detect_stage == 4)
        distance_scan =6;  
          
    else if (detect_stage == 5)
        distance_scan =5;   
        
    else if (detect_stage == 6)
        distance_scan =4;   
          
    else if (detect_stage == 7)
        distance_scan =3;    
        
    else if (detect_stage == 8)
        distance_scan =2;   
             
    else if (detect_stage ==9)
        distance_scan =1;  
        
    else if (detect_stage > 9)
        distance_scan =1; 
    //------------------------------
    //SIGNAL DETECTION FLASH + BEEP
    //------------------------------
    digitalWrite(PIN_1m_led, 1);  
    //delay(200);  
    //--------------------------------------    
    //EVALUATE MOVEMENT DIRECTION
    //this is done comparing successive
    //"distance_scan" detection results
    //look above coding......
    //-------------------------------------- 
    distance_after = distance_scan ;//update new value of autoranged distance.
    //
    //------------------------------   
    Sensor.detRangeCfg(distance_scan); //modify distance for next scan and move direction
    //------------------------------------------------------
    //TURN OFF SIGNAL FLASH + BEEP
    //this time inform on "Sensor.detrange()"
    //update time...
    //------------------------------------------------------
    digitalWrite(PIN_1m_led, 0); //LED FLASH + BEEP is OFF
    }
     //---------------------------------------------------
     //debugging PLOT of the working SIGHT AWARNESS PAD
     //---------------------------------------------------
      if  (DEBUG) //IS DEBUG MODE ACTIVE = True ?
       { 
            Serial.print(MAX_scale,DEC);
            Serial.print("  ");
            Serial.print(min_scale,DEC);
            Serial.print("  "); 
            //------------------------------------------------
            Serial.print((val*10),DEC);        // x 10 enhances the sight on the graph
            Serial.print("  ");
            Serial.print(distance_scan,DEC);  // x 10 enhances the sight on the graph
            Serial.print("  ");
            Serial.print(ranging*10);
            Serial.print(" ");
            Serial.print(detect_stage);
            Serial.print(" "); 
            Serial.print(trigger*6);
            Serial.print(" ");
            Serial.print(Move_dir*15);  //x 15 enhances visibility on PLOT
            Serial.print(" ");
            Serial.println(detect_timeswitch,DEC);  // x 10 enhances the sight on the graph
     //-------------------------------------------------
     //-------------------------------------------------

  }
 }
}

Credits

Davide Cogliati

Davide Cogliati

8 projects • 8 followers
I develop electronic boards for customers and final 3D products.

Comments