top of page

Search Results

150 items found for ""

Events (1)

View All

Blog Posts (23)

  • Unlocking Security: Build Your Own LED and Buzzer Alert System with Arduino Nano & Door Sensor

    In an age where home and workplace security is paramount, the need for simple yet effective alert systems cannot be overstated. This project guides you through the creation of an LED and Buzzer-Based Alert System using a Door Sensor and an Arduino Nano. This system will notify you audibly and visually whenever the door opens or closes, providing an extra layer of security to your environment. Applications and Future Scope This innovative alert system can be applied in various scenarios, such as: Home Security: Detect unauthorized access when the door is opened unexpectedly. Office Monitoring: Alert personnel when secure areas are accessed. Warehouse Management: Track entry and exit in inventory areas. The future scope of this project is vast. By integrating it with IoT platforms, you can enable remote notifications via smartphone, allowing for real-time monitoring of your property. Imagine receiving alerts directly to your device, keeping you informed no matter where you are! Components Required To build this project, gather the following components: - Arduino Nano: The microcontroller that will serve as the brain of the project. - Door Sensor (Magnetic Reed Switch): This sensor will detect when the door is opened or closed. - LEDs (Red and Green): For visual indicators of door status. - Buzzer: Provides an audible alert when the door is opened. - 220Ω Resistor: Used to limit current to the LEDs. - Breadboard and Jumper Wires: For easy and organized connections. - USB Cable for Programming: To connect your Arduino to the computer. - Power Supply (optional): For standalone operation of the system. Steps to Follow 1. Getting Started with Hardware Connections Setting Up the Circuit: 1. Connect the Door Sensor: - Identify the two terminals of the magnetic reed switch. - Connect one terminal to a digital pin on the Arduino (e.g., D2) and the other terminal to the ground (GND). - When the door is closed, the reed switch will be in contact; when opened, it will break the circuit. 2. Wiring the LEDs: - Connect the longer leg (anode) of the red LED to another digital pin (e.g., D3) through a 220Ω resistor. This LED will indicate when the door is open. - Connect the shorter leg (cathode) of the LED to the ground (GND). - If you choose to add a green LED for indicating the door is closed, follow the same connection method but use a different digital pin (e.g., D5). 3. Connecting the Buzzer: - Connect the positive terminal of the buzzer to another digital pin (e.g., D4) and the negative terminal to the ground (GND). Circuit Diagram: 2. Coding the Arduino Nano The heart of your project lies in the code you upload to the Arduino Nano. Here’s a simple code snippet to make your alert system functional: Download the Code: You can download the complete code from [here] 3. Libraries Required This project utilizes basic Arduino functions, so no additional libraries are necessary. However, please always make sure your Arduino IDE is updated to the latest version for the best compatibility. 4. Setting Up in Arduino IDE Follow these steps to upload your code to the Arduino Nano: 1. Install the Arduino IDE: If you haven't already, download and install the Arduino IDE from [the official website](https://www.arduino.cc/en/software). 2. Upload the Code: - Open the Arduino IDE on your computer. - Copy and paste the provided code into a new sketch. - Select the appropriate board (Arduino Nano) and port from the Tools menu. - Click on the upload button (right arrow icon) to program your Arduino. 5. Testing Your System After uploading the code: 1. Connect the Arduino to your power source. 2. Open and close the door connected to the sensor. 3. Observe the LED and listen for the buzzer’s alert. 6. Results Upon completing the project, you will see: - When the door is opened: The red LED lights up, and the buzzer sounds, indicating the door is open. - When the door is closed: The green LED lights up, providing visual confirmation that the door is secured. Suggestions for Improvement - Adding More Sensors: You can integrate additional door sensors for a more comprehensive security system. - Wi-Fi Module Integration: Consider using an ESP8266 or similar module to send notifications to your smartphone for remote monitoring. - Mobile App Development: Develop a simple app to control and monitor the system from your mobile device. Conclusion Congratulations! You've successfully built an LED and Buzzer-Based Alert System using an Arduino Nano. This project not only enhances your understanding of basic electronics and programming but also provides a practical solution for home security. For more innovative projects and skill development programs, be sure to visit Skill-Hub by EmbeddedBrew, where we provide resources to elevate your technical skills!

  • Face Detection Using ESP32-CAM and Python on Thony Python IDE

    Face detection has become a fundamental aspect of various AI applications, from security systems to personal devices. With the ESP32-CAM, a low-cost microcontroller with camera capabilities, you can create your own face detection system. This guide will show you how to perform face detection using ESP32-CAM and Python on the Thony Python IDE. Whether you're a hobbyist or a tech enthusiast, this tutorial will help you create a functional project that detects faces in real-time. Prerequisites: ESP32-Cam module FTDI programmer Arduino IDE (installed) Thony Python IDE (installed) Micro-USB cable Jumper wires A local Wi-Fi network Step 1: Setup ESP32-CAM with Thony IDE 1.1 Install Thony Python IDE - Download Thony: Visit [Thony.org](https://thonny.org) and download the IDE for your operating system. - Install Python (If not already installed): Thony IDE will install Python automatically, but if you want a separate installation, go to [Python.org](https://python.org). 1.2 Connect ESP32-CAM to Your System Connect the ESP32-Cam to the FTDI programmer Connect the U0T and U0R pins of the ESP32-Cam to the RX and TX pins of the FTDI programmer. Connect the GND and 5V pins of the ESP32-Cam to the respective FTDI pins. Make sure the IO0 pin is connected to GND for flashing the ESP32-Cam. Install the ESP32 board package in Arduino IDE Open Arduino IDE and go to File > Preferences. In the "Additional Board Manager URLs" field, paste the following link: https://dl.espressif.com/dl/package_esp32_index.json Go to Tools > Board > Board Manager and search for ESP32. Install the ESP32 board package. Select the ESP32-Cam board in Arduino IDE Go to Tools > Board and choose AI-Thinker ESP32-Cam. Set the upload speed to 115200 and the correct port for your FTDI programmer. Upload the Webserver Example Code for Face Detection Open File > Examples > ESP32 > Camera > CameraWebServer. In the code, ensure you add your Wi-Fi SSID and password to connect the ESP32-Cam to your network. Upload the code to the ESP32-Cam by pressing Upload in the Arduino IDE. Once uploaded, remove the GND connection from IO0 and reset the module. Step 2: Get the ESP32-Cam’s IP Address Open Serial Monitor Go to Tools > Serial Monitor in Arduino IDE. Set the baud rate to 115200. Once the ESP32-Cam boots, you should see an IP address displayed in the Serial Monitor. Copy this IP address, as it will be used in the next step. Step 3: Integrate Python for Face Detection Install the OpenCV, Numpy library in Thony Open Thony Python IDE and go to Tools > Manage Packages . Search for opencv-python, Numpy  and install it. This library will handle face detection. Install requests library In the same way, search for and install the requests  library. This is required to interact with the ESP32-Cam’s webserver. 3. Write Python Script for Face Detection Create a New Python Script In Thony, create a new file and name it something like face_detection.py. Write the Code Use the following code to capture the video stream from the ESP32-Cam and detect faces. Run the Python Script - Make sure the ESP32-CAM webserver is running. Replace `'http://your-esp32-cam-ip-address/stream'` with the actual IP address of your ESP32-CAM. - Run the Python script in Thony IDE. A window will pop up displaying the video stream from the ESP32-CAM with detected faces highlighted. Step 4: Code Explanation Let's break down this code for face and eye detection using the ESP32-CAM stream into simple sections for a beginner: 1. Importing Required Libraries import cv2 import urllib.request import numpy as np - cv2: This is the OpenCV library, used for image and video processing. - urllib.request: This is used to fetch data from URLs (in this case, we’ll fetch images from the ESP32-CAM). - numpy (`np`): This is used for handling arrays and matrices. We need it to convert the images we get from the URL into a format OpenCV can process. 2. Loading Pre-Trained Models (Haar Cascades) for Face and Eye Detection f_cas = cv2.CascadeClassifier(cv2.data.haarcascades + 'haarcascade_frontalface_default.xml') eye_cascade = cv2.CascadeClassifier(cv2.data.haarcascades + 'haarcascade_eye.xml') - Cascade Classifier: OpenCV uses pre-trained models (Haar cascades) to detect objects like faces and eyes. - `haarcascade_frontalface_default.xml` is used for detecting faces. - `haarcascade_eye.xml` is used for detecting eyes. The `CascadeClassifier` function loads these XML files, which contain the trained models. 3. Defining the ESP32-CAM URL url = 'http://192.168.1.104/capture' - This defines the URL from where the ESP32-CAM streams its video or captures frames. You should replace `'http://192.168.1.104/capture'` with the actual IP address of your ESP32-CAM. Make sure the ESP32-CAM is connected to the same network as your computer. 4. Creating a Display Window cv2.namedWindow("Live Transmission", cv2.WINDOW_AUTOSIZE) - This creates a window named "Live Transmission" to display the camera feed. `cv2.WINDOW_AUTOSIZE` means the window will automatically adjust its size based on the image size. 5. Main Loop to Continuously Capture and Process Frames while True: img_resp = urllib.request.urlopen(url) imgnp = np.array(bytearray(img_resp.read()), dtype=np.uint8) img = cv2.imdecode(imgnp, -1) - `while True:`: This loop continuously fetches frames from the ESP32-CAM. - `urllib.request.urlopen(url)`: This retrieves the image from the ESP32-CAM via the URL. - `np.array(bytearray(img_resp.read()), dtype=np.uint8)`: Converts the image from bytes into a NumPy array so it can be handled by OpenCV. - `cv2.imdecode(imgnp, -1)`: Decodes the NumPy array into an image that OpenCV can work with. 6. Converting the Image to Grayscale gray = cv2.cvtColor(img, cv2.COLOR_BGR2GRAY) - `cv2.cvtColor` converts the color image (BGR format) into grayscale, which is easier and faster for the detection algorithms (face and eye detection) to process. 7. Detecting Faces in the Image face = f_cas.detectMultiScale(gray, scaleFactor=1.1, minNeighbors=5) - `f_cas.detectMultiScale`: This function detects faces in the grayscale image. - `gray`: The grayscale image where faces are to be detected. - `scaleFactor=1.1`: This parameter specifies how much the image size is reduced at each image scale (controls accuracy). - `minNeighbors=5`: Defines the minimum number of neighboring rectangles that need to be detected for an object (face) to be considered valid. 8. Drawing Rectangles Around Detected Faces for x, y, w, h in face: cv2.rectangle(img, (x, y), (x + w, y + h), (0, 0, 255), 3) - `for x, y, w, h in face:`: This loop runs through all the detected faces, where: - `x` and `y` are the coordinates of the upper-left corner of the face. - `w` is the width and `h` is the height of the face. - `cv2.rectangle`: Draws a red rectangle (BGR color `(0, 0, 255)`) around the detected face in the original image (`img`). 9. Detecting and Highlighting Eyes Within the Detected Face roi_gray = gray[y:y+h, x:x+w] roi_color = img[y:y+h, x:x+w] eyes = eye_cascade.detectMultiScale(roi_gray) for (ex, ey, ew, eh) in eyes: cv2.rectangle(roi_color, (ex, ey), (ex + ew, ey + eh), (0, 255, 0), 2) - `roi_gray` and `roi_color`: These define the "Region of Interest" (ROI) where eyes are expected to be found, which is the region inside the detected face. - `eye_cascade.detectMultiScale(roi_gray)`: Detects eyes within the face region in the grayscale image. - `cv2.rectangle`: Draws a green rectangle (BGR color `(0, 255, 0)`) around each detected eye. 10. Displaying the Result cv2.imshow("live transmission", img) - `cv2.imshow`: This function displays the current frame with rectangles around detected faces and eyes in the "Live Transmission" window. 11. Exiting the Program key = cv2.waitKey(5) if key == ord('q'): break - `cv2.waitKey(5)`: Waits for 5 milliseconds for a key press. - `if key == ord('q'):`: If the 'q' key is pressed, the program breaks out of the loop and stops the live video feed. 12. Cleanup cv2.destroyAllWindows() - `cv2.destroyAllWindows`: Closes the window displaying the video when the loop ends (after pressing 'q'). Summary: - Import libraries: OpenCV for image processing, `urllib` for getting images from the ESP32-CAM, and NumPy for array handling. - Haar Cascades: Pre-trained models to detect faces and eyes. - ESP32-CAM URL: Defines the web address from which the camera feed is fetched. - Face & Eye Detection: OpenCV processes each frame, converting it to grayscale for more efficient detection, and uses `CascadeClassifier` to draw rectangles around faces and eyes. - Live Video Stream: Displays the video feed in real time, with face and eye detection applied, until the user presses 'q' to quit. Conclusion: Congratulations! You’ve successfully set up face detection using the ESP32-CAM and Python on the Thony IDE. This project can be extended for various applications such as smart home security, automated attendance systems, or even facial recognition.If you enjoyed this tutorial, be sure to visit our Skill-Hub for the Arduino Master Class, where you can take your tech skills to the next level!

  • Building a Webserver-Controlled Spy Car with ESP32-Cam: A Step Guide

    Introduction In the world of IoT, creating smart devices that can be controlled remotely is both exciting and rewarding. One such project is the Webserver Controlled Spy Car using the ESP32-Cam module. This camera-equipped module allows you to stream live video and control your car's movements through a simple web interface. If you're interested in exploring the world of remote surveillance, this project is for you! Follow the detailed steps below to create your own spy car and gain hands-on experience in embedded systems. Step 1: Components You’ll Need - ESP32-Cam Module - FTDI Programmer (for uploading code to ESP32) - L298N Motor Driver - DC Motors with Wheels (4 for car movement) - Chassis for the Car (any basic car chassis works) - LiPo Battery or Adapter (for powering the car) - Jumper Wires (for connections) - Breadboard (optional for easy connections) Step 2: Setting Up ESP32-Cam for Web Server The ESP32-Cam module can stream video and control the car via a webserver. First, we’ll set up the ESP32-Cam to stream live video over Wi-Fi. 1. Install ESP32 board on Arduino IDE: - Open Arduino IDE. - Go to File > Preferences and in the Additional Board Manager URLs field, paste the following link: ``` https://dl.espressif.com/dl/package_esp32_index.json ``` - Next, go to Tools > Board > Boards Manager and search for ESP32. Install it. 2. Connect the FTDI programmer: - Connect the GND of the FTDI programmer to GND of the ESP32-Cam. - Connect VCC to 5V, RX to U0T, and TX to U0R. - Set the IO0 pin to GND (this puts the ESP32 into programming mode). 3. Upload the code for video streaming: - Use the following sample code to set up the camera streaming: 4. Check video stream: - Once the code is uploaded, open the Serial Monitor and note down the IP address of the ESP32-Cam. - Enter this IP address into a web browser to view the video stream. Step 3: Assembling the Spy Car 1. Motor Driver Connections: - Connect the L298N Motor Driver to the DC motors for car movement. - The IN1, IN2, IN3, and IN4 pins of the L298N should be connected to any 4 GPIO pins on the ESP32-Cam module (for controlling the direction). - Connect the 12V input of the L298N to the LiPo Battery for power. 2. ESP32-Cam Pin Configuration: - Assign GPIO pins to control the motors: - `GPIO12` for IN1, - `GPIO13` for IN2, - `GPIO14` for IN3, - `GPIO15` for IN4. Step 4: Setting Up the Web Server for Car Control In addition to streaming video, we want to control the movement of the car using buttons on a web interface. Here’s how to modify the code: Test the car movements: - Once the code is uploaded, open the web interface by visiting the ESP32-Cam’s IP address. - Click the buttons to move the car in different directions while viewing the live video feed Step 5: Powering and Testing Once all the connections are made: - Power the car with a LiPo battery. - Test the car’s movement and camera stream by accessing the web server from your smartphone or laptop. Conclusion You’ve now built your own webserver-controlled spy car using the ESP32-Cam! This project combines the power of IoT and real-time control, providing a great way to explore remote monitoring. Make sure to visit Skill-Hub by EmbeddedBrew for the Arduino Master Class, where you’ll dive even deeper into microcontroller programming and automation.

