Our project consists of a switch control over Bluetooth. Basically, we use an Arduino-compatible board with a shield (called Nanoshield) that can control a lamp. We also use a Bluetooth module to send and receive data wirelessly. We tested the system with a lamp, which we can turn on and off, but you can use the concept of this project with whatever you want.
So the concept is very simple: we have an App on the cellphone which can recognise certain words/expressions that are spoken (such as "Turn on"/"Turn off" - or, in Portuguese, as we did, "Ligar"/"Desligar"). If we say "turn on", the app sends an information wirelessly to the bluetooth module (connected to the Arduino board) and this information will be used to turn the lamp on. The same principle works for turning it off.
Let's check the bill of materials for this project:
Step 1: Materials
The Arduino-compatible board, as well as the Mosfet Nanoshield that is used to control the lamp, are produced by a Brazilian company called Circuitar. Their focus is on building small shields for Arduino, which they call Nanoshields, and that are modular, so that many of them can be added to the project at once, while still using little space. You can check out more about these modular shields at https://www.circuitar.com
The materials used for this project were:
- 1 Baseboarduino from Circuitar https://www.circuitar.com/nanoshields/modules/bas... (this board allows you to connect up to 4 different Nanoshields and has the size of an Arduino Mega)
- 1 Nanoshield Mosfet from Circuitar https://www.circuitar.com/nanoshields/modules/mos...
- 1 Android phone (because we used MIT App Inventor for the app, but if you know how to create apps for iPhone, go ahead!)
- 1 Small Lamp
- 1 Bluetooth Module for Arduino
- 1 Breadboard
- 1 12V wall power adaptor
- Jumper wires
- Rubber Bands
Step 2: Android App
To create the Android App, we used MIT App Inventor (http://ai2.appinventor.mit.edu). The main components of the app are:
- Speech recognition - used to recognise which word or expression was said and to compare to our "magical words" to control the lamp;
- Bluetooth connectivity - to send data wirelessly to the Arduino
You can get the app that I created downloading the .apk below and uploading the file to MIT App Inventor.
Step 3: How to Build (Pt. 1)
In order to build the system we need to understand how the Base Boarduino and the Mosfet Nanoshield work. These are actually components of a Beginner's Kit from Circuitar. There is a tutorial on how they work and how to use/program them: https://www.circuitar.com/tutorials/kit-nanoshiel...
There are a few basic steps to build the project:
- Assemble the MosfetNanoshield on the Baseboarduino;
- Follow these steps to prepare the lamp and this tutorial to program the Arduino to turn it on and off
- Remember that the lamp may use more current than the usb from your computer may provide. So you'll need to use a wall power adaptor.
Step 4: How to Build (Pt. 2)
Mount the Bluetooth Shield on the Protoboard and connect the wires like in the image above.
There way to program the bluetooth module may vary depending on the bluetooth shield/module you use. However, the idea is very simple: we want to keep checking if the phone app sent any information and, if so, get it and use to turn the lamp on or off.
Step 5: How to Build (Final)
Attach everything together with the Rubber Bands or, if you are up to making it look better, make a case for it =)
At the end, it will look like the image above.
Step 6: Programming the Arduino
Here is my Arduino code in case you want to use it as reference. Feel free to modify whatever you need to!
Step 7: Done!
That's it =)
Modify the project to work with whatever device you can control, like the lamp. If you make anything different, post it on the comments!
--- This was a final project on the Tech Startups Course held at our school in São Paulo, Brazil.
I hope you liked it!