top of page

Smart Home Delivery

The goal of this project is to design and implement a cost-effective and efficient home delivery system using simple components like the ESP32 microcontroller, ultrasonic sensor, and servo motor. The key technologies include Blynk, real-time notifications, and GPS location tracking.

To download the detailed report, click here.

The code for this project, including Arduino INO files and header files, is available on my GitHub.

Materials

  • ESP32 module with camera

  • Ultrasonic sensor - HC-SR04

  • SG90 9g micro servo motor

  • LCD module

  • Delivery Box

Each component has been selected for its specific role in the system, ensuring both cost-effectiveness and efficient functionality. The estimated budget for the project is approximately CAD 50.

System Overview

The system component diagram is illustrated in the following figure.

Emerging Technology Block Diagaram.drawio_v2.drawio.png

The system comprises both hardware and software components. The hardware includes an ESP32 microcontroller, ultrasonic sensor, servo motor, LCD module, camera module, courier phone, owner phone, and delivery box.

The software components involve a cloud server utilizing Blynk for data management, an Arduino program for hardware and software integration, a camera webserver for image data transmission, and a smart home delivery platform developed using Blynk for user interaction and system management.

The system flow chart is illustrated in the following figure.

Emerging Technology System Diagaram.drawio_rev6.drawio.png
  1. Start: Energize the ESP32. The Arduino code automatically runs.

  2. Wi-Fi Connection: Check if the ESP32 is connected to Wi-Fi.

  3. Initialize Homeowner App Settings: During the initial setup, all buttons in the homeowner app are set to ON by default. The user can adjust the button states as needed.

  4. Delivery Person Detection: The electronic components are activated when the courier enters the geofenced area. The homeowner's location should be pre-configured in the Arduino code. The camera connects to the server and becomes available for live streaming to the user.

  5. Delivery Box Unlocking: The storage box unlocks when the ultrasonic sensor detects the courier. The servo motor rotates 180 degrees to unlock the box. When rotated, it takes off the hook from the ring to allow the box to open. The status of both "Lock" and "Open" is displayed on the LCD module.

  6. User Notification: Notifications are sent to the homeowner via email when the deliv-ery box is unlocked, provided the notification button in the user app is turned on.

  7. Storage Box Locking: The storage box automatically locks 10 seconds after being closed. The servo motor rotates 180 degrees towards a reverse angle to lock the box. When rotated, the hook is fixed by the ring to prevent the box from opening.

  8. System Continuation: The system continues to operate until the ESP32 is de-energized.

System Development

After the following section, system development details will be explained in more detail.

User Application Development

The web and smartphone applications were developed using Blynk. The web application is designed using the “Blynk.Console” platform.

Web application interface.png

The smartphone app is built using the Blynk development app.

Smartphone app interface.png

Each components has the following function:

  • Uptime Label: Displays the total time the system has been in operation.

  • Activate System Switch: Allows users to enable or disable the system.

  • Email Notification Switch: Toggles the email notification feature on or off.

There are slight differences between the web and smartphone app interfaces due to platform differences. 

Wi-Fi Provisioning

Wi-Fi provisioning was utilized for Wi-Fi authentication. This function, provided by Blynk, allows users to build a Wi-Fi connection for an IoT device without coding. Users configure the Wi-Fi credentials (SSID and password) for their IoT device using the Blynk app. The initial setup interface is depicted in the following figure.

Geofencing

The geofencing mechanism ensures that when the delivery person enters the homeowner's vicinity, a signal is sent to the ESP32 device, unlocking the chest box. To realize this function, the delivery person uses IFTTT (for iPhone) or Termux (for Android) to send their GPS information to the Blynk platform. 

​For IFTTT, an "IF" and "Then" condition is set. “IF” is a button press, and “Then” is a web request, as shown in the following figure.

The request format is:
Format: https://{server_address}/external/api/update?token={token}&{pin}={value}

​

The button is created using the iPhone widget function, as shown in the following figure.

E-mail Notification

The E-mail Notification function is developed using the Blynk Notification tool. Before setting up this function, a user account must be created, including email address information. In the Blynk.Console platform, a new event, such as "button pressed," is created. In the Automation section of the platform, the "When" and "Do this" rules are defined. The "When" specifies the event, and the "Do this" action is set to "Send E-mail," selecting the appropriate user.

Results

The delivery box experiment is shown below.

Discussion

Key issues during hardware development highlighted the need for robust design:

  • ESP32 Reusability Issues: Reusing ESP32 modules caused unpredictable performance, emphasizing the need for new or thoroughly tested components.

  • Power Supply Instability: The initial 6V battery setup was unstable, requiring comprehensive testing for reliable future designs.

  • Connection Reliability: Excessive cable lengths caused frequent disconnections, underscoring the importance of minimizing cable lengths and soldering connections.

Challenges in software development reflected the complexities of scaling the system:

  • Codebase Management: The growing codebase became difficult to manage, requiring modular coding and clear file management.

  • GPS Accuracy: Smartphone GPS accuracy varied, affecting geofencing reliability. A buffer of 20 to 30 meters is recommended.

  • Camera Streaming: Reliable camera streaming requires a stable, high-speed Wi-Fi connection, suggesting the need for optimized streaming protocols.

Potential improvements to enhance functionality and resilience:

  • Emergency Unlock Mechanism: Adding a backup access method, like a physical key or Bluetooth connection.

  • Python Integration: Incorporating Python for advanced features and flexibility.

  • Location Tracking: Implementing real-time location tracking for more accurate notifications.

  • Image Storage: Enabling automatic image storage for later review.

Business strategies for effective commercialization:

  • Target Market: Positioning the product for delivery service companies seeking enhanced security.

  • Custom PCB Design: Developing a custom PCB for improved stability and reduced production costs.

  • Data Management: Transitioning to a robust database for secure, scalable data handling.

  • Custom Interface: Moving from Blynk to a tailored interface for greater flexibility and integration.

Conclusion

The Smart Home Delivery project demonstrates an innovative approach to secure and efficient home delivery systems using cost-effective components like the ESP32 microcontroller, ultrasonic sensors, and servo motors. The integration of Blynk for real-time notifications, GPS tracking, and user interaction underscores the potential for scalable IoT solutions. Despite challenges in hardware reliability, software scalability, and GPS accuracy, the project offers valuable insights for future enhancements, including improved emergency access, advanced location tracking, and custom PCB design. With strategic commercialization, this system could serve as a robust solution for delivery services seeking enhanced security and efficiency.

bottom of page