-
1Prepare the pumpkin
Make eyes, mouth but maily the nose. In the nose you can hide PIR sensor.
-
2Connect the modules
Build the project from modules. Use Core Module and Power Module.
Connect LED strip to the LED connector on the Power Module.
Use 5V DC Adapter to power the whole stack of modules.
The servo motor takes 5V and GND from the LED strip connector, servo signal is connected to the P14 pin.
-
3Place LEDs
LEDs should be located in the front so they cannot be seen from outside, just the flooded light.
-
4Place Servo motor
The servo motor is located on the bottom. It is secured by zip-tie that goes to the two holes in the bottom of the pumpkin.
Use thick wire to connect the servo lever and the top cover of the pumpkin.
-
5Node-RED & MQTT
You can program all the scenario inside the Core Module, but thanks to wireless transmission and cheap computers like Raspberry Pi you can have IoT pumpkin and even change behavior over internet.
Download BigClown Playground for your computer or use Raspberry Pi with bc-raspbian, which has Node-RED and all the services pre-installed.
Import code below to the Node-RED so you will get the flow to control the pumpkin.
[{"id":"466eb367.28b9ec","type":"mqtt out","z":"1fb8e2b0.d420fd","name":"","topic":"node/scary-pumpkin:0/led-strip/-/effect/set","qos":"","retain":"","broker":"29fba84a.b2af58","x":840,"y":280,"wires":[]},{"id":"ab24c5c0.975768","type":"inject","z":"1fb8e2b0.d420fd","name":"red pulse-color","topic":"","payload":"{\"type\":\"pulse-color\", \"wait\":50, \"color\":\"#ff0000\"}","payloadType":"str","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":500,"y":280,"wires":[["466eb367.28b9ec"]]},{"id":"55d259fc.f0f258","type":"inject","z":"1fb8e2b0.d420fd","name":"","topic":"","payload":"\"#003000(20)\"","payloadType":"str","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":870,"y":440,"wires":[["54911caa.b2b674"]]},{"id":"54911caa.b2b674","type":"mqtt out","z":"1fb8e2b0.d420fd","name":"","topic":"node/scary-pumpkin:0/led-strip/-/color/set","qos":"","retain":"","broker":"29fba84a.b2af58","x":1160,"y":480,"wires":[]},{"id":"16edb5de.77334a","type":"mqtt in","z":"1fb8e2b0.d420fd","name":"","topic":"node/scary-pumpkin:0/pir/-/event-count","qos":"2","broker":"29fba84a.b2af58","x":230,"y":400,"wires":[["e1ae9775.a97e28"]]},{"id":"dc8f970.db0b268","type":"delay","z":"1fb8e2b0.d420fd","name":"","pauseType":"delay","timeout":"3","timeoutUnits":"seconds","rate":"1","nbRateUnits":"1","rateUnits":"second","randomFirst":"1","randomLast":"5","randomUnits":"seconds","drop":false,"x":700,"y":500,"wires":[["3febe75d.86ab88","4bb17406.ceeb9c","43751750.11aff8"]]},{"id":"9d71db51.b7cd68","type":"change","z":"1fb8e2b0.d420fd","name":"green pulsing","rules":[{"t":"set","p":"payload","pt":"msg","to":"{\"type\":\"pulse-color\", \"wait\":10, \"color\":\"#003000(20)\"}","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":520,"y":320,"wires":[["466eb367.28b9ec"]]},{"id":"3febe75d.86ab88","type":"change","z":"1fb8e2b0.d420fd","name":"still color","rules":[{"t":"set","p":"payload","pt":"msg","to":"\"#200000(10)\"","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":880,"y":480,"wires":[["54911caa.b2b674"]]},{"id":"a8f8ac54.b628f","type":"inject","z":"1fb8e2b0.d420fd","name":"icicle","topic":"","payload":"{\"type\":\"icicle\", \"wait\":50, \"color\":\"#ff0000\"}","payloadType":"str","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":470,"y":240,"wires":[["466eb367.28b9ec"]]},{"id":"ee58a174.e4e32","type":"inject","z":"1fb8e2b0.d420fd","name":"color wipe","topic":"","payload":"{\"type\":\"color-wipe\", \"wait\":50, \"color\":\"#800000\"}","payloadType":"str","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":480,"y":200,"wires":[["466eb367.28b9ec"]]},{"id":"820d7e11.b4b55","type":"inject","z":"1fb8e2b0.d420fd","name":"stroboscope","topic":"","payload":"{\"type\":\"stroboscope\", \"wait\":50, \"color\":\"#0000ff\"}","payloadType":"str","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":470,"y":160,"wires":[["466eb367.28b9ec"]]},{"id":"94832bd5.41e3b8","type":"mqtt out","z":"1fb8e2b0.d420fd","name":"","topic":"node/scary-pumpkin:0/servo/p14/angle/set","qos":"","retain":"","broker":"29fba84a.b2af58","x":1160,"y":540,"wires":[]},{"id":"1856c64.3e9443a","type":"change","z":"1fb8e2b0.d420fd","name":"0","rules":[{"t":"set","p":"payload","pt":"msg","to":"0","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":690,"y":600,"wires":[["94832bd5.41e3b8"]]},{"id":"4bb17406.ceeb9c","type":"change","z":"1fb8e2b0.d420fd","name":"180","rules":[{"t":"set","p":"payload","pt":"msg","to":"180","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":870,"y":540,"wires":[["94832bd5.41e3b8"]]},{"id":"fc50a38b.d8e3a","type":"ubidots_in","z":"1fb8e2b0.d420fd","tier":"educational","name":"","token":"A1E-VQcRU5rQFRaEUQimi6ev1tnIaEiBbl","device_label":"scary-pumpkin","label_device":"","label_variable":"pir","x":130,"y":540,"wires":[["bd82bc06.18229"]]},{"id":"b318389d.4cc388","type":"debug","z":"1fb8e2b0.d420fd","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","x":400,"y":740,"wires":[]},{"id":"e1ae9775.a97e28","type":"function","z":"1fb8e2b0.d420fd","name":"","func":"\nreturn msg;","outputs":1,"noerr":0,"x":430,"y":460,"wires":[["9d71db51.b7cd68","dc8f970.db0b268","1856c64.3e9443a"]]},{"id":"bd82bc06.18229","type":"switch","z":"1fb8e2b0.d420fd","name":"","property":"payload.value","propertyType":"msg","rules":[{"t":"eq","v":"1","vt":"str"}],"checkall":"true","repair":false,"outputs":1,"x":310,"y":540,"wires":[["e1ae9775.a97e28","b318389d.4cc388"]]},{"id":"fca9f49b.8c1078","type":"ubidots_out","z":"1fb8e2b0.d420fd","name":"","token":"A1E-VQcRU5rQFRaEUQimi6ev1tnIaEiBbl","label_device":"","device_label":"scary-pumpkin","tier":"educational","x":1070,"y":620,"wires":[]},{"id":"43751750.11aff8","type":"change","z":"1fb8e2b0.d420fd","name":"","rules":[{"t":"set","p":"payload","pt":"msg","to":"{\"pir\":0}","tot":"json"}],"action":"","property":"","from":"","to":"","reg":false,"x":900,"y":620,"wires":[["fca9f49b.8c1078"]]},{"id":"29fba84a.b2af58","type":"mqtt-broker","z":"","broker":"localhost","port":"1883","clientid":"","usetls":false,"compatmode":true,"keepalive":"60","cleansession":true,"birthTopic":"","birthQos":"0","birthPayload":"","willTopic":"","willQos":"0","willPayload":""}]
Discussions
Become a Hackaday.io Member
Create an account to leave a comment. Already have an account? Log In.