This is an example project how to use BigClown RS-485 Module to control different MODBUS relay board. This one is 8 channel and could be controller by pressing button on Core Module or thanks to Radio Dongle over radio and with MQTT commands.
RS-485 Module has also 5-28 V power supply so we will use this DC/DC converter to power Core Module.
Step 1: Build HardwareConnect Core Module and RS-485 together. The complete stack will be powered with 12 V power supply which will power relays and also Core Module. Also connect both RS-485 lines between RS-485 Module and Relay board.
Make sure the board has correct settings and address number 1. Check the DIP switches, all switches should be OFF except #1 is ON.
Step 2: Flash Firmware:Download BigClown Playground multiplatform GUI tool. This tool can flash firmware and also contains gateway for Radio Dongle and Node-RED where we will later control the relays
- Connect Core Module to your PC and wait until the FTDI driver is installed
- Run the BigClown Playground
- Go to the Firmware tab and choose bcf-radio-modbus-relay firmware
- Choose the correct serial COM port and press "FLASH FIRMWARE" button
- After flashing, the Core Module will turn on red LED for 2 seconds
See troubleshooting section or visit BigClown forum if something goes horribly wrong :)
Step 3: Pair NodeYou have to pair the wireless Core Module with Radio Dongle in your computer.
- Connect Radio Dongle to your computer
- In BigClown Playground go to Devices tab
- Choose the connected Radio Dongle from the list and click Connect
- Click Start pairing button
- Make sure Core Module is disconnected from USB and 12V power supply, now enable the 12 V power supply.
- The device will appear in the table
Open Node-RED in the Playground or Raspberry Pi and import the flow from this link in the Menu > Import > Clipboard.
This flow will appear
Do not forget to hit "Deploy" in the top right corner to apply the changes.
In Node-RED click on true/false inject nodes to wirelessly control relays 1-8.
You can also short press a button on Core Module to toggle relay 1 and by long-press toggle relay 2.
Final ThoughtsYou can use your server or single board computer like Raspberry Pi and run the Playground on it, just flash BigClown Raspbian on your SD card or install BigClown Gateway and tools on any computer with Python.
- Door Sensor project
- Radio Button Project
- Check out other BigClown projects.
- Take a look at the Module Overview.
- Learn about MQTTand BigClown MQTT topicsto control LEDs and relays.
- Try other integrationswith Grafana, Blynk, IFTTT, Ubidots and others.
- Use your Raspberry PIor other single board computer (SBC)as a server.
- Flash other firmwareor write your own firmwarefor the Core Module.
- Check the Core Module pinoutsand add your own buttons, relays and sensors.
Comments
Please log in or sign up to comment.