In this post I would like to show the community a project I started last summer:
The goal:
- Read an 8 analog input MODBUS RTU module with an android phone.
Motivations:
- Learn about MODBUS.
Build my first android app (after the “hello world”).
Learn about Bluetooth technology.
This project is based in the use of the serial port profile (SPP) to enable an Android phone to manage a MODBUS net. I had tried the lairdtech BTM443, but in the end I used the RN-42 because it has the RN42XV version which makes it easier to handle it in prototypes.
A little hardware
A little hardware to supply the module and to drive the TTL signals to RS485 for the MODBUS RTU physical layer is needed.
M8EA
This is the 8 analog input module, manufactured by Ibercomp. Instead of sensors I have used potentiometers, and I have configured the module as 0V~2.5V input.
Android app
I have used Eclipse IDE with ADT, SDK tools, and the example and indicatios from http://developer.android.com/index.html
The modbus protocol is implemented in the app, there are lots of C examples on the web.
After many hours searching information, reading and studying examples and datasheets, burn-out some components..., typing code, checking and sniffing the communications, and making lots of mistakes... I succeed.
I hope you like the result, and it can give some ideas to you all, or inspire new hobbyist projects.
Above one picture of the set up and the video of the app working.
I really hope you like this post.
Top Comments