Software Design

Project Links: HomeSensorDesignCostSoftwareWeb

It has taken me a bit longer than I would like to get the LinkIt ONE working . Mainly it is my fault for being an odd-ball and not conforming to the MS Windows mainstream.  The good news is that a Mac version of the MediaTek Arduino SDK is coming – can’t wait!

I did get everything running using VMWare Fusion and Windows 8.1  .  I am not sure if any of the problems I had were due to my inexperience with the OS or the vagaries of running Windows in a virtual machine.

The LinkIt ONE is actually a very cool board and once I got it running, I saw three features that are quite endearing:

  1. Memory – 16Mb of Flash and 4Mb of RAM – that is right folks “M” not “K”
  2. Integrated GPS, GPRS and WiFi and Bluetooth – so many options any all built into the basic board
  3. Arduino compatible.  So far, all my sketches work making this a very east board to get started with.

As I wait for the Air Quality Board to come from OSHPark, I wanted to start building the Internet of Things back-end to this project.  My favorite data streaming service today is Ubidots so, I wanted to simply test the process of connecting to Ubidots using the GPRS modem and uploading a single data point – the battery level.

Battery Gauge Widget
Battery Gauge Widget

I have updated the sketch in the repository below to take advantage of the LinkIt ONE’s built in GPS.  Very cool though I did end up learning a bit more about National Marine Electronics Association (NMEA) GPS “sentences”.   You can get a sense of what is passed from a GPS receiver by looking at the “GGA” sentence here.  Once I got the sentence I had to parse it.  Here is one area where loosing the Arduino 2k RAM size came in handy – I was able to take full advantage of String functions.  Usually you need to avoid “String” because it eats RAM and slows things down – not an issue here.

I had to do a few things to get the GPS data into the format Ubidots wanted:

  1. Extract the latitude and longitude strings and separate the degrees from minutes.
  2. Convert from the cardinal directions to signed degrees
  3. Convert decimal minutes to decimal degrees

If anyone has suggestions on how to do this more elegantly, please feel free to make a suggestion in comments.  Anyway, it works and now I see this on my Ubidots dashboard:

Screen Shot 2014-12-04 at 11.29.25 PM

I have uploaded my simple sketch to Github here.  I have added a basic temperature logger capability and moved the required commands to send to Ubidots to a separate function to keep the Loop() simple.

The sketch makes full use of the LinkIT ONE GPRS libraries which does make for much cleaner code than the work I am currently doing with the Adafruit FONA where I need to get into the AT Command set.  That said, it will be interesting to test this board out in the woods where weaker signal strength can play havoc with GPRS data transfers.

In order to use this sketch, you will need an account with Ubidots (free until you start doing some serious work), a LinkIt ONE board from SeeedStudio and the Arduino SDK from Mediatek.

I will continue to improve this code with additional functionality and will be integrating the air quality board once I get it built in the coming weeks.  Please stay tuned and feel free to leave comments.

Project Links: HomeSensorDesignCostSoftwareWeb 

 

Leave a Reply

Your email address will not be published. Required fields are marked *