

Espway
Segway-like robot implemented on ESP8266
- Size
- 43 × 34.3 mm
- Copper layers
- 2
- Thickness
- 1.6 mm
- Parts
- 37
- Nets
- 30
- Pads
- 116
- Tracks, vias
- 285, 16
- Pours
- 12
- Routed
- Yes
- KiCad
- KiCad 4
- Created
- 24 Jul 2016
- Updated
- 11 Nov 2021
Overview
Espway is an open-source printed circuit board by espway, from the espway/espway repository on GitHub, published under the LGPL-3.0 licence. It is a 2-layer board of 43 × 34.3 mm with 37 parts on 30 nets, routed with 285 tracks and 16 vias.
It is built around the ESP-12E, DRV8835DSS and LM1117-3.3, with the LSM6DS3 among its other parts. Its parts include 15 resistors, 7 capacitors, 4 ICs, 3 connectors and 1 diode. It belongs with the robots and motor control boards and the ESP8266 boards of this library.
Main components
4ESP-12E
SMD,24x16mm-20℃~+70℃ -90dBm 16dBm 170mA 2.4GHz 3V~3.6V 56mA 802.11b/g/n ESP8266 Chip On-board PCB Antenna Over-the-air (OTA) update UART、SPI、I2C SMD,24x16mm WiFi Modules ROHSAi-ThinkerWiFi ModulesDRV8835DSS
WSON-12-EP(2x3)-40℃~+150℃ 1.5A 2 2V~7V 305mΩ 95nA Yes WSON-12-EP(2x3) Brushed DC Motor Drivers ROHSTexas InstrumentsStepper Motor DriverLM1117-3.3
SOT-2231 1.3V@(1000mA) 15V 1A 2mA 3.3V Fixed Over Current Protection、Short Circuit Protection、Thermal shutdown Positive SOT-223 Voltage Regulators - Linear, Low Drop Out (LDO) Regulators ROHShongjiachengUncategorisedLSM6DS3
LGA-14(2.5x3)-40℃~+85℃ 1.71V~3.6V 8KB Accelerometer Gyroscope SPI、I2C X,Y,Z X,Y,Z ±16g ±2000dps LGA-14(2.5x3) Accelerometers ROHSSTMicroelectronicsAccelerometers
README
README.mdESPway
A segway-like balancing two-wheel robot built on ESP8266. It is controlled over WiFi via a HTML/JS GUI and a WebSocket. This is a work in progress. The firmware is meant to run on a WEMOS D1 mini or a similar board.
NOTE for existing users: the Arduino version of this code is deprecated and will not receive the newest improvements from the main branch. However, the Arduino branch will remain in this repo. If you'd like to have something improved or fixed there, please open an issue or preferably a pull request.
Getting started
The firmware is built on the esp-open-rtos project which is included as a submodule in this repo.
For building the firmware, a Linux host is recommended. For other platforms, there is a Docker image one can use. The docker-run script in this repository contains the command that's required to download the image and run commands in the container. It should work fine on macOS hosts. For Windows hosts, I still recommend installing Linux in a virtual machine and installing the tools there.
Installing the tools and building
NOTE: if you intend to use Docker, you only have to install esptool, git and make on your host. Please see below for further Docker instructions.
Using the Docker image
First, install Docker.
Building the firmware using the supplied Docker image is easy. Instead of running make parallel, just run ./docker-run make parallel in the root folder of the repo. The command supplied to the script will be run in the Docker container, and the image will be automatically downloaded.
Flashing the image differs, though, and for this you'll need make on your host. Instead of
make flash ESPPORT=/dev/ttyUSBx(/dev/ttyUSBx being the ESP's serial port) run
make flash-only ESPPORT=/dev/ttyUSBxin your host shell. The separate flash-only target is needed because the flash target would try to build the firmware. In the future, it is intended to provide a separate Python script for flashing, lifting the need for make on host.
TODO: docker-compose configuration file for even easier usage
Installing the tools manually (not recommended, not guaranteed to work)
WARNING: As of currently, the compiler installed by this method seems to have issues compiling the code. Thus this method is not recommended. Please see above for the Docker-based toolchain instead.
Install these packages:
git(from your package manager)xtensa-lx106-elftoolchain. You can useesp-open-sdkto build it, see the instructions in the esp-open-rtos repo.esptool(pip install -U esptool). Please do not use the outdated version pulled byesp-open-sdk.tcc,nodejsandnpmare currently required due to the frontend code, although I'm investigating how to relax this dependency.
Clone this repo (recursive cloning to get also esp-open-rtos and its submodules):
git clone --recursive https://github.com/flannelhead/espway.gitEnter the directory and build the firmware:
make parallelThe parallel target does a clean build with 5 parallel worker threads to make it faster.
Plug your ESP8266 module in via USB and flash the firmware:
make flashThe default port is /dev/ttyUSB0. If you need to change this, use
make flash ESPPORT=/dev/ttyUSBxSupported browsers
Please use the latest Firefox or Chrome if possible. The HTML/JS UI uses some recent JavaScript features which might not be supported by older browsers. However if you encounter any issues on e.g. Safari, don't hesitate to file them in the issue tracker.
Schematic & BOM
There is a PCB design and schematic in the schematic folder which has been tested and is ready to use. There, MPU6050 has been replaced by LSM6DS3 and L293D by DRV8835 for better performance.
Meanwhile, you can still build an ESPway using breakout boards available from the usual sources. A rough bill of materials for this is listed below:
- (not including PCB, connectors, wire etc. materials)
- WEMOS D1 Mini board
- GY-521 (MPU6050 breakout board)
- L293D motor driver IC
- 2x 6V 300rpm metal gear motor (search for "12ga 300rpm" or "n20 300rpm"), these should be $3-5 per piece
- 2x WS2812B neopixels for eyes and showing current state
- AMS1117 5V regulator
- 5x 100n ceramic capacitors
- 2x 1000u 10V electrolytic capacitor
- 470 ohm resistor
- 10 kohm resistor
- 680 kohm resistor
To use the old hardware config and schematic, you'll have to edit src/espway_config.h before compilation. See that file for notes.
See the schematic-old folder for the schematic. It is drawn with KiCad and there's a rendered PDF in the repo.
The new schematic in schematic folder uses components
from kicad-ESP8266 by J. Dunmire,
licensed under CC-BY-SA 4.0. The schematic is also licensed under CC-BY-SA 4.0.
Developing the frontend
The HTML/JS frontend uses Webpack as the build system. You will need NodeJS and NPM (the package manager) to build the frontend pages. It does jobs like bundling the JavaScript modules together, minifying and transpiling the ES2015 code for older browsers, compiling Riot tags, minifying/autoprefixing CSS etc.
After you've cloned this repo, run npm install in the root folder to install the package dependencies. There are two commands specified in package.json which run Webpack:
npm run servestart a web server which serves the static HTML files in thefrontend/outputdirectory. It also watches for changes in the source files infrontend/srcand automatically rebuilds and reloads them. Use this while hacking on the frontend. TODO: Currently this doesn't see changes to HTML files, though.npm run buildproduces a production build of the frontend JS/CSS bundles. Use this before uploading your work to the ESP8266.
License and acknowledgements
The project is licensed under LGPLv3.
The project uses esp-open-rtos which is licensed under the BSD 3-clause license. It also has some components which have different licenses. Read more about them in the esp-open-rtos README.
Parts
37| Qty | Value | Footprint | References |
|---|---|---|---|
| 7 | 10k | Resistors_SMD:R_0603 | R1, R2, R4, R7, R8, R9, R12 |
| 5 | 100n | Capacitors_SMD:C_0603 | C1, C3, C5, C6, C7 |
| 4 | 100 | Resistors_SMD:R_0603 | R3, R5, R6, R15 |
| 2 | 2k2 | Resistors_SMD:R_0603 | R13, R14 |
| 2 | CONN_01X02 | Wire_Connections_Bridges:WireConnection_1.00mmDrill | J1, J2 |
| 1 | 100u | Capacitors_SMD:CP_Elec_6.3x5.8 | C4 |
| 1 | 330 | Resistors_SMD:R_0603 | R10 |
| 1 | 4.8V (4*AAA NiMH) | Wire_Connections_Bridges:WireConnection_1.20mmDrill | BT1 |
| 1 | 470u | Capacitors_SMD:CP_Elec_8x10 | C2 |
| 1 | 82k | Resistors_SMD:R_0603 | R11 |
| 1 | Conn_01x05_Male | Pin_Headers:Pin_Header_Angled_1x05_Pitch2.54mm | J3 |
| 1 | DRV8835 | espway-modules:WSON-12 | U3 |
| 1 | ESP-12E | ESP8266:ESP-12E_SMD | U2 |
| 1 | Ferrite_Bead | Inductors_SMD:L_0603 | L1 |
| 1 | LED | LEDs:LED_0603 | D1 |
| 1 | LM1117-3.3 | TO_SOT_Packages_SMD:SOT-223 | U1 |
| 1 | LSM6DS3 | espway-modules:LGA-14L | U4 |
| 1 | SW_Push | Buttons_Switches_SMD:SW_SPST_KMR2 | SW1 |
The 33 most common of 37 parts.
Questions
How big is the Espway PCB?
It measures 43 × 34.3 mm and has 2 copper layers, 1.6 mm thick.
What parts does the Espway use?
37 parts, built around the ESP-12E, DRV8835DSS, LM1117-3.3 and LSM6DS3. The full list of its parts is on this page, with links to each part's symbol and footprint where PCBKit's library has them.
Where can I download the Espway KiCad files?
From the espway/espway repository on GitHub, at the commit this page was made from: the board is schematic/espway.kicad_pcb. PCBKit opens the board in the browser, with nothing to install.
Can I use the Espway design in my own project?
Its repository publishes it under the LGPL-3.0 licence: you may reuse it on that licence's terms (keep the author's notice, and for a copyleft licence share your changes alike).
Similar boards
- 2 layers51.8 × 58.5 mm

- 2 layers87.9 × 78.1 mm

- 2 layers96.9 × 61.6 mm

Ccb
omelia-iliffe/creature-control-board
Use this circuit board to create your own creatures!
90 parts4MIT - 2 layers33.7 × 97.8 mm

HAN ESP TSS721
UtilitechAS/amsreader-firmware
ESP8266 and ESP32 compatible firmware to read, interpret and publish data to MQTT from smart electrical meters, both DLMS and DSMR is supported
29 parts470 - 2 layers47 × 37.5 mm

- 2 layers60 × 40 mm

Forcegauge
szbeni/forcegauge
Traning for climbing. Load cell with HX711 and real time plotting,
77 parts18GPL-3.0 - 4 layers110 × 55 mm

- 2 layers147.3 × 95.3 mm

Nixie proj conflict-20171112-163801
dm2lct/tlnixie
PCB files for the Turmlabor nixie clock 2.0
117 parts11GPL-3.0