Arduino/Android Web Switch using App Inventor

Screen-2I found a App Inventor program and sketch on the net that allowed me to control an output on my Arduino Uno using my smart phone. So with a bit of trial and error I modified the sketch and the App Inventor code to control 8 relays. The relays are simple On/Off controls.

For those unfamiliar, App Inventor is a simplified way to create Android Apps to run on your smart phone. It’s not as full and robust as using Google’s Android Studio and SDK, but it’s quick and gets the job done so long as the app isn’t too complicated.

The WebSwitch_8CH App uses the TinyWebDB function in App Inventor to send the On/Off requests to the Arduino using GET via an Ethernet shield. I haven’t tested it yet, but I’m sure it would work wirelessly by replacing the includes for the Ethernet shield with the includes for the Wireless shield and making some minor tweaks to the sketch.


Click Image to View

The relay boards I’m using already have a resistor built in to them to limit the current draw on the outputs so no external components are needed. The Arduino Uno doesn’t have the ability to power the relays. The relay voltage, 5VDC in this case, needs to be supplied by a separate power supply.

The relays are optically isolated from the relay power circuit using optocouplers. Optocouplers are an electronic component that interconnects two separate electrical circuits by means of a light sensitive optical interface.

There’s a link at the bottom of the page to download the Arduino Uno sketch and the App Inventor code. The code can be imported to App Inventor. Feel free to modify it. It’s all about learning and having fun!

FYI: You’ll need a Google account to access the App Inventor site.

App Inventor Link:
(Note: AI will not work using Internet Explorer. Use Firefox, Chrome or Safari instead.)

You can download the Arduino sketch and the App Inventor code here. (Zipped File)

This entry was posted in Arduino Stuff. Bookmark the permalink.