For home automation, remote control or monitoring of your Arduino, Arduino Manager does it all. Here’s how to use it to control your Arduino from a mobile or tablet.
Today, I’m testing with iOS, but the Android app functions are identical with the exception the absence of the code generator.
- ArduinoManager, for iOS or Android
- Official Ethernet or WiFi shield
- IOSController library installed to your libraries folder (or Android Controller)
- Example code for Ethernet or WiFi versions
- A servo, some analog sensors, and potentiometer, a breadboard, and some LEDs to play with. These should all be common components found in any Arduino starter kit .
Android Manager is a nice interface to control your Arduino remotely over WiFi or Ethernet. As well as the obvious features of being able to turn on or off relays and servos, you can gather sensor data and create thresholds or alarms that react to that data. The app consists of a grid, each section of which can have a different control module or widget. When you’re happy with the result, these can be shared too.
Not so fast though: you will need some Arduino coding skills to make the magic happen. An example is provided and full documentation is available, but do bear in mind that any project you produce is a combination of the UI created by Arduino Manager plus some custom coding for your Arduino. If this puts you off, know that the iOS version of the app has a single in-app purchase which will generate suitable code for you. Learning to change this code is out the scope of todays tutorial, but you can expect me to cover it again for future home automation projects.
Ensure the ArduinoManager library is installed on your system first, then open up the example code and find the following lines:
/* * * IP info * * Using DHCP these parameters are not needed */ IPAddress ip(192,168,1, 233); IPAddress gateway(192,168,1,1); IPAddress subnet(255,255,255,0);
Edit those for your own home network. You should also be able to use this away from home if you have port forwarding set up, but we won’t be covering that.
Note that if you’re running on an Arduino Uno, you will need to disable the SD card data logging support in order for the program to fit in memory. Open IOSController.h or AndroidController.h and comment out this line (place // in front)
Arduino Mega users won’t have this problem since it has more memory.
Wire in a test circuit according to the following diagram (if it’s too small, you can view a larger version of, or read the instructions below; that temperature sensor is supposed to be going to A0).
- Connect an LED to pin 8 with suitable resistor on the negative side (short leg). This will be controllable from within the iOS app.
- Connect another LED to pin 7, again in series with a resistor. This will turn on whenever the app is connected.
- Put a potentiometer on A2. The middle leg is the output pin, just connect the legs at either side to +5v and ground – it doesn’t matter which.
- Put a light sensor on A1. One pin of the light sensor should go to +5v, the other should be connected to both A1 and to ground via a 10k Ohm resistor.
- Put a TMP36 temperature sensor to A0. The middle leg is the output pin; with flat side facing you the leftmost pin is +5v, the rightmost pin is ground.
- Finally, put a servo on pin 9. Yours may differ, but generally speaking, the white cable is the control line, then the red and black are +5v and ground respectively.
Here’s one I made earlier.
Unzip, and email the resulting Widgets.lst to yourself, and you should be able to open my ready-made control board. You’ll also need to click the configuration button in the bottom right to set up the correct IP address first, then tap that icon to connect.
If you’d prefer to make your own interface, toggle over into edit mode on a clean board and double tap on any empty square to open up the module list.
After adding a module, tap the grey bar to label it. In the demo circuit and code, the following labels can be set:
- T for the temperature sensor.
- L for the light sensor.
- L1 for one of the LEDs. The other LED turns on automatically to indicate a successful connection to your mobile device. L1 can set as both a switch and LED indicator.
- Pot for the potentiometer.
- Knob controls the servo (but I found a slider to be better – the actual knob module is a little fiddly. Add a slider and called it “Knob”, it will work fine)
If you want to control different things then you’ll need to adjust the Arduino code to suit your project.
I checked out a number of alternatives while investigating this topic and the most viable competing application is called ArduinoCommander, but sadly, all the nice features are locked behind a paywall such that it would cost you $50 or more to unlock everything; the site that supports the app is also offline. It worked for basic features when I tested it, but I’m not going to endorse that app that can’t even keep it’s support site online and chooses micropayments for everything. Arduino Manager is just better, and only has one in-app purchase for an advanced feature.
So, now we’re all set to start an Arduino Home Automation project! Do you think you can make use of Arduino Manager?