Introduction: Intel Edison Location Logger
I know there are a couple Intel Edison GPS projects already but, I wanted to add a couple features that I think make this one worth a look.
First, I wanted to use the Adafruit library and be able to take advantage of the ability to send commands not just read the default text strings.
Second, I use Ubidots.com for the Internet of Things things and they have recently implemented a "map trace" widget for their dashboard which gives you a very cool map showing the path your tracker has taken.
Third, I added an accelerometer with a hardware interrupt so the Edison can shut down itself and the GPS when the tracker stops moving. This will save energy and ensure that you are only actively logging when the device is actually moving. This piece is a little problematic but I will add it in a few days.
This device will sit patiently until the accelerometer senses movement. Then, the Edison and the GPS can wake up and start logging. For now, I am using the on-board Wi-Fi connection but I have also built devices that can connect to a GPRS network using the Adafruit FONA board. I will provide this code on my Github repository which could be integrated.
Sparkfun was out of the breakout boards I needed to make this small and sexy but, I will update this page once I get the final hardware assembled. For now, I simply used the Edison Arduino base unit which provides all the IO you need and a LiPo battery connection and charger so you can save some money by adding a prototype sheild to this unit with the following two breakout modules connected:
MMA8452 Accelerometer breakout - https://www.sparkfun.com/products/12756
- Connections - +3.3V and GND, I2 to D2, SDA to A4, and SCL to A5 (don't forget 4.7k pull-ups)
Adafruit ultimate GPS - https://www.adafruit.com/products/746
- Connections - +5V and GND, TX to RX and RX to TX
The following should help you avoid some of the headaches I encountered:
- You will need a (free!) Ubidots account - Getting Started Guide here: http://ubidots.com/docs/get_started/index.html
- Use Serial1 (HardwareSerial not SoftwareSerial) to communicate with the GPS module
- Use the modified Adafruit GPS library found here: https://github.com/enableiot/iotkit-samples/tree/m...
- Use the Wire library for the MMA8452 and default Arduino WiFi libraries
- IMPORTANT - flash the Edison with the latest firmware from here:http://www.intel.com/support/edison/sb/CS-035180.h...
I have uploaded my current sketch which will get you started. To get the Ubidots part working, generate an API key for your account (see Ubidots documentation above if you get stuck), then create a "source" like Edison and a "variable" called Altitude. Add your WiFi specifics, API key and variable key to the sketch I provided in place of the "xxxxx"s. On the Ubidots dashboard, add a widget, select your "source" (Edison) and your "variable" (Altitude), then add a "map" widget to display the most recent location or the "map trace" to show your path from the "variable's" context (Altitude). This should create two widgets on the dashboard, once with the location or map trace and one with the current altitude.
I hope this is helpful.