Protez1982

Lego train arduino (esp8266), power/

Recommended Posts

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 by Protez1982

Share this post


Link to post
Share on other sites

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.

Share this post


Link to post
Share on other sites

i've never seen a locomotive with  blue front lights before. have you got a picture of one?

XG BC

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
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.

IMG_20190211_202451.jpg?x-email=protez19

IMG_20190211_202509.jpg?x-email=protez19

 

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

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites

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

Share this post


Link to post
Share on other sites

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

Share this post


Link to post
Share on other sites

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 :)

Share this post


Link to post
Share on other sites

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.

duracell_krona.jpg

IMG_20190212_210608.jpg

Edited by Protez1982

Share this post


Link to post
Share on other sites

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?

 

Share this post


Link to post
Share on other sites

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?

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites

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.

IMG_20190223_120820.jpg

IMG_20190223_120810.jpg

 

 

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites

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 by Protez1982

Share this post


Link to post
Share on other sites
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

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Recently Browsing   0 members

    No registered users viewing this page.