I have Motion Detector to turn on the lights on when I go to the basement. But sometimes I get detected when I step on the stairs which is not perfect when is completely dark.
So I needed to solve that and turn on the light ideally when I open the doors. The magnetic contact is nice and I already did project on that. But I wanted to find out if the accelerometer sensor which is on the Core Module should react:
- low power
The Radio Shock Sensor connects over 868 MHz FSK radio to the Raspberry Pi thanks to Radio Dongle.
It would be also extremly simple to connect Sigfox Module or LoRa Module and talk directly to the cloud. That way you can monitor places up in the wild. But let's get back to the BigClown 868 MHz local network this project is using.
Raspberry Pi has pre-installed "bc-raspbian" which is Raspbian with MQTT broker, Node-RED and Radio Gateway Service. You can install these services yourself to your Rpi or any computer. Just follow the documentation.
The current consumption of the Core Module is 40 uA. So it will last very long on the batteries. But it depends on how much the module sends data.
Step 1: Build Hardware
The hardware is just Core Module with Mini Battery Module
Download BigClown Playground multiplatform GUI tool to your computer. This tool can flash firmware and also contains other features like MQTT and Node-RED. But we will not use them since the brain of our system will be the Raspberry Pi with bc-raspbian (explained later)
- Connect Core Module to your PC and wait until the FTDI driver is installed
- Run the BigClown Playground
- Download binary file or copy the URL of the latest firmware file to the clipboard
- Go to the Firmware tab and choose the downloaded file from the disk or paste URL from clipboard with Ctrl+V
- Choose the correct serial COM port and press "FLASH FIRMWARE" button
- After flashing, the Core Module will turn on red LED for 2 seconds
- After power-up it displays "BigClwn" text on the display
The Radio Dongle comes pre-flashed but we suggeest to update it to the latest version. Disconnect the Core Module, connect Radio Dongle and flash it with bcf-gateway-usb-dongle firmware
You can close the BigClown Playground. From now you will use the BigClown Hub in your browser that will be running on the Raspberry Pi. However these tools looks similar and it is possible to test steps below just in the Playground and do not use Raspberry Pi.
Download and copy the bc-raspbian to the micro SD card. You can also install the services manually on clean Raspbian or run them on any Linux single board computer. Follow this documentation.
After flashing, put the card to the Raspberry Pi, plug-in the Radio Dongle, connect network cable and power cable, boot the Rpi up.
You can connect to the BigClown Hub, open in your browser page.
hub.localin case you used bc-raspbian
raspberry.localin case you installed tools on clean Raspbian
- By typing IP address or the Raspi
Detailed documentation of this step is in the documentation.
From here we will use the BigClown Hub in your browser.
You need to pair LED Display Core Module with Radio Dongle:
- Disconnect power from the LED Display Core Module
- Go to the Devices tab and click Start Pairing
- Power on the LED Display Core Module
- The newly paired device will appear in the table
- Click Stop Pairing
Check that you have the same name of the module, it has to be the same because we use that name later in MQTT topics. You can rename the node to the right name.
Now we add the function. This tutorial shows flow to turn on the IKEA TRADFRI lightbulb. But you can connect the flow and control anything you like. You can for example configure to get notification to your phone. I suggest Blynk for that, check my other tutorials where I use Blynk.
Switch to the
Functions tab whre the Node-RED is and in the top-right menu select
Menu > Import > Clipboard
Copy and paste the text from this gist. Press Import. You will see something like this.
PressDEPLOY in the top-right corner to apply changes.
The Core Module has also button, accelerometer and temperature sensor. You can edit the original source code and extend functionality to trigger some other event.
- Door Sensor project
- Radio Button Project
- Check out other BigClown projects.
- Take a look at the Module Overview.
- Learn about MQTT and BigClown MQTT topics to control LEDs and relays.
- Try other integrations with Grafana, Blynk, IFTTT, Ubidots and others.
- Use your Raspberry PI or other single board computer (SBC) as a server.
- Flash other firmware or write your own firmware for the Core Module.
- Check the Core Module pinouts and add your own buttons, relays and sensors.