View All

Other Pages (65)

  • Getting Started with Raspberry-Pi Pico

    Getting Started with Raspberry-Pi Pico In this topic we are going to unbox an Raspberry-Pi Pico and get to know more about it. Description: The Raspberry Pi Pico is a versatile microcontroller board that’s perfect for a variety of projects. Follow these steps to get started with your Pico on a Windows PC. Step 1: Gather Your Materials - Raspberry Pi Pico board - Micro-USB cable (for power and data transfer) - Windows PC - Breadboard and jumper wires (optional, for experiments) - LEDs, resistors, sensors (optional, for projects) Step 2: Install the Raspberry Pi Pico Software 1. Download and Install Thonny IDE: - Visit the [Thonny website]( https://thonny.org/ ) and download the installer for Windows. - Run the installer and follow the prompts to complete the installation. 2. Download MicroPython UF2 File: - Visit the [Raspberry Pi Pico MicroPython page]( https://www.raspberrypi.com/documentation/microcontrollers/micropython.html ). - Download the MicroPython UF2 file from the official website. Step 3: Prepare the Raspberry Pi Pico 1. Connect the Pico to Your PC: - Hold down the BOOTSEL button on the Pico. - While holding the button, connect the Pico to your PC using the micro-USB cable. - Release the BOOTSEL button once the Pico is connected. Your Pico should appear as a removable drive named RPI-RP2 on your computer. 2. Copy the MicroPython UF2 File: - Open the RPI-RP2 drive on your PC. - Drag and drop the MicroPython UF2 file you downloaded earlier onto the RPI-RP2 drive. - The Pico will automatically reboot, and the drive will disappear from your file explorer. Step 4: Configure Thonny IDE 1. Open Thonny IDE: - Launch the Thonny IDE from your Start menu. 2. Select the Interpreter: - Go to Tools > Options and select the Interpreter tab. - Choose MicroPython (Raspberry Pi Pico) from the drop-down menu. - Ensure the correct COM port is selected for your Pico (you can find this in the Device Manager under Ports). Step 5: Write and Run Your First Program 1. Write a Simple Script: - In the Thonny editor, type the following code to blink an onboard LED: from machine import Pin from time import sleep led = Pin(25, Pin.OUT) while True: led.toggle() sleep(1) 2. Save and Run the Script: - Save the script by going to File > Save As, then choose Raspberry Pi Pico. - Name your file (e.g., ` b link .py `) and click OK. - Click the Run button (green arrow) to execute your script. You should see the onboard LED start blinking. Project Gallery All Documents : Write the given code in your IDE and Save as Temp.py file. from machine import ADC import utime temp_sensor = ADC(4) # Default connection of temperature sensor while True: # get raw sensor data raw_sensor_data = temp_sensor.read_u16() # convert raw value to equivalent voltage sensor_voltage = (raw_sensor_data / 65535)*3.3 # convert voltage to temperature (celcius) temperature = 27 - (sensor_voltage - 0.706)/0.001721 print("Temperature : ",temperature, " degree celcius") utime.sleep(1) Follow the Steps given above to Complete the project. Click Here to Download Download Video Tutorial : Conclusion : Congratulations on completing all the steps! You now have a solid understanding of how the Raspberry Pi Pico works. Feel free to experiment with various projects to further enhance your skills. For more project ideas and detailed guides, visit our website. Additionally, explore Skill-Hub by EmbeddedBrew to acquire a wide range of skills in embedded systems. Happy learning! comments debug Comments Write a comment Write a comment Share Your Thoughts Be the first to write a comment.

  • Automatic door opening system using motion sensor

    Automatic door opening system using motion sensor Create a fun project of opening a door using IR sensor Description: Are you interested in home automation projects? In this tutorial, we'll guide you through the steps to create an automatic door opener using an Arduino, a servo motor, and an IR sensor. This project is perfect for beginners and a great way to get hands-on experience with Arduino. Components Needed: - Arduino Uno - Servo Motor (e.g., SG90) - IR Sensor Module - Breadboard and jumper wires - Power supply (e.g., 9V battery with connector) - Door or small model to test the mechanism 1. Setup and Wiring: - Servo Motor Wiring: - Connect the red wire of the servo motor to the 5V pin on the Arduino. - Connect the black or brown wire to the GND pin on the Arduino. - Connect the yellow or orange wire to digital pin 9 on the Arduino. - IR Sensor Wiring: - Connect the VCC pin of the IR sensor to the 5V pin on the Arduino. - Connect the GND pin to the GND on the Arduino. - Connect the OUT pin of the IR sensor to digital pin 7 on the Arduino. 2. Arduino Code: - Open the Arduino IDE and create a new sketch. Copy and paste the following code. 3. Assembling the Components: - Place the IR sensor module near the door, ensuring it can detect when someone approaches. - Attach the servo motor to the door mechanism. If you're using a model door, you might need to create a simple arm that the servo can push or pull to open the door. 4. Uploading the Code: - Connect your Arduino to your computer using a USB cable. - Select the correct board and port from the Arduino IDE (Tools > Board > Arduino Uno, Tools > Port > COMx). - Click the upload button to transfer the code to the Arduino. 5. Testing: - Once the code is uploaded, power your Arduino using a 9V battery or another power source. - Wave your hand or an object in front of the IR sensor. The servo motor should rotate to open the door and then close it after 3 seconds. Troubleshooting Tips: - Servo Not Moving: Ensure that the servo motor connections are correct and secure. Check the power supply. - IR Sensor Not Detecting: Verify the IR sensor wiring and that the sensor is oriented correctly. Use the serial monitor to check the sensor readings. - Adjustments: If the door doesn't open or close properly, adjust the servo angle values in the code. Project Gallery All Documents : Download the following code to run your project. Click Here to Download Download Video Tutorial : Conclusion : By following these steps, you have successfully created an automatic door opener using Arduino, a servo motor, and an IR sensor. This project introduces you to the basics of using sensors and actuators with Arduino, opening the door to more complex home automation projects. Happy building! comments debug Comments Write a comment Write a comment Share Your Thoughts Be the first to write a comment.

  • Getting Started with DS18B20 Temperature Sensor

    Getting Started with DS18B20 Temperature Sensor This guide provides a clear, step-by-step process for getting started with the DS18B20 sensor and Arduino, making it easy for beginners to follow and understand. Description: The DS18B20 is a popular temperature sensor that provides accurate and reliable temperature readings in a variety of projects. In this guide, we’ll walk you through the steps to get started with the DS18B20 sensor and an Arduino board. Materials Needed: - Arduino board (e.g., Arduino Uno) - DS18B20 temperature sensor - 4.7k ohm resistor - Breadboard and jumper wires - Arduino IDE (installed on your computer) Step 1: Understanding the DS18B20 The DS18B20 is a digital temperature sensor that communicates over a 1-Wire bus, requiring only one data line for communication. It can measure temperatures in the range of -55°C to +125°C with an accuracy of ±0.5°C. Step 2: Wiring the DS18B20 First, identify the pins on the DS18B20: - GND: Ground - DQ: Data (1-Wire) - VDD: Power (3.3V to 5V) Now, connect the DS18B20 to the Arduino as follows: 1. Connect the GND pin of the DS18B20 to the GND pin on the Arduino. 2. Connect the VDD pin of the DS18B20 to the 5V pin on the Arduino. 3. Connect the DQ pin of the DS18B20 to digital pin 2 on the Arduino. 4. Place a 4.7k ohm resistor between the DQ pin and the VDD pin to act as a pull-up resistor. Step 3: Installing the Required Libraries To communicate with the DS18B20, you’ll need the OneWire and DallasTemperature libraries. Open the Arduino IDE and install these libraries: 1. Go to Sketch > Include Library > Manage Libraries. 2. Search for "OneWire" and install the library by Paul Stoffregen. 3. Search for "DallasTemperature" and install the library by Miles Burton. Step 4: Writing the Code Create a new sketch in the Arduino IDE and enter the following code: Step 5: Uploading the Code 1. Connect your Arduino to the computer using a USB cable. 2. Select the appropriate board and port from the Tools menu in the Arduino IDE. 3. Click the Upload button to upload the code to the Arduino. Step 6: Monitoring the Output Once the code is uploaded, open the Serial Monitor from the Tools menu. Set the baud rate to 9600. You should see the temperature readings from the DS18B20 sensor displayed in the Serial Monitor. Project Gallery All Documents : Download the below code to get started with DS18B20. Click Here to Download Download Video Tutorial : Conclusion : You’ve successfully set up the DS18B20 temperature sensor with your Arduino! Now you can integrate this sensor into various projects, such as weather stations, HVAC systems, or any application that requires accurate temperature monitoring. For more project ideas and tutorials, visit our website and explore Skill-Hub by EmbeddedBrew to enhance your embedded systems skills. Happy coding! comments debug Comments Write a comment Write a comment Share Your Thoughts Be the first to write a comment.

View All
bottom of page