- How to Adjust X and Y Axis Scale in Arduino Serial Plotter (No Extra Software Needed)Posted 1 month ago
- Elettronici Entusiasti: Inspiring Makers at Maker Faire Rome 2024Posted 1 month ago
- makeITcircular 2024 content launched – Part of Maker Faire Rome 2024Posted 4 months ago
- Application For Maker Faire Rome 2024: Deadline June 20thPosted 5 months ago
- Building a 3D Digital Clock with ArduinoPosted 10 months ago
- Creating a controller for Minecraft with realistic body movements using ArduinoPosted 11 months ago
- Snowflake with ArduinoPosted 11 months ago
- Holographic Christmas TreePosted 11 months ago
- Segstick: Build Your Own Self-Balancing Vehicle in Just 2 Days with ArduinoPosted 12 months ago
- ZSWatch: An Open-Source Smartwatch Project Based on the Zephyr Operating SystemPosted 1 year ago
LEGO Train Automation – IoL Internet of LEGO
Our mission: Build a WiFi controlled LEGO Power Functions train.
To do that, we used:
- NodeMCU
- ESP8266 WiFi dev board
- Arduino IDE
- Used to program NodeMCU
- Node-RED
- A platform to connect the Internet of Things
- Raspberry-Pi
- Single board Linux computer to run Node-RED
- LEGO Power Functions & Train
- LiPo battery powered motors
The ESP8266 is the greatest thing since sliced bread, for IoT projects. It’s basically an 802.11n WiFi chip with a microcontroller that provides GPIOs. The only issue with this is that it can be a pain to get going. The chip only supports 3.3v and requires some additional circuitry to program and connect to a USB interface. It’s doable, but the small chip expands into a larger circuit which increases overall install size (in development environments). The NodeMCU attempts to solve these problems by placing the ESP8266 on a dev board, that includes GPIO breakouts, a USB interface and power management.
By writing some minimal code on the chip, I can control a motor via a simple REST interface. Basically, I can just go to a web URL and something happens.
To provide a front-end and connect it to the Internet of Things, I will use Node-RED hosted on a Raspberry Pi. Like many of the other Internet of LEGO projects, Node-RED is used to send commands, collect data and build a simple UI to interact with the network.
The motor shield will provide a simple way to power the LEGO train motor. Since the microcontroller is not intended for higher voltages and current, a shield will be used to switch on the heavier loads. This version supports two motors and provides access to the remaining GPIO pins.
The Raspberry Pi will be used to host Node-RED and run a Mosquitto MQTT broker/bridge.
The LEGO Group have released various versions of LEGO train electronics over the years. The latest version uses a LiPo battery, infrared controller and 7.4v motor. This project will effectively replace the infrared controller with a NodeMCU WiFi controller
Follow the step by step guide on Internet of LEGO official page.