Die letzten sechs Beiträge:

Über mich

Wie viele ....

Random Post
Search
  • Home
  • Tag Archives:  Arduino Uno
Search
  • Fritzing Breadboard Wiring Diagram

    HC-SR501 PIR Motion Sensor Test with Arduino Uno and Breadboard

    To figure out how to configure an HC-SR501 motion detector, I built a breadboard with a test circuit. This requires an Arduino Uno, the HC-SR501 sensor, an LED, a passive piezo buzzer, a 220 ohm resistor, a power supply or USB Cable to power the Arduino, and some jumper cables.

    On the Arduino you have to Upload the cpp Code from the INO-File to switch the Buzzer and the LED on and off when Motion ist detected.

    I put the whole thing together in Fritzing, and it’s available here also as an fzz file for download.

    The HC-SR501 motion detector has two potentiometers for setting values:
    1.) Sensitivity (SENS) → controls the range (~3m to ~7m)
    2.) Time delay (TIME) → controls how long the OUT pin remains HIGH (from approximately 2 seconds to several minutes)
    With the test setup, a suitable value can be determined for what you ultimately want to build by changing the potentiometer setting.

    Have fun trying it out and modify it for your own Requirements!

    Best regards,

    Edi

    CPP-Code for programming the Arduino One
    (INO-File Downlod here):

    const int pirPin = 2; // HC-SR501 Ausgang
    const int ledPin = 5;  // LED Pin
    const int buzzerPin = 4; // Summer Pin
    int pirState = LOW; // Aktueller Zustand des PIR Sensors
    
    void setup() {
      pinMode(pirPin, INPUT);
      pinMode(ledPin, OUTPUT);
      pinMode(buzzerPin, OUTPUT);
      Serial.begin(9600); // Für Debugging
    }
    
    void loop() {
      pirState = digitalRead(pirPin);
    
      if (pirState == HIGH) {
        digitalWrite(ledPin, HIGH);
        digitalWrite(buzzerPin, HIGH);
        Serial.println("Bewegung erkannt!");
        delay(1000); // Kurze Pause
        digitalWrite(ledPin, LOW);
        digitalWrite(buzzerPin, LOW);
        Serial.println("Pause...");
        delay(2000); //  Eine längere Pause
      }
    }

     

    Here you will find the Fritzing File:

    Download FZZ-File

    It was built with Fritzing Version 1.05

    Fritzing Version 1.0.5

    HC-SR501 Sensor in Progress

  • ESP32-Cam and D1 Mini ESP8266 Projects

    In this Part of my Blog i will show you some Projects that use the ESP32 Cam and the D1 Mini NodeMcu with ESP8266 Modules. There are a few things that this Controller are good for.

    I have some D1 Mini NodeMcu with ESP8266 to control Temperature, Humidity and Airpressure inside and outside of my House. They all have a rechargeable Battery to function for a few Weeks or Months. Captured values are stored in an InfluxDB. The resulting Curves can bo viewed with Grafana. With Node-Red i´vs programmed Dashboards to visualise the Temperature, Humidity and Airpressure with Gauges and Charts.

    The ESP32 Cam can be used as a Live Cam, Cam with automatic storing Pictures to a SD Card or send Photos via Email. Also it can ba combined for Examlpe with an HC-SR501 PIR Motion Detector to send Photos via Email when a Movment ist recognized.

    There are many Projects that can be set up with these Controllers

    Have fun and be creative to make your own things