Kafkar.com
Published © GPL3+

Smiling Snowball

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

IntermediateFull instructions provided4 hours2,806

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

Read more

Schematics

Smiling snowball schematic

Smiling snowball schematic

Smiling snow ball Schematic

Schematic

Code

node-red app

JSON
This is the code of the node-red app. This should be load into the node-red application
[
    {
        "id": "fbd88594.573d08",
        "type": "mqtt out",
        "z": "daed2f2c.21fb8",
        "name": "toSnowball",
        "topic": "/example",
        "qos": "",
        "retain": "",
        "broker": "a12126f8.1e69a",
        "x": 387.5,
        "y": 1592,
        "wires": []
    },
    {
        "id": "db9dce3e.43013",
        "type": "debug",
        "z": "daed2f2c.21fb8",
        "name": "",
        "active": false,
        "console": "false",
        "complete": "payload",
        "x": 388.5,
        "y": 1639,
        "wires": []
    },
    {
        "id": "861e8949.06186",
        "type": "mqtt in",
        "z": "daed2f2c.21fb8",
        "name": "FromSnowBall",
        "topic": "hearbeat",
        "qos": "0",
        "broker": "a12126f8.1e69a",
        "x": 138.5,
        "y": 1641,
        "wires": [
            [
                "db9dce3e.43013",
                "fbd88594.573d08"
            ]
        ]
    },
    {
        "id": "b0a220f.ab1a1e",
        "type": "ui_button",
        "z": "daed2f2c.21fb8",
        "name": "",
        "group": "83d787c8.772b68",
        "order": 5,
        "width": "2",
        "height": "1",
        "label": "Center",
        "color": "",
        "icon": "",
        "payload": "center",
        "payloadType": "str",
        "topic": "",
        "x": 671.5,
        "y": 883,
        "wires": [
            [
                "8bdf49a8.2eeba8"
            ]
        ]
    },
    {
        "id": "2457b666.54195a",
        "type": "ui_button",
        "z": "daed2f2c.21fb8",
        "name": "",
        "group": "83d787c8.772b68",
        "order": 4,
        "width": "2",
        "height": "1",
        "label": "Left",
        "color": "",
        "icon": "",
        "payload": "left",
        "payloadType": "str",
        "topic": "",
        "x": 524.5,
        "y": 879,
        "wires": [
            [
                "8bdf49a8.2eeba8"
            ]
        ]
    },
    {
        "id": "80872600.e2fa48",
        "type": "ui_button",
        "z": "daed2f2c.21fb8",
        "name": "",
        "group": "83d787c8.772b68",
        "order": 6,
        "width": "2",
        "height": "1",
        "label": "Right",
        "color": "",
        "icon": "",
        "payload": "right",
        "payloadType": "str",
        "topic": "",
        "x": 838.5,
        "y": 882,
        "wires": [
            [
                "8bdf49a8.2eeba8"
            ]
        ]
    },
    {
        "id": "28643fd9.ad6518",
        "type": "ui_button",
        "z": "daed2f2c.21fb8",
        "name": "",
        "group": "83d787c8.772b68",
        "order": 2,
        "width": "2",
        "height": "1",
        "label": "Top",
        "color": "",
        "icon": "",
        "payload": "top",
        "payloadType": "str",
        "topic": "",
        "x": 666.5,
        "y": 826,
        "wires": [
            [
                "8bdf49a8.2eeba8"
            ]
        ]
    },
    {
        "id": "5b7dd8cc.005a08",
        "type": "ui_button",
        "z": "daed2f2c.21fb8",
        "name": "",
        "group": "83d787c8.772b68",
        "order": 8,
        "width": "2",
        "height": "1",
        "label": "bottom",
        "color": "",
        "icon": "",
        "payload": "bottom",
        "payloadType": "str",
        "topic": "",
        "x": 693.5,
        "y": 949,
        "wires": [
            [
                "8bdf49a8.2eeba8"
            ]
        ]
    },
    {
        "id": "8bdf49a8.2eeba8",
        "type": "mqtt out",
        "z": "daed2f2c.21fb8",
        "name": "toSnowball",
        "topic": "/eyes",
        "qos": "",
        "retain": "",
        "broker": "a12126f8.1e69a",
        "x": 1032,
        "y": 1056,
        "wires": []
    },
    {
        "id": "93a67924.f83e38",
        "type": "ui_button",
        "z": "daed2f2c.21fb8",
        "name": "small",
        "group": "e00f2901.fe8838",
        "order": 1,
        "width": 0,
        "height": 0,
        "label": "Small",
        "color": "",
        "icon": "",
        "payload": "small",
        "payloadType": "str",
        "topic": "small",
        "x": 839.5,
        "y": 1309,
        "wires": [
            [
                "6220adf8.7af16c"
            ]
        ]
    },
    {
        "id": "6220adf8.7af16c",
        "type": "mqtt out",
        "z": "daed2f2c.21fb8",
        "name": "toSnowball",
        "topic": "/nose",
        "qos": "",
        "retain": "",
        "broker": "a12126f8.1e69a",
        "x": 1033,
        "y": 1405,
        "wires": []
    },
    {
        "id": "7ac858e1.80f348",
        "type": "ui_button",
        "z": "daed2f2c.21fb8",
        "name": "",
        "group": "e00f2901.fe8838",
        "order": 3,
        "width": 0,
        "height": 0,
        "label": "Large",
        "color": "",
        "icon": "",
        "payload": "large",
        "payloadType": "str",
        "topic": "",
        "x": 835,
        "y": 1397,
        "wires": [
            [
                "6220adf8.7af16c"
            ]
        ]
    },
    {
        "id": "2607a19.14ac25e",
        "type": "ui_button",
        "z": "daed2f2c.21fb8",
        "name": "",
        "group": "e00f2901.fe8838",
        "order": 2,
        "width": 0,
        "height": 0,
        "label": "Medium",
        "color": "",
        "icon": "",
        "payload": "medium",
        "payloadType": "str",
        "topic": "",
        "x": 827,
        "y": 1355,
        "wires": [
            [
                "6220adf8.7af16c"
            ]
        ]
    },
    {
        "id": "f85268ea.68839",
        "type": "ui_button",
        "z": "daed2f2c.21fb8",
        "name": "",
        "group": "e00f2901.fe8838",
        "order": 4,
        "width": 0,
        "height": 0,
        "label": "Big",
        "color": "",
        "icon": "",
        "payload": "big",
        "payloadType": "str",
        "topic": "",
        "x": 833,
        "y": 1437,
        "wires": [
            [
                "6220adf8.7af16c"
            ]
        ]
    },
    {
        "id": "3b99d679.c539ca",
        "type": "ui_slider",
        "z": "daed2f2c.21fb8",
        "name": "delay",
        "label": "slider",
        "group": "e00f2901.fe8838",
        "order": 0,
        "width": 0,
        "height": 0,
        "passthru": true,
        "topic": "delay",
        "min": "1",
        "max": "20",
        "step": 1,
        "x": 830.5,
        "y": 1519,
        "wires": [
            [
                "f87468fd.38345"
            ]
        ]
    },
    {
        "id": "f3252a6e.a16e3",
        "type": "ui_switch",
        "z": "daed2f2c.21fb8",
        "name": "",
        "label": "switch",
        "group": "e00f2901.fe8838",
        "order": 0,
        "width": 0,
        "height": 0,
        "passthru": true,
        "topic": "",
        "style": "",
        "onvalue": "loop",
        "onvalueType": "str",
        "onicon": "",
        "oncolor": "",
        "offvalue": "stop",
        "offvalueType": "str",
        "officon": "",
        "offcolor": "",
        "x": 831.5,
        "y": 1476,
        "wires": [
            [
                "6220adf8.7af16c"
            ]
        ]
    },
    {
        "id": "f87468fd.38345",
        "type": "mqtt out",
        "z": "daed2f2c.21fb8",
        "name": "toSnowball",
        "topic": "/nose/delay",
        "qos": "",
        "retain": "",
        "broker": "a12126f8.1e69a",
        "x": 1028,
        "y": 1520,
        "wires": []
    },
    {
        "id": "4e38fe97.d8c688",
        "type": "mqtt out",
        "z": "daed2f2c.21fb8",
        "name": "toSnowball/mouth",
        "topic": "/mouth",
        "qos": "",
        "retain": "",
        "broker": "a12126f8.1e69a",
        "x": 1071,
        "y": 1705,
        "wires": []
    },
    {
        "id": "d7fd70d3.cfdac",
        "type": "ui_button",
        "z": "daed2f2c.21fb8",
        "name": "",
        "group": "1aba77e1.bdd988",
        "order": 0,
        "width": 0,
        "height": 0,
        "label": "Normal",
        "color": "",
        "icon": "",
        "payload": "smile",
        "payloadType": "str",
        "topic": "",
        "x": 843.5,
        "y": 1676,
        "wires": [
            [
                "4e38fe97.d8c688"
            ]
        ]
    },
    {
        "id": "43b5ca11.00f104",
        "type": "ui_button",
        "z": "daed2f2c.21fb8",
        "name": "",
        "group": "1aba77e1.bdd988",
        "order": 0,
        "width": 0,
        "height": 0,
        "label": "smile",
        "color": "",
        "icon": "",
        "payload": "normal",
        "payloadType": "str",
        "topic": "",
        "x": 831.5,
        "y": 1725,
        "wires": [
            [
                "4e38fe97.d8c688"
            ]
        ]
    },
    {
        "id": "ef75f714.bcaee",
        "type": "ui_button",
        "z": "daed2f2c.21fb8",
        "name": "",
        "group": "1aba77e1.bdd988",
        "order": 0,
        "width": 0,
        "height": 0,
        "label": "open",
        "color": "",
        "icon": "",
        "payload": "sad",
        "payloadType": "str",
        "topic": "",
        "x": 828.5,
        "y": 1779,
        "wires": [
            [
                "4e38fe97.d8c688"
            ]
        ]
    },
    {
        "id": "80e9b7d.b16e748",
        "type": "ui_button",
        "z": "daed2f2c.21fb8",
        "name": "",
        "group": "83d787c8.772b68",
        "order": 11,
        "width": "3",
        "height": "1",
        "label": "wink left",
        "color": "",
        "icon": "",
        "payload": "closeleft",
        "payloadType": "str",
        "topic": "",
        "x": 585.5,
        "y": 1041,
        "wires": [
            [
                "8bdf49a8.2eeba8",
                "e0584be7.8521e"
            ]
        ]
    },
    {
        "id": "97d7bcd7.21817",
        "type": "ui_button",
        "z": "daed2f2c.21fb8",
        "name": "",
        "group": "83d787c8.772b68",
        "order": 12,
        "width": "3",
        "height": "1",
        "label": "wink right",
        "color": "",
        "icon": "",
        "payload": "closeright",
        "payloadType": "str",
        "topic": "",
        "x": 418,
        "y": 1052,
        "wires": [
            [
                "8bdf49a8.2eeba8",
                "e0584be7.8521e"
            ]
        ]
    },
    {
        "id": "e0584be7.8521e",
        "type": "delay",
        "z": "daed2f2c.21fb8",
        "name": "",
        "pauseType": "delay",
        "timeout": "600",
        "timeoutUnits": "milliseconds",
        "rate": "1",
        "nbRateUnits": "1",
        "rateUnits": "second",
        "randomFirst": "1",
        "randomLast": "5",
        "randomUnits": "seconds",
        "drop": false,
        "x": 614.5,
        "y": 1203,
        "wires": [
            [
                "dd1a4d7a.b1657"
            ]
        ]
    },
    {
        "id": "dd1a4d7a.b1657",
        "type": "function",
        "z": "daed2f2c.21fb8",
        "name": "",
        "func": "msg.payload = \"center\"\nreturn msg;",
        "outputs": 1,
        "noerr": 0,
        "x": 785.5,
        "y": 1204,
        "wires": [
            [
                "8bdf49a8.2eeba8"
            ]
        ]
    },
    {
        "id": "56b9ffe4.6808f8",
        "type": "ui_button",
        "z": "daed2f2c.21fb8",
        "name": "",
        "group": "83d787c8.772b68",
        "order": 7,
        "width": "2",
        "height": "1",
        "label": "bottomleft",
        "color": "",
        "icon": "",
        "payload": "bottomleft",
        "payloadType": "str",
        "topic": "",
        "x": 541,
        "y": 944,
        "wires": [
            [
                "8bdf49a8.2eeba8"
            ]
        ]
    },
    {
        "id": "e7ea10fb.7d314",
        "type": "ui_button",
        "z": "daed2f2c.21fb8",
        "name": "",
        "group": "83d787c8.772b68",
        "order": 1,
        "width": "2",
        "height": "1",
        "label": "topleft",
        "color": "",
        "icon": "",
        "payload": "topleft",
        "payloadType": "str",
        "topic": "",
        "x": 520,
        "y": 827,
        "wires": [
            [
                "8bdf49a8.2eeba8"
            ]
        ]
    },
    {
        "id": "bf268514.385748",
        "type": "ui_button",
        "z": "daed2f2c.21fb8",
        "name": "",
        "group": "83d787c8.772b68",
        "order": 3,
        "width": "2",
        "height": "1",
        "label": "topright",
        "color": "",
        "icon": "",
        "payload": "topright",
        "payloadType": "str",
        "topic": "",
        "x": 837,
        "y": 827,
        "wires": [
            [
                "8bdf49a8.2eeba8"
            ]
        ]
    },
    {
        "id": "592a2c8d.3fb214",
        "type": "ui_button",
        "z": "daed2f2c.21fb8",
        "name": "",
        "group": "83d787c8.772b68",
        "order": 9,
        "width": "2",
        "height": "1",
        "label": "bottomright",
        "color": "",
        "icon": "",
        "payload": "bottomright",
        "payloadType": "str",
        "topic": "",
        "x": 841,
        "y": 949,
        "wires": [
            [
                "8bdf49a8.2eeba8"
            ]
        ]
    },
    {
        "id": "235349b8.aca95e",
        "type": "ui_button",
        "z": "daed2f2c.21fb8",
        "name": "",
        "group": "83d787c8.772b68",
        "order": 13,
        "width": "3",
        "height": "1",
        "label": "close left",
        "color": "",
        "icon": "",
        "payload": "closeleft",
        "payloadType": "str",
        "topic": "",
        "x": 409,
        "y": 1124,
        "wires": [
            [
                "8bdf49a8.2eeba8"
            ]
        ]
    },
    {
        "id": "b3ca271c.fad09",
        "type": "ui_button",
        "z": "daed2f2c.21fb8",
        "name": "",
        "group": "83d787c8.772b68",
        "order": 14,
        "width": "3",
        "height": "1",
        "label": "close right",
        "color": "",
        "icon": "",
        "payload": "closeright",
        "payloadType": "str",
        "topic": "",
        "x": 576,
        "y": 1128,
        "wires": [
            [
                "8bdf49a8.2eeba8"
            ]
        ]
    },
    {
        "id": "6f5983c4.333704",
        "type": "ui_button",
        "z": "daed2f2c.21fb8",
        "name": "",
        "group": "83d787c8.772b68",
        "order": 10,
        "width": "6",
        "height": "1",
        "label": "",
        "color": "",
        "icon": "",
        "payload": "",
        "payloadType": "str",
        "topic": "",
        "x": 378.5,
        "y": 995,
        "wires": [
            []
        ]
    },
    {
        "id": "a12126f8.1e69a",
        "type": "mqtt-broker",
        "z": "",
        "broker": "broker.shiftr.io",
        "port": "1883",
        "clientid": "snowballcontrol",
        "usetls": false,
        "compatmode": true,
        "keepalive": "60",
        "cleansession": true,
        "willTopic": "",
        "willQos": "0",
        "willRetain": "false",
        "willPayload": "",
        "birthTopic": "",
        "birthQos": "0",
        "birthRetain": "false",
        "birthPayload": ""
    },
    {
        "id": "83d787c8.772b68",
        "type": "ui_group",
        "z": "",
        "name": "eyes",
        "tab": "d56be19f.f63f8",
        "disp": true,
        "width": "6"
    },
    {
        "id": "e00f2901.fe8838",
        "type": "ui_group",
        "z": "",
        "name": "nose",
        "tab": "2e8148a8.8d124",
        "order": 1,
        "disp": true,
        "width": "6"
    },
    {
        "id": "1aba77e1.bdd988",
        "type": "ui_group",
        "z": "",
        "name": "mouth",
        "tab": "546282df.7056d4",
        "disp": true,
        "width": "6"
    },
    {
        "id": "d56be19f.f63f8",
        "type": "ui_tab",
        "z": "",
        "name": "eyes",
        "icon": "dashboard"
    },
    {
        "id": "2e8148a8.8d124",
        "type": "ui_tab",
        "z": "",
        "name": "nose",
        "icon": "nose",
        "order": 3
    },
    {
        "id": "546282df.7056d4",
        "type": "ui_tab",
        "z": "",
        "name": "Mouth",
        "icon": "dashboard"
    }
]

MatrixControl

Liberary for controlling the led matrix based on the MAX7219

Arduino code

Smiling snowball code

Credits

Kafkar.com

Kafkar.com

2 projects • 1 follower

Comments