11

(Marcin) #1
FORGE

Extract the zip file. Inside the extracted folder,
open up the WayHomeMeter folder and open the
WayHomeMeter.ino file.
This sketch requires some additional Arduino
libraries to be installed; start by opening the Arduino
Library Manager by going to Sketch > Include Library



Manage Libraries.



You will need to add the following libraries:



  • Universal Arduino Telegram Bot by Brian
    Lough – for creating a Telegram bot on the
    ESP8266.

  • Google Maps API by Brian Lough – for getting
    the live traffic data.

  • Arduino JSON by Benoît Blanchon – used by
    the libraries to parse the responses. Note: There
    is a breaking change in V6 of this library that


will cause it not to work with the Telegram and
Google Maps library, so use the drop-down on
the left of the window to change the version
to V5.13.2.


  • MD_MAX72XX by majicDesigns – for
    communicating with the dot matrix display.

  • MD_Parola by majicDesigns – handles
    animations on the dot matrix display.

  • Adafruit NeoPixel by Adafruit – for controlling
    the NeoPixels.

  • NTPClient by Fabrice Weinberg – for getting the
    time from the internet.

  • Timezone by Jack Christensen – for automatically
    switching the time for daylight savings.


Left
Screw terminals are
useful for projects
where components
are separated from
the PCB

PROGRAMMING THE ESP8266


The standard Arduino IDE isn’t set up to program the
ESP8266, so before we can program the board, we need to
set this up (you can skip this bit if you’ve already used the
IDE with an ESP8266).
First, let’s get the raw IDE. You can download this from
the Arduino website and install it as you would any other
software: hsmag.cc/TAfEJp.
Next, you will need to set up the IDE so it knows how to
communicate with an ESP8266. Open the Arduino IDE, go
to File > Preferences, and paste the following URL into the
Additional Boards Manager URLs, then click OK:
http://arduino.esp8266.com/versions/2.4.2/package_
esp8266com_index.json

Back on the main screen of the Arduino IDE, go to Tools
> Board > Boards Manager. When this screen opens,
search for ‘ESP8266’ and install it; this may take a few
minutes depending on your internet connection.
After setting up a new board it is recommended
to get the simple example blink sketch before trying
anything more complicated; this can save a huge amount
of headache down the line! You can find this in File >
Examples > 01. Basics > Blink.
Upload this to your ESP8266 and you should see an LED
blink on and off. If you get an error or don’t get a blinking
light, make sure you’ve got everything installed correctly
and the ESP8266 is properly connected.

YOU’LL NEED
An ESP8266
Wemos D1 mini
microcontroller
(or equivalent
e.g. Adafruit
Feather Huzzah or
NodeMCU etc.)
4-in-1 Max7219
dot matrix display
A small servo
(sg90)
A 3D-printed
dial for the servo
(optional, could
be made from
anything!)
11 × through-hole
NeoPixel (I used
PL9823 LEDs)
220 pF capacitor
Passive buzzer
1 kΩ resistor
NPN transistor
Protoboard (I used
a prototype PCB I
designed, but the
project can easily be
built with standard
protoboard)
Screw terminals
(optional)
IKEA RIBBA frame
A3 piece of 3 mm
foam board
Hot glue gun
4 mm wood
drill bit
Sharp knife
A metal ruler
A compass and a
protractor
Micro USB
phone charger
(for powering the
project)
Free download pdf