Smiling Snowball

A web-controlled smiling snowball based on the Arduino MKR1000 controlled via WiFi using MQTT, Shitr.io and Node-red.

Things used in this project

Hardware components

Arduino MKR1000
Arduino MKR1000
× 1
LED matrix 8 x 8 (MAX7219)
× 6
Jumper wires (generic)
Jumper wires (generic)
× 1
cardboard 40 cm x 40 cm (15.7 inch x 15.7 inch)
× 1
blank paper
× 1

Software apps and online services

Node-RED
Node-RED
Shiftr.io
Arduino Web Editor
Arduino Web Editor

Hand tools and fabrication machines

scissors
hobby knife

Story

screen_shot_2017-01-28_at_11_AznXIjFPBR

The LED matrices connected to the Arduino MKR1000 are divided into two groups of 3; this is to prove the communication of two led sets. For controlling the matrices, a LED matrix lib is created (current available matrix libraries did not work correctly on the Arduino MKR1000). The library is stored on GitHub.

If the settings for the WiFi in MQTT broker are correctly filled in in the application, it can be built and uploaded to the Arduino MKR1000. After installing the software, a default face will become visible if everything is connected correctly.

This is how it looks if you have also made the snowball as described later in this story.

MQTT broker (Shiftr.io)

As an online MQTT broker, the Shiftr.io is used. This is a broker specific for prototyping. To start using it, you should signup to create your own account.

After that, you can go to your own dashboard and create a namespace. Within the namespace, you should create a token (config button after the namespace name). The token should be filled in the Arduino code and in the Node-RED configuration.

For the Arduino code, look for the line:

client.connect("snowball", "#######", "##################")  

Node-RED

Node-RED should be installed on a PC/RasberryPi or other system in the network. If you use your own MQTT broker, it is possible to use the same system for it. How to install Node-RED is described here: http://nodered.org/docs/getting-started/installation.

If Node-RED is installed, you should add the node: node-red-dashboard – see here. This is needed to create a web based dashboard. After installing this, Node-RED can be started. Go to the Node-RED page. Mostly localhost:1880but see this on your terminal.

After starting Node-RED, you should load the Node-RED application in to the Node-RED environment. Do this by copying the Node-RED application on this page and inserting it in to your Node-RED environment. At the right top of the Node-RED screen, there is a config/settings icon. Click on this icon and then select import from clipboard, and import the application as new. After loading the Node-RED application, you should see the following:

screen_shot_2017-01-28_at_00_4kVFqb9e02

The application is now loaded. To get it up and running, the application should be deployed. Before deploying the application, the MQTT settings should be set correctly, the link to the server and the token. To do that, search for a MQTT node.

Click on it and you see the following popup screen:

Click on the edit button after server and the edit screen for updating the server appears.

Fill in your server address. Select the tab Security and also fill in your token. Now the noded application can be deployed.

Open a new web browser window and go to the dashboard. The dashboard has the same address as the Node-RED application but with /UI(localhost:1880/ui/):


About The Author

Ibrar Ayyub

I am an experienced technical writer holding a Master's degree in computer science from BZU Multan, Pakistan University. With a background spanning various industries, particularly in home automation and engineering, I have honed my skills in crafting clear and concise content. Proficient in leveraging infographics and diagrams, I strive to simplify complex concepts for readers. My strength lies in thorough research and presenting information in a structured and logical format.

Follow Us:
LinkedinTwitter

Leave a Comment

Your email address will not be published. Required fields are marked *

Scroll to Top