Project Overview
This project aims to develop a smart home monitoring system using the Oolite V3.4 module. The main features include environmental monitoring, security surveillance, and device control within a home. The system will be integrated into the Home Assistant platform for unified device management and monitoring.
Hardware Preparation
- Oolite V3.4 Module (MT7688AN Chipset)
• Key Features:
• CPU: MT7628AN, 580/575 MHz MIPS 24KEc
• RAM: 64MB DDR2 (128MB/256MB optional)
• Flash: 16MB SPI NOR Flash ROM (8MB/32MB/64MB optional)
• WiFi: 2T2R 2.4 GHz, supporting 300Mbps 802.11 b/g/n
• GPIO: 37 pins
• USB: 1 x USB 2.0 master interface, support for USB hub extension
• Ethernet: 5-port 10/100 fast Ethernet switch
• Other interfaces: PCIe, UART, I2C, I2S, etc.
• Power supply voltage: 3.3V
• Size: 35mm x 20mm x 2.5mm (without shield) .
- Additional Components:
• Environmental sensors (temperature, humidity, air quality)
• Cameras for security surveillance
• Smart plugs and switches for device control
• Power supply and housing for the module and peripherals
Software Preparation
-
Home Assistant: Open-source home automation platform to be used for device integration and control.
-
OpenWRT: An open-source firmware for routers, which can be used as the operating system for the Oolite V3.4 module.
-
MQTT: Messaging protocol for communication between devices and Home Assistant.
Development Steps
- Setting Up the Development Environment:
• Install OpenWRT on the Oolite V3.4 module.
• Connect the module to the development machine via UART for debugging.
- Integrating Sensors and Devices:
• Connect environmental sensors to the GPIO pins on the Oolite V3.4 module.
• Connect cameras to the USB port or other suitable interfaces.
• Configure smart plugs and switches to be controlled by the module via GPIO or other interfaces.
- Software Development:
• Write scripts to read data from sensors and send it to Home Assistant using MQTT.
• Develop camera control software to handle streaming and motion detection.
• Create automation scripts in Home Assistant to manage device actions based on sensor data and user input.
- Testing and Deployment:
• Test the integration of all sensors, cameras, and devices with Home Assistant.
• Ensure reliable communication between the Oolite V3.4 module and Home Assistant.
• Optimize the system for power consumption and performance.
• Deploy the system in the target environment and monitor its performance.
Example Code Snippet
Here is an example of a Python script to read temperature and humidity data from a sensor and send it to Home Assistant via MQTT:
import paho.mqtt.client as mqtt
import Adafruit_DHT
Configuration
DHT_SENSOR = Adafruit_DHT.DHT22
DHT_PIN = 4
MQTT_BROKER = "home_assistant.local"
MQTT_PORT = 1883
`MQTT_TOPIC = “home/temperature”
Initialize MQTT client
client = mqtt.Client()
client.connect(MQTT_BROKER, MQTT_PORT, 60)
`def read_sensor():
humidity, temperature = Adafruit_DHT.read(DHT_SENSOR, DHT_PIN)
if humidity is not None and temperature is not None:
payload = f"{{"temperature": {temperature:.2f}, "humidity": {humidity:.2f}}}"
client.publish(MQTT_TOPIC, payload)
Main loop
`while True:
read_sensor()
time.sleep(60)
Forum Post Template
Below is a template for the forum post describing the project:
Title: Smart Home Monitoring System Using Oolite V3.4 Module
Introduction:
I recently completed a smart home monitoring project using the Oolite V3.4 module. The system features environmental monitoring, security surveillance, and device control, all integrated with Home Assistant. Here’s a detailed guide on how I developed this project.
Hardware Components:
• Oolite V3.4 Module (MT7688AN)
• Environmental sensors (temperature, humidity, air quality)
• Security cameras
• Smart plugs and switches
• Power supply and housing
Software Setup:
• OpenWRT on Oolite V3.4
• Home Assistant for device integration
• MQTT for communication
Development Process:
-
Setup: Installed OpenWRT, connected sensors, and cameras.
-
Integration: Developed scripts for sensor data and camera control.
-
Automation: Created Home Assistant automations for device control.
-
Testing: Ensured reliable communication and optimized performance.