- Make your curtains smartPosted 16 hours ago
- Configuring an ESP8266 for Battery PowerPosted 4 days ago
- Creating a Telegram Bot for ESP32Posted 5 days ago
- Mini Course on BlynkPosted 6 days ago
- Creating a Unique Electronic Musical Instrument: The Sound WallPosted 1 week ago
- Building a Laser MicroscopePosted 1 week ago
- Grand Piano Keys with ArduinoPosted 2 weeks ago
- Wireless Power TransferPosted 2 weeks ago
- Robot Punchers with ArduinoPosted 2 weeks ago
- A minimal 3D-printed scalePosted 2 weeks ago
LEGO Train Automation – IoL Internet of LEGO
Our mission: Build a WiFi controlled LEGO Power Functions train.
To do that, we used:
- ESP8266 WiFi dev board
- Arduino IDE
- Used to program NodeMCU
- A platform to connect the Internet of Things
- 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.