Introduction: Fred! Where Are You?

This project is all about how many Km you are from your house. Fred is powered by battery which is rechargeable like a smartphone so you can bring it with you. This is a very easy to build but you might be stuck on the coding.

In this project, you will need:

  • MediaTek LinkIt One
  • Grove LCD RGB Backlight
  • GPS Antenna (which is included with the kit)
  • Li-Ion Rechargeable Battery (which is included with the kit)

Step 1: Connect All the Pieces Together!

  1. Gently connect the GPS Antenna to the LinkIt ONE board on the connector marked "GPS ANT". This connector is at the top of the board and to the left.
  2. Connect the Grove LCD RGB Backlight board to the Grove header with "SCL SDA 5V GND".
  3. There is a large switch on the LinkIt One board marked PWR_SW with one side that reads "BAT" and the other side that reads "USB" (conveniently this is the side next to the micro USB port). Ensure that this is switched to "USB".
  4. Take the battery connector (2 wires - red and black) and ensure that the black wire of the connector is near the edge of the board and the red one is towards the centre of the board. (Gently push it into the cream coloured socket at the edge of the board. It is snap fit so you will feel it click into place. Ensure the battery is connected properly by gently trying to remove the connector. It should give a lot of resistance. If it comes out push it in again a little more firmly.)
  5. Connect the micro USB cable

Step 2: Let's Code!

  1. Start the Arduino IDE.
  2. You need to have installed the LCD Library installed.
  3. Download the files above.
  4. Open one of the file and then go to Sketch then Add File and add the other 2 files.
  5. Upload the codes to the board
  6. Then change back the large switch to "BAT".

Step 3: More Infos!

The colour coding follows the idea that further away people can feel “blue”, while “green” is in general a positive colour. Basically at large distances Fred should be more blue, while near home more green. Since the distance scales over very large values, logarithmic colouring comes handy:

  • Below a minimum distance 100m be totally green, that is (0, 255, 0) in RGB
  • Above a maximum distance 10,000km be all blue
  • Scale between such that the blue value us floor[log10(distance in meters) – log10(100)]*51.5, and the green value is just 255 – blue.

The distances are calculated using the Great Circle formulas, and 6371km as the Earth’s radius. The board has of course enough computing power of course to use the more precise Vincenty formula, and the Math library has all relevant functions at hand.

It’s pretty cool that the LinkIt One comes with the LiPo battery by default, so all of this setup is super portable. Not sure how long the system works on battery, but so far my guess is “definitely more than 30 minutes”, probably at least a few times more than that.

Epilog Contest VII

Participated in the
Epilog Contest VII