Rube Goldberg- Iot Machine Implementation
by Omer Hevdeli in Circuits > Arduino
203 Views, 1 Favorites, 0 Comments
Rube Goldberg- Iot Machine Implementation
Are you looking for a fun and complex project to challenge your skills and creativity? Look no further than this IOT system based on the Rob Goldberg principle. This system is designed to perform a simple task, but in a long and unnecessarily complicated way, creating an entertaining and satisfying experience for its users. In this project, we will be using Circuit Playground Express sensors and internet tools like Blynk, Integromat, Node-RED, and MQTT to create a chain of deliberate activations.
Have a look at the video and see by yourself.
Supplies
The five main technologies we used in our project :
1. CPX- Circuit Playground Express- a board packed with LEDs, buttons, alligator clip pads, and various sensors such as motion, temperature, sound, and light sensors.
In this project, we use the CPX for measuring the temperature and also use the sound sensor to detect when the alarm is turned on.
2. Blynk- Application that was designed for the Internet of Things. It can control hardware remotely, display sensor data, store data, visualize it, and more.
In this project, Blynk is used as the connective part between CPX and Integromat.
3. Integromat- Integromat is a simple automation tool that lets you connect your apps and automate repetitive tasks without coding. It has a user-friendly interface to create workflows (called "Scenarios") that can perform various tasks, like sending emails, updating databases, and more. It helps simplify your work and save time by automating routine tasks.
4. MQTT- MQTT is a communication protocol for the Internet of Things (IoT) and Machine-to-Machine (M2M) communication. It provides a lightweight, efficient, and reliable way for devices to communicate with each other over a network. Think of it like a language that allows different devices to understand and share information. For example, a weather sensor could use MQTT to send data to a computer, which could then display the information on a website. MQTT is designed to be simple and easy to use, making it a popular choice for IoT and M2M applications. It uses a publish/subscribe model, which means that devices can publish data to a topic, and other devices can subscribe to that topic to receive the data. This helps reduce the amount of data being transmitted and makes it easier to manage large numbers of devices. Overall, MQTT is a flexible and efficient way to connect devices and share data, making it an important part of the IoT landscape.
5. Node-Red- RED is a platform for wiring together hardware devices, APIs, and online services in new and interesting ways. It provides a visual interface for creating, managing, and connecting different components, making it easier to build things like home automation systems, IoT applications, and other connected devices.
Think of it like a virtual sandbox where you can drag and drop blocks to create a flow of information, and have those blocks communicate with each other to perform specific tasks. For example, you could create a flow that turns on your lights when you enter the room or sends you a text message when there's movement in your home. Node-RED is open source and available for anyone to use and modify, making it a popular choice for makers, hobbyists, and professionals alike. Whether you have the technical expertise or not, Node-RED can help you quickly prototype and build complex systems with ease.
Blynk Set Up
- Create a new template and project
- Copy the template id, name, and token to the first partner code.
- Create a new datastream and call it V0, sound as follows the image.
- Create a connection to this datastream using the gauge button.
Integromat Set Up
- Create a new scenario on the Integromat site.
- Choose "Webhooks" > "Custom webhook" > "Add".
- Choose "Re-determine data structure".
- Press "Copy address to clipboard". Open a new tab, and paste the address into the URL.
- Add "?sound={number}" to the end of the URL.
- Press Enter and check for the "Accepted" message on the screen.
- Add a new module to the webhook symbol by pressing the right side of the symbol on Integromat. Choose the device you are using and select "Send a push notification".
- Add your device by scanning the QR code in the Integromat app.
- Insert a title for the push notification. For the body, choose "message".
- Add filters to the connection as follows:
(a) router->Android: sound >=70. Moreover, add to the URL:https://hook.eu1.make.com/[webhook]?sound=1.
(b) router->Apple IOS: sound = 1.
(c) router->Apple IOS: sound = 0. Moreover, add to the URL:https://www.dominos.co.il/.
(e) router->Apple IOS: sound = 0.
- Click the clock symbol on the bottom left of the screen to choose how often to send push notifications.
- In your new Blynk project, scroll down the Widget Box (you can find it by sliding the screen left) and add a "WebHook" widget.
- Choose V0 as the output.
- Insert the same copied address from step 4. Add to message "?sound=/number/".
Mosquitto&Node-Red Set-Up
- Download raspi from the link.
- Download Mosquitto Mqtt from the link. Make sure you download Mosquitto according to your Operating System.
- Download Node.js from the link. Make sure you download it according to your Operating System.
- Download Node-Red from the link.
- Open the file conf.mosquito in the installation folder and add to the beginning of the file:
bind_address 0.0.0.0
allow_anonymous true
- Starting Mosquitto: You are done with installation. Now next step is to start the Mqtt server. Open the service option from the Start menu. Type "services.msc" in the input field. All services are opened in the window. Search for the name Mosquitto Broker in Services window (see picture). If the above service has not been started, right-click on the service and click on Start. If your broker does not work later you can restart or stop and start again.
- Starting Node-Red: open the cmd and write the command:
"node-red -v -c mosquitto.conf".
Now open your browser and put in the URL address: http://localhost:1880/
- all right!!! now we start to work with the node-red.
Node-Red
- To connect the MQTT server to node-red and get the message from the cpx server we need to use the mqtt-in node.
- Open the option of this node and define your mqtt-server.
- Note: you need to write "/temperature/msg" in the topic input.
- Now connect the switch node to the mqtt-in node.
- So that integromat will get an only massage when the temperature is bigger than the threshold, you need to define the option of the switch node.
- now we will use the HTTP request node to send a message to the integromat. All you need is to define the URL to be: "https://hook.eu1.make.com/[your hook URL]?sound=0".
- To the end you only need to press in the button Deploy.
Note: you can connect mqtt-in node to debug-node in order to see the temperature that thew cpx send to the mqtt server.
Downloads
You're Done!
Download the included file and open it in the Arduino editor.
Read the comments in the code and change the constants as you desire. For example, you can change the maximum sound/temp.
Change the following variables in the code:
"char auth[]" should be replaced with your auth key.
"char ssid[]" should be replaced with your WiFi SSID.
"char pass[]" should be replaced with your WiFi password.
IP...
Press the play button in the Arduino editor to compile and upload the code to the Circuit Playground.
Enjoy!!!