Skip to content

FlamingoLindo/PRIVATRON3000

Repository files navigation

PRIVATRON3000

Overview

PRIVATRON3000 is an IoT-based smart system designed to enhance comfort and automation in personal spaces. It integrates various sensors, actuators, and control mechanisms to provide features such as motion detection, temperature monitoring, light control, proximity sensing, and remote operation via MQTT.

Features

  • Motion Detection: Detects movement using a PIR sensor.
  • Temperature and Humidity Monitoring: Reads temperature and humidity using a DHT22 sensor.
  • Proximity Monitoring: Measures distance using an ultrasonic sensor to detect user presence.
  • Seat Heater Control: Automatically activates a seat heater based on temperature readings.
  • Water Sprayer: Operates a water sprayer for cleaning purposes, controlled by a button or remotely via MQTT.
  • Ambient Light Control: Adjusts room lighting based on luminosity readings from a photoresistor.
  • Buzzer Alerts: Activates a buzzer for notifications when specific conditions are met.
  • Remote Control: Allows remote operation of features via MQTT messages.
  • RGB LED Indicators: Provides visual feedback using RGB LEDs.

Components

Sensors

  • PIR Motion Sensor: Detects movement.
  • DHT22: Measures temperature and humidity.
  • HC-SR04 Ultrasonic Sensor: Measures distance.
  • Photoresistor: Detects ambient light levels.

Actuators

  • Relay Modules: Control seat heater and water sprayer.
  • Servo Motor: Operates the water sprayer mechanism.
  • Buzzer: Provides audible alerts.
  • RGB LED: Displays status visually.

Microcontroller

  • ESP32: Handles sensor readings, actuator control, and MQTT communication.

Installation

  1. Hardware Setup:

    • Connect the sensors and actuators as per the wiring diagram in diagram.json.
    • Ensure the ESP32 is properly powered and connected to the components.
  2. Software Setup:

    • Install MicroPython on the ESP32.
    • Upload all Python files (main.py, state.py, etc.) to the ESP32 using a tool like ampy or Thonny.
  3. MQTT Configuration:

    • Ensure the MQTT broker is accessible (default: broker.hivemq.com).
    • Update the Wi-Fi credentials and MQTT settings in connections.py.

Usage

  1. Power on the system.
  2. The ESP32 will connect to Wi-Fi and the MQTT broker.
  3. The system will start monitoring sensors and controlling actuators based on the logic defined in main.py.
  4. Use the MQTT topic flamingo_lindo/botao to remotely control the water sprayer:
    • Send 1 to activate the sprayer.
    • Send 0 to deactivate the sprayer.

File Structure

  • main.py: Main program logic.
  • state.py: Maintains the system's state.
  • connections.py: Handles Wi-Fi and MQTT connections.
  • motion.py: Detects motion using the PIR sensor.
  • temp_hum.py: Reads temperature and humidity from the DHT22 sensor.
  • ultra_sonic.py: Measures proximity using the ultrasonic sensor.
  • lights.py: Controls ambient and RGB lights.
  • rel.py: Operates relays for the seat heater and water sprayer.
  • btn.py: Reads the button state.
  • diagram.json: Contains the wiring diagram for the hardware setup.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages