Wand Under a Spell

by Vijayaprakash K in Circuits > Wireless

366 Views, 2 Favorites, 0 Comments

Wand Under a Spell

23h22m45s864.png

A DIY wireless project.

Simple hardware and software setup.


Supplies

20220302_120324.jpg

1. Wood

2. Bolt Wi-Fi Module

3. Battery bank

4. USB Cable

5. Jumper Wires

6. Wires

7. Paste

8. Android Phone

9. Bluetooth Headset

Making of Wand

20220302_114202.jpg
20220302_114513.jpg

Take a raw wood and craft the shape you like. The wizard's wand you like. Or cast it with plaster of paris of shape you like. Leave a hollow space for wire connections from module to LED. The wood I have is already hollow.

Circuit Connection Inside the Wand

20220302_114738.jpg
20220302_114755.jpg
20220302_114759.jpg
20220302_140239.jpg
20220302_122457.jpg

Pass the wire through the hollow space. Connect the top end of the wire with a LED and end with jumper wire.

Making Base for the Module

20220302_145800.jpg
20220302_152330.jpg

I created a support for placing the module. Take the required square shape paper with enough GSM and paste it on the glove. I have used iron wire. Bent the wire in L shape and paste it on the paper with the module's respective distance of the holes. Paste another paper on it as shown above as the same size as the base.

Making Base for the Module 2

20220302_154735.jpg

Raise walls at the three sides as shown above.

Making Top for the Module

20220302_181615.jpg
20220302_182108.jpg

Take the measurements of the base pasted on the glove and make a top as shown above. Make two holes for the jumper wires and cut the middle as shown above for the power cable.

Getting the Bolt API Key and Device ID

amp0y-vv1lo.jpg

Login to cloud.boltiot.com and note the ID of your Bolt Wi-Fi Module.

Now click on the API tab and under the section for Generate Key, click on Enable.

Next click on the copy button to copy your API key. Your API key will may look something like this: f1f918e9-d9c2-4e5b-aed0-b7cb743f74cf

Creating the GPIO Control Command

Since LED is a digital output device, we will need to get a Digital Write command that can be sent to Bolt over the Internet to switch on the LED.

From Bolt Cloud go to Docs Tab -> API Documentation -> GPIO Commands API -> Write Digital Output, to understand how to create a API command link to turn on or turn off a pin of the Bolt.

The structure of the command is:

https://cloud.boltiot.com/remote/API_KEY/digitalWrite?pin=PIN_NUMBER&state=HIGH/LOW&deviceName=DEVICE_ID

The parameters that you need to replace are:

API_KEY: You can get it from API tab on cloud dashboard.

PIN_NUMBER: Pin to which you have connected the LED. Values can be either 0,1,2,3 or 4

HIGH/LOW: This value indicates if you want to turn on/off the LED. HIGH will turn it on, LOW will turn it off.

DEVICE_ID: The id of your device. You can get it from cloud dashboard.

The sample command to turn the led ON connected to device having ID BOLT13819450 to PIN 0 is:

https://cloud.boltiot.com/remote/f1f918e9-d9c2-4e5b-aed0-b7cb743f74cf/digitalWrite?pin=0&state=HIGH&deviceName=BOLT13819450

Make sure that you change the API Key to your own API Key and device ID which you got in the previous step.If you have connected the LED to any other pin other then Pin 0 then make a suitable change in the pin no in your code.

IFTTT Integration Via Google Assistant and Webhooks

aejtg-frrt6.jpg

Go to IFTTT to create a new applet

Login using your Gmail account. Make sure you use the same account that you'll be using on your mobile to interact with Google Assistant.

a5byx-pbcto.jpg

Click on '+This' to create the trigger.

a9m7t-6fvd3.jpg

Choose Google Assistant -> Say Specific Phrase

a4wc8-tosba.jpg

Type the phrase 'Lumos Maxima' which is the trigger for our action.

Screenshot_20220327-203748_IFTTT.jpg

Click on 'Create Trigger'

Click on '+That'

a9m7t-6fvd3.jpg

Select Webhooks and then Make a web request

aiqp4-47e2u.jpg
aepbw-rb7l0.jpg

Enter the API URL you got in the previous Step. Make sure that you change the API Key and device name.

Method will be GET

Content type will be Application/json

Here is how your screen will look like

aewmz-np6js.jpg

Click on 'Create Action' and then Click on 'Finish'

To Turn OFF the LED

Now do the same process for a command to switch off the LED. Here you will change the state to LOW i.e. state=LOW in your code. Add the phrase 'Nox' to switch off the LED.

Circuit Connection With the Module

20220327_200856.jpg
20220327_200938.jpg

Connect the positive terminal of the LED to 0 and Negative terminal to GND.

Powering the Module

20220327_201447.jpg
20220327_201621.jpg

Connect the USB cable to the module and power bank. Th e Module with glow in blue with a interval of time.

Connecting the Module to the Cloud

20220327_205015.jpg
20220327_201638.jpg

Configure your Bolt module in the mobile app as the steps are given in it. Whrn the module is connected to the cloud using your mobile hotspot the blue light will stop blinking and the green light will glow without interval. Now we can confirm it online.

Now connect your Android phone to your Bluetooth headset. Wake your wand saying "OK Google" and say the phrase you had set while creating the trigger to see the magic happen.