User Tools

Site Tools


arduino:wioctrl-en

This is an old revision of the document!


French VersionDeutsche VersionEnglish Version

WIO Control

ContentArduino


Work In Progress

The WIO Control is based on ESP32 Dev Module and LOLIN D32 boards.


Display

wioctrl-display.jpgwiocontrol-lolind32.jpg WIO Control needs a display for some of its functions:

  • Status bar
  • Locomotive selection
  • Function selection


Programming

ESP32 Dev Module

The Boot button must be pressed to be able to flash this module over USB.
This button is located right beneath the display.
esp32devmodule.jpg

The following error will show up in the Arduino IDE if this button is not pressed:

Connecting........_____....._____....._____....._____....._____....._____....._____....._____....._____....._____
 
A fatal error occurred: Failed to connect to ESP32: Timed out waiting for packet header


Pinout

ESP32 Dev Module LOLIN D32
esp32devmodule-pinout.jpg lolin-d32.jpg


Extended Layout

The board selection is selected in the Pins.h file.

#define ESP32_DEV_MODULE 0
#define ESP32_LOLIN_D32  1
 
#define WIO_BOARD ESP32_LOLIN_D32

wiocontrol.jpeg

Preliminary

Compared with the Lolin D1 Mini, the ESP32 has a lot more I/O Pins, so an extra F0 and Shift button are added.

ESP32 Dev Module

GPIO Function Selection mode Shift function Long click Long click + shift
26 Rotary V+ Browse loco list down - -
25 Rotary V- Browse loco list up - -
36 Rotary direction Take over the selected loco from the list. Alter between loco 1 and 2. -
27 F0 - - Power off Power on
32 F1 - F9 F5 F13
33 F2 - F10 F6 F14
0 F3 - F11 F7 F15
14 F4 - F12 F8 F16
13 Shift - - -
16 LED - - -
35 Battery (ADC) - - -

Voltage divider

A voltage divider is needed to measure the Lipo(battery).
GPIO35 is connected to the Lipo + with 47k resistor, and with a 100k resistor to the ground(GND).

NoGo Pins

The following pins can not be used:

  • GPIO06 - GPIO11 (Are in use by the Flash interface.)
  • GPIO12 can only be used as output. If the pin is pulled up at boot time, the ESP32 won't boot.


ESP32 LOLIN D32

GPIO Function Selection mode Shift function Long click Long click + shift
26 Rotary V+ Browse loco list down - -
25 Rotary V- Browse loco list up - -
34 Rotary direction Take over the selected loco from the list. Alter between loco 1 and 2. -
27 F0 - - Power off Power on
32 F1 - F9 F5 F13
33 F2 - F10 F6 F14
0 F3 - F11 F7 F15
14 F4 - F12 F8 F16
12 Shift - - -
5 LED - - -
35 Battery (ADC) - - -
21 SDA - - -
22 SCL - - -

Voltage divider

The LOLIN D32 has a build in divider on GPIO35: 100k/100k.
See: https://wiki.wemos.cc/_media/products:d32:sch_d32_v1.0.0.pdf

I2C Display

The I2C SSD1306 compatible 128*64 display, must be connected to GPIO21(SDA) and GPIO22(SCL).

Short IDs

Use Transmit short IDs to load the locomotive short IDs into WIO Control.


Selecting a locomotive

  1. Press and release the shift button; On the bottom display line the first ID is shown.
  2. Turn the rotary until the wanted locomotive is selected.
  3. Push the rotary button to activate the selected locomotive.

Just press and release the shift again to cancel the selection procedure.


Hardware

A fitting case could be:

Schedule and PCB

WIP
arduino/wioctrl-en.1577556736.txt.gz · Last modified: 2019/12/28 19:12 by rjversluis