11

(Marcin) #1

Way Home Meter


TUTORIAL


Use an ESP8266 and some NeoPixels to let loved
ones know when you’ll arrive back home

Way Home Meter


et me know what time you’ll be
home”– it’s a common refrain in
homes across the country. We try
to give good answers, but it’s hard
to know how traffic will affect us on
the way. Rather than rely on guess-
work, let’s try to build something to let our families
know when we’ll make it back.
In this project we’ll build a device that will give
up-to-date home arrival times, based on the live
traffic conditions. To make the device more useful
for when it’s not being used for that purpose, it
works as a clock that automatically fetches its time
from the internet and also automatically adjusts for
daylight savings.

We’ve built this using an ESP8266, which is a
surprisingly powerful microcontroller with built-in
WiFi and can be programmed using the Arduino IDE.
The device makes use of a few different, free
internet services:


  • Telegram: an instant messaging service that
    allows for the creation of bots that users
    can interact with. It is a really good way of
    communicating with your ESP8266 or ESP32
    projects from anywhere in the world, for free.

  • Google Maps API: can be used to get travel time
    and traffic information between two places.

  • NTP servers: Network Time Protocol, a way for
    network-connected devices to get the time. This
    saves the needs for a real-time clock, and also
    doesn’t require the time to be set.


To use it, the person who is coming home uses
Telegram on their phone to share their live location
to a Telegram Bot that is running on the Way Home
Meter. This will update the Way Home Meter
with the person’s GPS coordinates every 20 or
30 seconds.
The Way Home Meter takes these coordinates
and sends a request to the Google Maps API to
get the live travel time and distance between the
person’s location and home.
The Way Home Meter will then add the travel
time onto the current time and display the estimated
arrival time of the person and updates the dial and
NeoPixels to represent what percentage of the
journey (distance wise) has been completed.

CODE IT UP
The code for this project is available on GitHub.
Go to the following URL, hsmag.cc/ybAcHB,
and click the Clone or Download button on the
right side of the page, and then Download Zip.

Brian Lough


Brian is a Maker from
Ireland who primarily
creates projects
and libraries for ESP
microcontrollers. Check
out his stuff on his
YouTube channel and
blough.ie

@witnessmenow

L


Free download pdf