element14 Community
element14 Community
    Register Log In
  • Site
  • Search
  • Log In Register
  • Community Hub
    Community Hub
    • What's New on element14
    • Feedback and Support
    • Benefits of Membership
    • Personal Blogs
    • Members Area
    • Achievement Levels
  • Learn
    Learn
    • Ask an Expert
    • eBooks
    • element14 presents
    • Learning Center
    • Tech Spotlight
    • STEM Academy
    • Webinars, Training and Events
    • Learning Groups
  • Technologies
    Technologies
    • 3D Printing
    • FPGA
    • Industrial Automation
    • Internet of Things
    • Power & Energy
    • Sensors
    • Technology Groups
  • Challenges & Projects
    Challenges & Projects
    • Design Challenges
    • element14 presents Projects
    • Project14
    • Arduino Projects
    • Raspberry Pi Projects
    • Project Groups
  • Products
    Products
    • Arduino
    • Avnet & Tria Boards Community
    • Dev Tools
    • Manufacturers
    • Multicomp Pro
    • Product Groups
    • Raspberry Pi
    • RoadTests & Reviews
  • About Us
    About the element14 Community
  • Store
    Store
    • Visit Your Store
    • Choose another store...
      • Europe
      •  Austria (German)
      •  Belgium (Dutch, French)
      •  Bulgaria (Bulgarian)
      •  Czech Republic (Czech)
      •  Denmark (Danish)
      •  Estonia (Estonian)
      •  Finland (Finnish)
      •  France (French)
      •  Germany (German)
      •  Hungary (Hungarian)
      •  Ireland
      •  Israel
      •  Italy (Italian)
      •  Latvia (Latvian)
      •  
      •  Lithuania (Lithuanian)
      •  Netherlands (Dutch)
      •  Norway (Norwegian)
      •  Poland (Polish)
      •  Portugal (Portuguese)
      •  Romania (Romanian)
      •  Russia (Russian)
      •  Slovakia (Slovak)
      •  Slovenia (Slovenian)
      •  Spain (Spanish)
      •  Sweden (Swedish)
      •  Switzerland(German, French)
      •  Turkey (Turkish)
      •  United Kingdom
      • Asia Pacific
      •  Australia
      •  China
      •  Hong Kong
      •  India
      •  Japan
      •  Korea (Korean)
      •  Malaysia
      •  New Zealand
      •  Philippines
      •  Singapore
      •  Taiwan
      •  Thailand (Thai)
      •  Vietnam
      • Americas
      •  Brazil (Portuguese)
      •  Canada
      •  Mexico (Spanish)
      •  United States
      Can't find the country/region you're looking for? Visit our export site or find a local distributor.
  • Translate
  • Profile
  • Settings
Personal Blogs
  • Community Hub
  • More
Personal Blogs
Legacy Personal Blogs MODBUS master in my cell phone
  • Blog
  • Documents
  • Mentions
  • Sub-Groups
  • Tags
  • More
  • Cancel
  • New
  • Share
  • More
  • Cancel
Group Actions
  • Group RSS
  • More
  • Cancel
Engagement
  • Author Author: gihu
  • Date Created: 5 Aug 2013 5:33 PM Date Created
  • Views 2781 views
  • Likes 3 likes
  • Comments 13 comments
  • android
  • bluetooth
  • seral
  • port
  • profile
  • spp
  • modbus
  • rtu
Related
Recommended

MODBUS master in my cell phone

gihu
gihu
5 Aug 2013

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.

 

image

You don't have permission to edit metadata of this video.
Edit media
x
image
Upload Preview
image

 

I really hope you like this post.

  • Sign in to reply

Top Comments

  • shabaz
    shabaz over 9 years ago in reply to Sisteck +1
    You both need to follow each other as I understand, even if just one person wants to send a private message. Code can be shared by attaching to the post, or perhaps use a service like github (assuming…
  • gihu
    gihu over 9 years ago in reply to shabaz +1
    Thanks shabaz
  • Former Member
    Former Member over 12 years ago in reply to gihu

    Thanks for that.

    I am trying to outsource the project.

    'Plenty of better quicker programmers out there.

     

    BTW, this is what we are building.

    http://www.indiegogo.com/projects/nirvana-cruise-control/x/3289688

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • More
    • Cancel
  • gihu
    gihu over 12 years ago in reply to Former Member

    Hi james,

     

    I can share you my code, but for the bluetooth conection I just use the 'BluetoothSerialService' and 'DeviceListActivity' classes from BlueTerm example. So I use bluetooth serial port profile just to emulate the physical layer of a MODBUS RTU, the code I wrote was for the datalink layer and aplication layer. So, about bluetooth connection there is no difference with Blueterm.

    I know you are in a hurry, I saw your comments in Cypress PSoC 4 Pioneer Kit. So I try to help you, first of all, you need to know the bluetooth profile(SPP, Headset, Health equipment,...) that use your remote equipment, if you try to connect with different profiles, conection cannot be stablished. Take into account, that depending the profile, you should use different minimum API level, for example you won't be able to create an app that uses BLE for Android 2.3.

     

    Try to know the profile of your remote equipment, or even check if you can search and connect with it from Settings/Bluetooth of your Android device.

     

    Let my know what you get by private message in we keep on this chat.

     

    Hope it helps,

    Miguel

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • More
    • Cancel
  • Former Member
    Former Member over 12 years ago

    I am interested in the bluetooth portion.

    Care to share?

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • More
    • Cancel
<
element14 Community

element14 is the first online community specifically for engineers. Connect with your peers and get expert answers to your questions.

  • Members
  • Learn
  • Technologies
  • Challenges & Projects
  • Products
  • Store
  • About Us
  • Feedback & Support
  • FAQs
  • Terms of Use
  • Privacy Policy
  • Legal and Copyright Notices
  • Sitemap
  • Cookies

An Avnet Company © 2026 Premier Farnell Limited. All Rights Reserved.

Premier Farnell Ltd, registered in England and Wales (no 00876412), registered office: Farnell House, Forge Lane, Leeds LS12 2NE.

ICP 备案号 10220084.

Follow element14

  • X
  • Facebook
  • linkedin
  • YouTube