/lego-magic-train

Using an ultrasonic sensor, I created a piece of moving a LEGO train. Putting my hand closer to the sensor speeds up the train, and moving away from the sensor slows it down. I used Arduino, ultrasonic sensor, infrared transmitter, LEGO infrared receiver, and LEGO motor.

Primary LanguageC++MIT LicenseMIT

Lego Magic Train

Using an ultrasonic sensor, I created a piece of moving a LEGO train.

The train speeds up when I put my hand close to the sensor. If I move my hand away from the sensor, it slows down.

Snapshot

Snapshot

Prerequisite

You must have PowerFunctions.cpp, PowerFunctions.h file in advance.

These files could be downloaded at https://github.com/jurriaan/Arduino-PowerFunctions .

Bill Of Materials

Label Part Type
LED1 Red (633nm) LED
R1 220Ω Resistor
Part1 KY-005 Infrared Transmitter Module
Part2 HC-SR04 Ultrasonic Sensor
Part3 Arduino Uno (Rev3)

Circuit

Image Of Circuit

Movie

YouTube - Controlling Lego Train By Palm

References

[1] HC-SR04 Ultrasonic Sensor

[2] Lego Power Functions Infrared Control for Arduino

Full Explanation Page

https://blog.naver.com/pcmola/221195632598