Methods to control a robot increased in number along with the development of mobile devices like smartphones or tablets. Standard methods use a joystick, a remote control or mainly a computer. High processing power of mobile devices with Android opened up new ways through which a robot can be controlled. Between such a device and a robot, various programs or components exist and are designed to create a link between them. Amarino is a toolkit used to open communication channels via Bluetooth between a mobile device and an Arduino microcontroller. Data messages are sent in both directions between for instance a phone and the Arduino MCU. In brief, this application makes the connection between Android and the Arduino libraries.
Before starting any project – Installing Amarino
The Amarino control application for Android can be downloaded for free. The application was created to have quick access to connections, to monitor input and output data and to create data sets which will be sent to the Arduino. These all can be made in an easy way through the available graphical interface. Access to sensors available on the mobile platform is done through Amarino and, according to project requirements, various information can be accessed, like battery level, time tick, test event or if you receive SMS messages.
For example, if the project is controlling a car with the phone’s compass sensor, the first thing to do is selecting the sensor from the graphical interface of the application, the following step is to establish a connection between the mobile device and the microcontroller. The next step, after the connection has been established, is to move the phone to send compass events to the microcontroller. Using a communication protocol is necessary to ensure safety and to avoid communication errors. The application uses events similar to communication media. In this case a send-receive event synchronization is performed between the phone and the Arduino MCU.
Amarino can work in parallel with additional devices, which once added will remain in the phone memory. The red or green indicator represents the connection status, where green is for device connected, red for disconnected. Connecting or disconnecting a device can be done by pressing the Connect/Disconnect button. Options available for each connection can be selected if the user long presses the Connection button. In the screen the user has access to Connect/Disconnect, Show Events and Remove Device actions.
The interface can be closed without affecting current connections, these will run in background and inform the user through notifications. The presence of an icon in the status bar warns the user that the application runs in the background. If you want to close the process, closing of connections will lead to the closure of any process that is opened by the toolkit.
Amarino Events
- Compass Sensor – measured in degrees, values between 0 and 359;
- Accelerometer Sensor – measure unit is m/s^2 and sends data to x, y and z axes;
- Orientation Sensor – measured in degrees and divided into azimuth, pitch and roll;
- Magnetic Field Sensor – measure unit is micro‐Tesla (uT) on x, y and z axes;
- Phone State – sends a message to the robot if phone status is changing to IDLE, RINGING or OFFHOOK.
- Light Sensor – measured in lux, any change in light intensity will generate an event;
- Proximity Sensor – measured in centimeters, messages with distance value are sent;
- Battery Level – any change in battery level is detected;
- Time Tick – send messages with current time;
- Test Event – is a function used to test the connection by sending messages every 3 seconds (messages with random data);
- Receive SMS – you can communicate with the robot via SMS messages in limit of 30 characters.
Amarino is an application which can be used by anyone who wishes to control a robot, has some programming knowledge and, of course, is passionate about this.
Resources
- Connecting the phone to Arduino in 10 steps, Arduino Toolkit
- “Design and Implementation of a Toolkit for the Rapid Prototyping of Mobile Ubiquitous Computing”, Master Thesis by B. Kaufmann at Amarino Toolkit