Skip to content

Build a Wifi throw meter

Laurent Lalanne edited this page Jul 23, 2019 · 6 revisions

Compile code

Two files are needed :

  • Wifi_Angle_meter_mma8452_esp01.ino
  • index.h

Add ESP libraries : Open arduino software and follow instructions from this page (in french)

Board options, flash size can be 512k or 1M :

If you plan to use "Over The Air" updates, a 1M flash size is mandatory.

Install MMA8452 libraries from https://github.com/akupila/Arduino-MMA8452:

  • Download Zip archive (Arduino-MMA8452-master.zip) using the "Clone or Download" button
  • Import library using Sketch menu > Include library > Add .ZIP library

Import library

Programming

A simple USB serial can be used, need some soldering for a jumper and a push button. Push the button while the USB serial is plugged to the USB port, select serial port to use if needed and finally upload.

Schematic

A small low drop 3.3V regulator will be needed here but ESP is tolerant and still working with lower voltages. (see bellow)

ESP angle meter schematic

ESP support voltage input from 2.5V up to 3.6V allowing a simpler solution in case of Lipo battery: using a diode (1V drop - 1n4148), max voltage went down from 4.2V to 3.2V. This also allow voltage monitoring without external components, safer for Lipo battery.

Simple schematic

Build example

Example using a case in two mirrored parts, MMA8452 in one side and ESP01 in the other side. Parts:

  • ESP-01
  • ESP-01 breakout board (beware, ESP module is mounted reversed here and all markings are wrong)
  • MMA8452 accelerometer sensor
  • Voltage regulator
  • Lipo battery 1S-200mAh (WLToys v911) + connector