Introduction: Tweet for Bubbles
This project was recently deployed at an IOT conference in Pune, India. The bubble machine that we brought from here, was modified to make bubbles if someone tweets with #PuneIOT. After people came to know about this we got a lot of tweets and a lot of bubbles too.
Step 1: Gathering the Required Parts
1. Bubble maker machine + soap water
2. Raspberry Pi + wifi-Dongle
3. Tah + Relays and Sensors Shield (we can make do without it, but since I had one handy saved me the trouble of making the circuit)
Now lets get started.
Step 2: Create a Twitter App and Setup Raspberry PI
Clone this repository in your home folder of the Raspberry Pi.
git clone <a href="https://github.com/RevealingHourCreations/bubblemaker" rel="nofollow">https://github.com/RevealingHourCreations/bubblema...</a>
In the file bubbles.py insert the above secret-key values that you just copied from you twitter app.
Next lets make the launcher.sh file run on when the Raspberry Pi reboots. To do that lets change the permissions on the launcher.sh
chmod 755 launcher.sh
Now test it, by typing in:
This should run your Python code.
Add logs directory
cd mkdir logs
sudo crontab -e
add the following line to the end of the file
@reboot sh /home/pi/bubblemaker/launcher.sh >/home/pi/logs/cronlog 2>&1<br>
Then restart the Rabpberry Pi
Step 3: Setup the Tah Board.
Let us take the Tah board and attach it to the sensor + relay shield. Then cut the wire that connects to the bubble maker and insert the relay connected on pin 2 in series.
The sketch for the Tah board can be found here. It is simply reading the serial port for a string and as soon as it receives the string turns the relay on for 1 second. Upload the sketch on the Tah and plug it into the Raspberry Pi.