Experimenting with Arduino and MikroEektronika’s click boards – Part 1

Part 1 – First attempt with the GPS Click board

01. Arduino Mega ADK with ME MirkoNus shield

The goal of this experiment was to see how easy (or difficult) it is to work with some of the click boards offered by MikroElektronika. Okay, there’s also a practical rationale as well, but I won’t go into the details of it.

Why MikroElektronika? MikroElektronika is a giant in my eyes! It’s a regional company (from Serbia) that manufactures literally anything related to microcontrollers – from development boards, programmers, various addons, and much – much – more! They even have a product line of compilers, targeting PICs, Atmels/AVRs and ARMs. Yes, they might be a bit more expensive than similar products from China (AliExpress and the like!), but their renommée and expertise are unmatched regionally. Same goes for their quality! BTW, I am not affiliated with them in any way. I happen to like and respect them!

The Arduino board I have chosen for my proof of concept was an Arduino Mega ADK. It’s something I had available but it’s also something MikroElektronika has a shield for (for their click boards product line), so that I don’t need to mess with perfboards – at least not immediately at the start.

The four click boards I chose were:

At the time I’m writing this, I had all of the click boards laying around except the microSD click. But It’s no big deal, as the Arduino shield supporting MikroElektronika’s mikro bus concept would work with 3 click boards at a time anyhow.

So what’s the idea? The idea is to have a GPS tracking device, capable of storing the coordinates (latitude and longitude) on a micro SD card, along with the value of a 4-20 mA industrial analog transmitter.

Ideally, I would power up the unit from a solar panel and I would send what gets stored on the micro SD over 3G (or GPRS) on a local server. I also put on my TODO list, that what ever is stored on my micro SD, is in a format ready to be used for plotting my coordinates on Google Maps and/or Google Earth. I got this idea following this tutorial on Arduino and GPS from Jeremy Blum.

I chose to play with the GPS click first. This little addon offers the possibility to communicate with the host microcontroller either through the UART or the I2C bus. I chose the former option: it’s straight forward, I had the “luxury” of four dedicated UARTs on my Mega ADK (!!) and all the example I found on the Internet were based on this 🙂

03. The GPS Click connected

But, what I did first was to connect the device straight to the PC through USB (which is also possible – in fact a necessity!!) and play with it with the U-Center software. I found (yet again!) that this article (Getting Started with U-Center) on SparkFun’s tutorial series web-page to be quite informative and help me get started. It’s here I found out that in order for me to use the I2C bus, I have the possibility to find out – or even change – the default address of my u-blox GPS device.

  • Step 1 – Installing the Arduino IDE

  • Step 2 – Installing the SoftwareSerial and the TinyGPS libraries

  • Step 3 – Use an already existing TinyGPS program/sketch (the simple_test one) and see if I am able to pull something out

And here I made few (initial) errors. I connected my GPS click in the second position of the Mega shield from MikroElektronika which meant my GPS device UART was connected on PH0 (RX2) and PH1 (TX2), which in turn implied the 3rd UART on the Mega ADK, which BTW, is enumerated as Serial2 in the Arduino IDE, which finally meant pin 17 (RX2) and pin 16 (TX2).

The readily available TinyGPS sketches were based on using the SoftwareSerial library, so my initial reaction was to change:

SoftwareSerial ss(4, 3);

into:

SoftwareSerial ss(17, 16);

and soon realized that’s just stupid! SoftwareSerial allows the end user to use any pair of plain digital IO pins as regular UART pins. The point in my case was, the pins were already UART pins (which on the other hand, you could definitely use as plain digital pins, should you run out of ones).

Hence, I removed the include directive from my sketch, and replaced all references of the ss object with Serial2 and I have also removed the declaration of the ss object. Then everything worked and I got my coordinates in the serial monitor. Note: I had to change the baud rate to 9600 despite the fact I configured the device to 4800 inside the U-Center software!?

04. Output from the Mega's serial port with the GPS Click

The link to my BitBucket repository where you can find the source code for the Simple_GPS_Test.ino.