HS-S38A Human Body Sensor

HS-S38A  Human Body Sensor

1. Introduction

A small human body induction module is an automatic control product based on infrared technology, with high sensitivity, strong reliability, ultra-small size, and ultra-low voltage working mode.Widely used in various automatic induction electrical appliances, especially in automatic control products powered by dry batteries.Automatic induction: When a person enters the induction range, a high level is output. When a person leaves the induction range, the high level is automatically closed after a delay and a low level is output.The triggering method can be repeated: that is, after the output is high, it will remain high within the time delay period, and if a human body moves within the detection range, the output will remain high until the person leaves and then the high level will be delayed to low level (the sensor module will automatically extend a time delay period each time it detects the movement of the human body, and take the time of the last movement as the starting point of the time delay).Check the distance is 0-5 meters, the effect is optimal within 3 meters.

2. Schematic

Human sensor-HS-S38A schematicClick to view

Module Parameters

Pin Name

description

G

GND (Negative Power Input)

V

VCC (Positive Power Input)

S

Digital Signal Pin

  • Power Supply Voltage: 3.3V / 5V

  • Connection Type: 2.54mm Header

  • Installation Method: Double Screw Fixed

4, Circuit Board Size

5 of Arduino IDE example program

Attention: If prompted with an error message about the library file during program upload, please import the library file first!
Arduino IDE Library Download and Import Tutorial:
Click to view

Example program (UNO development board):

void setup(){
  Serial.begin(9600);
  pinMode(4, INPUT);
  pinMode(9, OUTPUT);
}

void loop(){
  //人体传感器在检测到人体移动时,会产生一个高电平(1),使蜂鸣器响起;当未检测到范围内有人移动时,蜂鸣器不响。
  if (digitalRead(4) == 1) {
    digitalWrite(9,HIGH);

  } else if (digitalRead(4) == 0) {
    digitalWrite(9,LOW);
  }

  delay(500);
  Serial.println(digitalRead(4));

}

6, ESP32 Python Example (for Mixly IDE/Misashi)

Choose the development board Python ESP32 [ESP32 Generic(4MB)] and upload in code mode

Attention: If prompted with an error message about the library file during program upload, please import the library file first!
Download and import tutorial for Mixly IDE ESP32 library:
Click to view

Example program (ESP32-Python):

import machine


pin2 = machine.Pin(2, machine.Pin.IN)
pin4 = machine.Pin(4, machine.Pin.OUT)
while True:
    if pin2.value() == 1:
        pin4.value(1)
    else:
        pin4.value(0)

7, Mixly example program (graphical language)

Example program (UNO development board):Click to download
Attention: If prompted with an error message about the library file during program upload, please import the library file first!
Download and import tutorial of Mixly IDE Arduino library:Click to view

Example Program (ESP32 Development Board):Click to download
Attention: If prompted with an error message about the library file during program upload, please import the library file first!
Download and import tutorial for Mixly IDE ESP32 library:
Click to view

8. Setting up the Test Environment

Arduino UNO Test Environment Setup

Prepare Components:

  • HELLO STEM UNO R3 PRO DEVELOPMENT BOARD *1

  • USB TYPE-C DATA CABLE *1

  • Active Buzzer Module (HS-F07A) *1

  • Human body sensor module (HS-S38A) *1

  • 1P female to female Dupont wire *6 pieces or 3P female to female Dupont wire *2 pieces

Circuit wiring diagram:

ESP32 Test Environment Setup

Prepare Components:Pending update...

Circuit wiring diagram:Pending update...

9, Video tutorial

Video tutorial:Click to view

10, Test results

Arduino UNO test results:

The human body sensor generates a high level (1) when it detects human movement, causing the buzzer to sound; when no movement is detected within the range, the buzzer does not sound.