This project was presented by Álvaro Justen and Diego Dukão on 2012-07-27 at FISL13, in Porto Alegre/RS, Brazil.
Android <-[HTTP]-> Computer <-[Serial]-> Arduino <-[electrical]-> Socket
- Your Android phone talks with a computer (using Wi-Fi, 3G or whatever you
want)
- Android makes HTTP requests that are answered by a python script
(
http_server.py
)
- Android makes HTTP requests that are answered by a python script
(
- The computer talks with Arduino using USB (we use
python-serial
library for this) - The Arduino controls a relay that switches a socket on and off.
If you have an Ethernet, Bluetooth or Wi-Fi shield, you can completly remove the computer and your Android will talk directly to Arduino.
Just follow these steps:
- Make the circuit to control the relay
- Connect the relay module to Arduino digital pin 7
- Upload the software (
arduino/TimerSocket/TimerSocket.ino
)
- Connect Arduino to an USB port
- Install the library
python-serial
(apt-get install python-serial
) - Run
python computer/http_server.py
- Connect in the same network of your computer
- Build the application APK
- Install on your phone
- Open it
- Configure the computer's IP address in the application
- Done!