Machine To Machine - M2M Tutorials

After experimenting Google ADK (Accessory Development Kit) and Arduino board, we proposed you some tutorials, including source code we documented, to advice you to :

1/ Control external devices like LED, Piezo Buzzer, Servo Motor, DC Motor,…
2/ Read external devices state/values like Button,Potentiometer, Piezo Buzzer, Temperature Sensor, Light Intensity Sensor, Tilt Switch, Touch Capacitive Sensor, Infrared LED, … with an Android Smartphone (You can do the same with an iPhone, only writing Objective-c code 🙂 ).

First feelings about the new M2M amazing industry are several :

1/ You must be really curious, have a DIY (Do It Yourself) mind, search in forum to catch the right information, because there’s a lot of different kind of devices with its own params, each electronic component has its own datasheet, and we are at the beginning of the M2M industry, it’s not a formatted one.

2/ Your are in the embedded world, so the code you upload in the micro-controller must be clean, verified, and optimized because you manage electronic components. In fact, micro-controller code must be always light and react in milliseconds.

3/ Machine to Machine concept is not an “exclusive” communication between two machines. You can extend, for instance, your M2M prototype to interact with Cloud services to analyze incoming data, react on it according to business rules, to create particular “context” response (ex : especially for wearable project).

4/ Business opportunities are infinite : Domotic, Health, Medicine, Smart cities, Transport, Wearable, Disabled Person, Ecology, Economy, Military, Security, Cloud, Data Transfer, Drone, Augmented reality, Space …

PREREQUISITES

SOFTWARE
– Installing Android Framework (Ideally latest version with all ADT Plugins updated).
https://developer.android.com/sdk/index.html

– Installing latest Arduino Framework.
http://arduino.cc/en/guide/windows#.UwUMIs7KF28

– Installing Arduino Mega 2560 latest driver (http://arduino.cc/en/Main/ArduinoBoardMega2560#.UwUMTs7KF28 )
or Arduino Uno latest driver ( http://arduino.cc/en/Main/ArduinoBoardUno#.UwUMU87KF28 ) on your computer.

– Installing Accessory Development Kit.
http://developer.android.com/tools/adk/adk.html

DEVELOPMENT

> Android
– REALLY minimum Android coding experience (UI, manifest file params, permissions, life cycle, …).

> Specific Android class to study :
– Activity
http://developer.android.com/reference/android/app/Activity.html
– Service
http://developer.android.com/reference/android/app/Service.html
– BroadcastReceiver
http://developer.android.com/reference/android/content/BroadcastReceiver.html
– ContentProvider
http://developer.android.com/reference/android/content/ContentProvider.html

> Arduino
– Minimum Arduino coding experience (C “light” language).
Good reference to start and train is : http://forum.arduino.cc/​

> Electronic
– To design your electronic schema, you can use Fritzing.

HARDWARE
– Smartphone with Android 2.3.3+ (Nexus 4 with Kitkat (4.4.2) and more for these tutorials).
– Arduino 2560 Mega ADK and/or Arduino UNO.
– A SURE USB 2.0 cable (Data & Power).
– Have always a full charged mobile phone, because there’s problems between USB synchronization response and the micro-controller when connected each other.
– Basic Electronic knowledge (Electronic components polarity, reading circuit diagrams, understanding components datasheet).
– Some electronics components and tools (Breadboard, Wires & Jumper, Button, Resistor, Zener LED, Infrared LED, Switch, Tilt Switch Sensor, Light Sensor, Temperature Sensor, Volt meter, Oscilloscope, Soldering iron, Desoldering pump, PCB, Wire stripper, …).

> If you want to train with a correct package including all required basic electronic components and tutorials well explained in a book, we advice you the Arduino Starter Kit : http://arduino.cc/en/Main/ArduinoStarterKit#.UwUYjc7KF28

> For tools (Volt meter, Oscilloscope, Soldering iron, Desoldering pump, PCB, …) , go to your favorite electronic components shop.

GENERAL ADVICES

Smartphone
– Always be sure that your smartphone has sufficient power to communicate with the Arduino board, because Smartphone / Micro-controller synchronization is sensitive to that.

Android SDK
– Create Android Projects with Google API 10 or 12.

Arduino
– Before uploading Sketch in your Arduino micro-controller, use [Menu Sketch / Verify & Compile] to check your code.
– Check that your computer COM port is available when you upload Arduino sketch in your micro-controller [Menu Tools / Port].
– Check that you choose the right micro-controller before uploading your sketch in Arduino micro-controller [Menu Tools / Board].
– Use Arduino Serial.print() instruction in your code & The serial Monitor (Tools / Serial Monitor) to debug, because when your smartphone is connected to the Arduino board, you won’t see what it send to the micro-controller through Eclipse DDMS debugger.

Electronic
– Be carefull to always check TWO TIMES your electronic circuit before POWER/ON your Arduino Micro-controller : if you don’t respect polarity for some electronic components, it could be dangerous (ex : capacitor, transistor, specific components are sensitive for shortcircuit or burning).
– Double click on Circuit diagram in Tutorials documents to check.
– ALWAYS build your electronic circuit on the breadboard when power is OFF, and be sure to not have electromagnetism on your hand when manipulate (Touch Iron/Ground before manipulate them).
– All theses tutorials run with 3.3V, 5V, 9V DC-current. We advice you to NOT experiment 220V project with Arduino interfacing (ex : Domotic project), if you have NOT a SOLID Electric/Electronic engineering background.

DOCUMENTATION

Android
https://developer.android.com/studio/index.html
http://developer.android.com/tools/adk/index.html

Arduino
http://arduino.cc/

Electronic components
https://www.sparkfun.com/
https://www.adafruit.com/
http://www.lextronic.fr/

Developer forum
http://stackoverflow.com/

We can build a really cool M2M / DIY (Do It Yourself) community here, enhance the code of these tutorials, create new tutorials, build new projects, build “week end project”, especially in wearable domain for instance (Some realization soon ! : Starter kit, Wereable Capacitive project, and so on …)

All Android/Iphone developer, Electric/Electronic & Embedded Engineer, DIY Artist are welcome !

M2M has no limit, except your imagination !

Thank you,

Best regards,

boOpGame Team

NB : You can download the first tutorial “Android Arduino HelloWorld”

________________________________________________________________________

TUTORIALS SUMMARY – PACK #1

Android Arduino HelloWorld : Android & Arduino talk together
M2M Demo – Lesson #1 : Toggle a LED
M2M Demo – Lesson #2 : Pulse with Modulation a LED
M2M Demo – Lesson #3 : Reading the state of a Button
M2M Demo – Lesson #4 : Adjusting Analog input with a Potientometer
M2M Demo – Lesson #5 : Generating Sound with a Buzzer
M2M Demo – Lesson #6 : Sensing sound with a Buzzer
M2M Demo – Lesson #7 : Light Intensity Sensing
M2M Demo – Lesson #8 : Temperature Sensing
M2M Demo – Lesson #9 : DIY Capacitive Sensor
– M2M Demo – Lesson #10 : Controlling Servo Motor
M2M Demo – Lesson #11 : Controlling DC Motor
M2M Demo – Lesson #12 : SMS Alarm System
M2M Demo – Lesson #13 : Camera Alarm System​