ESP8266

The ESP8266 is a low-cost Wi-Fi chip with a full TCP/IP stack and MCU (Micro Controller Unit) capability produced by the Chinese manufacturer Espressif Systems. Since this processor does not have internal ROM memory, it is presented in the form of modules in which they are included together with an external Flash memory chip. These small modules allow microcontrollers (PIC, Arduino, ...) to connect to a Wi-Fi network and make simple TCP/IP connections using Hayes type commands.

The interesting thing about this module is that you can replace the serial firmware with our own program as if it were an Arduino, we just have to create the sketch and load it from the Arduino IDE. This will overwrite the AT Hayes command firmware that comes by default.



ESP-01

The ESP-01 is the most popular and small module. Two digital GPIO pins are available to control sensors and actuators. The Rx and Tx pins can also be used for this use if they are not used for communication through the serial port. It can be programmed through a serial/USB adapter or with the appropriate wiring, through Arduino.



ESP-12

The ESP-12 and its newest version ESP-12E has 11 GPIO ports, one pin is analog with a 10-bit resolution (1024 possible values).



ESP-12

Unlike the other modules, it comes with everything you need to start working autonomously. It includes a serial/USB adapter and is powered through the microUSB. It is based on the ESP-12E, so it has 11 GPIO ports, one pin is analog with a 10-bit resolution (1024 possible values).



Here you will find the designs that I have made with the ESP8266:

PacoWagonWagon for measuring speed and distance traveled and ramp/cant for scale trains
PacoWagonDisplayWiFi display for PacoWagon and the Fast Clocks MRclock, Rocrail and JMRI


PacoWagon
PacoWagon

Wagon for measuring speed and distance traveled and ramp/cant for scale trains, the data can be displayed on the mobile phone comfortably in the web browser (Chrome, Safari, Explorer, ...) thanks to the fact that it creates a WiFi hotspot. You can even connect to your router or view the measurements in the PacoWagonDisplay.

In the mobile phone browser you can display the speed in km/h (at scale) or in cm/s, the distance traveled in km (at scale), cm or m. The distance traveled can be reset. In addition, the battery voltage is displayed. You can also see a speed histogram by clicking on the speed chart.

Actual and scaled speed

In addition, if an MPU6050 inclinometer module is installed, the ramp and cant of the track are shown. Clicking on this data shows the inclinations graphically.

You can also install a small 128x64 pixels OLED screen to see the information.

It is suitable for any scale (N, TT, H0, 0, 1, G) and is easily calibrated. An opto, a Reed or a Hall can be used as a sensor.

PacoWagon

Very simple circuit made with an ESP-01 and powered from a LiPo battery

Download the manual here, if you want to build your own PCB or identify components see this tutorials.

You may also be interested in a static speed meter with Arduino, the LocoSpeed

PacoWagonDisplay
PacoWagon

Display to visualize the data transmitted by PacoWagon, the wagon for measuring speed and distance traveled and ramp/cant for scale trains, the data can be displayed on the mobile comfortably in the web browser (Chrome, Safari, Explorer, ...) thanks to create a WiFi access point or on the OLED screen of PacoWagonDisplay. Using the button you can see on the OLED screen the different data that is transmitted as if it were the optional PacoWagon screen.

PacoWagonDisplay can also function as a client of a fast clock network that uses the MRclock UDP Multicast protocol and can display the time of up to 6 different MRclock servers. Using the PacoWagonDisplay button you can display the time and messages of each of the MRclock servers that have been located in the WiFi network to which you have connected.

Another mode of PacoWagonDisplay allows to display the scale clock time at the JMRI program if the JMRI web server is activated.

With Rocrail you can also display the scale clock time from Rocweb.

PacoWagon
PacoWagon

You can use the same circuit as in PacoWagon with the ESP-01 or a NodeMCU module (ESP-12E) that can be powered from USB and already has the built-in button

Download the manual here, if you want to build your own PCB or identify components see this tutorials.