Step 1: Mounting WisBlock Parts
Assemble the RAK4631 WisBlock Core onto the RAK19003 WisBlock Base Board. Connect the RAK12033 motion sensor, RAK1906 environmental sensor, and RAK12004 ambient light sensor to available slots. Attach the RAK1921 power module. Integrate the RAK13009 and/or RAK13010 relay modules, connecting them to control building lights and HVAC systems.
Step 2: Link to PC (via USB Cable)
Connect the assembled WisBlock unit (via the RAK4631) to your PC using a standard USB cable.
Step 3: Setup Arduino IDE and Load Files
Configure Arduino IDE for the RAK4631. Install libraries for the RAK12033 (e.g., Adafruit LIS3DH if it's an accelerometer-based motion, or generic PIR library), RAK1906 (BME680), and RAK12004. Load the Arduino sketch that reads sensor data and controls relays based on logic.
Step 4: Upload the Code
Select RAK4631 Board and the correct COM port. Upload the code to your WisBlock device. After successful upload, open the Serial Monitor (set Baud rate to 15200) to observe motion detection, environmental readings, and light levels. The device will send this data via LoRaWAN to your RAK7268V2 gateway. TheThingsNetwork will then forward this data to Home Assistant (or OpenHAB). Home Assistant will execute automation rules: if occupancy is detected and light levels are low, turn on lights; if no occupancy and good light, turn off lights. It can also adjust HVAC based on temperature/humidity/VOC levels, significantly reducing energy waste. Grafana can visualize historical data.
Explanation: The code initializes the RAK4631, the RAK12033 motion sensor (for occupancy detection), the RAK1906 environmental sensor (temperature, humidity, air quality), and the RAK12004 ambient light sensor. It reads these values periodically. The RAK13009/RAK13010 relays are controlled based on commands received. Sensor data is transmitted via LoRaWAN to TheThingsNetwork. Home Assistant (or OpenHAB) is integrated to receive this data. Automation rules within Home Assistant use occupancy, light, and environmental data to intelligently control lighting and HVAC systems. For example, lights turn on only when motion is detected and the room is dark, and HVAC adjusts based on real-time temperature, humidity, and air quality, leading to substantial energy savings and a more comfortable indoor environment.
Comments