Protez1982 Posted February 10, 2019 Posted February 10, 2019 (edited) I want to tell how I manage lego trains through the controller esp and arduino.At the moment I learned to manage the train and switching rails. I installed 2 trolleys in 1 train so that he could carry more cars.The total price of all components is about $ 10 and it all connects to the standard Lego carts. Edited February 10, 2019 by Protez1982 Quote
Frank STENGEL Posted February 10, 2019 Posted February 10, 2019 Nice, If I understand well, you are controling your train using an ESP8266 via WiFi with an android app. How are you driving the motor(s)? Quote
Protez1982 Posted February 11, 2019 Author Posted February 11, 2019 All right, you understand, to control the motors used motor control L298N Quote
XG BC Posted February 11, 2019 Posted February 11, 2019 i have one question: why are your front lights blue or ultraviolet? XG BC Quote
Protez1982 Posted February 11, 2019 Author Posted February 11, 2019 I put a blue LED. In the new version I have 2 color. Blue and red. And depending on which way the train travels in blue or red. Quote
XG BC Posted February 11, 2019 Posted February 11, 2019 i've never seen a locomotive with blue front lights before. have you got a picture of one? XG BC Quote
treczoks Posted February 11, 2019 Posted February 11, 2019 10 hours ago, Protez1982 said: All right, you understand, to control the motors used motor control L298N Not good if you're using batteries. The L298N is old, and wastes lots of energy. That's why you need cooling for it. I chose the Toshiba TB6612FNG for my project. It has the additional benefit of only needing one PWM per motor, i.e. you've got two "normal" pins telling the motor what to do, and a third PWM input that tells the chip how fast to go. Quote
Protez1982 Posted February 11, 2019 Author Posted February 11, 2019 3 hours ago, XG BC said: i've never seen a locomotive with blue front lights before. have you got a picture of one? XG BC This is not the original Lego diode, it is a normal LED, it fits perfectly with the Lego train. 1 hour ago, treczoks said: Not good if you're using batteries. The L298N is old, and wastes lots of energy. That's why you need cooling for it. I chose the Toshiba TB6612FNG for my project. It has the additional benefit of only needing one PWM per motor, i.e. you've got two "normal" pins telling the motor what to do, and a third PWM input that tells the chip how fast to go. Thanks for the tip, I will try this engine controller. Although I did not notice the difference in current consumption in comparison with the original Lego controller. I use 2 traction carts and more than 10 wagons Quote
treczoks Posted February 11, 2019 Posted February 11, 2019 4 hours ago, Protez1982 said: Although I did not notice the difference in current consumption in comparison with the original Lego controller. Just look at the chips datasheet, it can easily drop up to 4.7V under load, so if your input current is 12V, the output can be as low as 7.3V, and the remaining 4.7V times the power (let's say 1A) just feeds the heat sink. I stumbled over this primarily for the heat sink issue - I wanted to build a small controller board (Arduino Nano plus two H-bridges plus LED outputs), and had the L298 in mind, too (as I've got a few of those modules here). But the odd pinout and the need for the rather bulky heat sink made me think. Because the LEGO controllers don't have such a large heat sink and bulky H-bridges I asked around, and ended up with the Toshiba one. I don't know their voltage drop, but the SMD package does not need any extra cooling, so it can't be that much. Quote
Protez1982 Posted February 12, 2019 Author Posted February 12, 2019 I do not use a radiator. As an experiment, I started the train and 7 cars at full capacity until the battery runs out and the controller withstood this test without problem Quote
XG BC Posted February 12, 2019 Posted February 12, 2019 i think you have understood me wrong what i ment that i havent seen any locomotive in real life that uses blue front lights. XG BC Quote
Bartosz Posted February 12, 2019 Posted February 12, 2019 That's very interesting! Making custom solution was always on my mind, especially because I'm interested in something that can give smaller form-factor (even at a price of capablilties). Could you post more details? Photos of the controller+motor driver and how it's all assembled would be great, schematics (informal, just a writeup on used components) would be awesome :) Quote
Protez1982 Posted February 12, 2019 Author Posted February 12, 2019 (edited) This is the very first model on esp8266,In addition, I have a couple of trains on the arduino pro mini and bluetooth module hc-06. I use 6 AAA batteries and 9 volt batteries. Edited February 12, 2019 by Protez1982 Quote
dr_spock Posted February 12, 2019 Posted February 12, 2019 Nice and inexpensive solution. I've been playing around with a Wemos D1 mini with Toshiba TB6612 motor shield. Interestingly, the motor shield uses a STM32 chip for the I2C communication. I had to reflash the STM32 chip to work properly. Now I have to figure out how to do the wifi thingie. What do you use to do your wifi protocols? Quote
bricks n bolts Posted February 13, 2019 Posted February 13, 2019 This is cool, anyone tried one of these with the Toshiba TB6612FNG? : https://uk-m.banggood.com/Mini-Ultra-small-Size-ESP-M3-From-ESP8285-Serial-Wireless-WiFi-Transmission-Module-p-1215064.html I've been playing around with a Wemos D1 mini with Toshiba TB6612 motor shield. Interestingly, the motor shield uses a STM32 chip for the I2C communication. Wow, that looks compact. What are the total dimensions? Does the STM32 chip you have already have wifi and you just need to figure out how to use it or do you still need to get a version with the wifi component onboard? Quote
dr_spock Posted February 13, 2019 Posted February 13, 2019 2 hours ago, bricks n bolts said: This is cool, anyone tried one of these with the Toshiba TB6612FNG? : https://uk-m.banggood.com/Mini-Ultra-small-Size-ESP-M3-From-ESP8285-Serial-Wireless-WiFi-Transmission-Module-p-1215064.html Wow, that looks compact. What are the total dimensions? Does the STM32 chip you have already have wifi and you just need to figure out how to use it or do you still need to get a version with the wifi component onboard? The ESP8266 Wemos board + TB6612 motor shield is roughly 40mm x 30mm x 15mm. You would program the ESP8266 which would handle the wifi and control of the motor shield. The STM32 on the motor shield is the go between the ESP8266 and TB6612 motor driver chip. It provide an I2C interface. Quote
Protez1982 Posted February 23, 2019 Author Posted February 23, 2019 The next project will be the Lego 75955 motorization. At the moment I have a 9 volt trolley, I will make an ordinary trolley and power it from a 9 volt battery. Quote
treczoks Posted February 23, 2019 Posted February 23, 2019 On 2/13/2019 at 1:45 AM, bricks n bolts said: This is cool, anyone tried one of these with the Toshiba TB6612FNG? I have exactly this chip as a module on the table, but I have not tried it (yet). I'm planning a PCB for an Arduino Nano and this bridge to run two (LEGO) motors and up to 4x2 LEDs. Quote
Protez1982 Posted February 23, 2019 Author Posted February 23, 2019 (edited) I used 2 motor carts and on 1 and 2 different channels of the controller. Everything is working. Arduino nano I used with HC-06. Edited February 23, 2019 by Protez1982 Quote
bricks n bolts Posted March 10, 2019 Posted March 10, 2019 On 2/23/2019 at 1:42 PM, treczoks said: I have exactly this chip as a module on the table, but I have not tried it (yet). I'm planning a PCB for an Arduino Nano and this bridge to run two (LEGO) motors and up to 4x2 LEDs. @treczoks Looking forward to any progress updates! @Protez1982 Your motor control L298N must be smaller than the ones they used to sell to fit nicely into that tender Quote
Protez1982 Posted March 11, 2019 Author Posted March 11, 2019 (edited) Edited March 11, 2019 by Protez1982 Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.