Sano23

Legonino + ESP32 + Arduino

Recommended Posts

Hello

I control my two trains (bluetooth) with legoino + ESP32 and this works ok. Now I want that every train have their own arduino mini or ESP32 with color and ultrasonic sensor like HC-SR04 for automatic drive. ¿Can I comunicate arduino/esp32 in trains with the first esp32 board that control the trains via bluetooth if this one is controlling the trains via bluetooth + legoino?

 

Thank you

Share this post


Link to post
Share on other sites

Hi,

I think it has nothing to do with legoino.

Have a look at ESP-NOW, but it's WiFi

Share this post


Link to post
Share on other sites
8 hours ago, Sano23 said:

I control my two trains (bluetooth) with legoino + ESP32 and this works ok.

Welcome on EB!

Now, this means that as of now you have LEGO hubs on the trains, correct?

If so, do you want to 1) replace the LEGO hub with an ESP32 or 2) add the ESP to the train to operate the sensors you are talking about?

Best
Thorsten

Share this post


Link to post
Share on other sites

Hello Toastie. Now I control the lego train hub with ESP2 and legoino, but I want to put sensors in the trains to become autonomous. My idea is put lego colors pieces on the rails as codes to control the two train velocity and put an ultrasonic sensor to avoid crashes and some sensor in the station to stop the train "x" seconds maybe. I wolud like to know how comunicate all this with my working ESP32. I was thinking to make all comunication via wifi maybe and control the train with bluetooth.

 

PD: I think is option 2. But I will accept any suggestion

Share this post


Link to post
Share on other sites

What I have done is the following, use a powered up hub on the train to control it. Use an ESP32 to control the powered up hubs (I think up to 9 hubs can ben controlled like this). Use reed sensor to detect position/speed and connect those to a separate ESP32 to be able to send the input to the controller.

Mattzobricks has all the software needed.....

Share this post


Link to post
Share on other sites

Hi,

that's completety  different,

@Sano23 wants to add an ESP32 to each train to add sensors.

Each train should be autonomous. (Whay should they communicate then?)

@Kalindor71 uses 1 ESP to control up to 9 trains, this is what I showed here already.

 

So @Sano23 could you please describe the desired architecure including all(!) HW-components?

Interesting question!

 

 

Share this post


Link to post
Share on other sites
8 hours ago, Lok24 said:

Hi,

that's completety  different,

@Sano23 wants to add an ESP32 to each train to add sensors.

Each train should be autonomous. (Whay should they communicate then?)

@Kalindor71 uses 1 ESP to control up to 9 trains, this is what I showed here already.

 

So @Sano23 could you please describe the desired architecure including all(!) HW-components?

Interesting question!

 

 

Well it's a bit dificult to concrete my desire architecture Lok24. My son have two new trains from this chirstmas and I've an arduino with bluettoth and ESP32 to make some simple circuits. And this days I found legoino library example navigating from internet. First I think is put a screen info in the station with information and make some servo barriers, but it could be nice that train go in the little circuit I've and stops when found a lego color brick like this video. But when my son put this bricks it posible to have a crach and I think hc-sr04 that I 've from arduino pack I could be nice to avoid it. And here we are with 2 trains, 1 arduino and 1 ESP32 and searching as musch information as I can to build something simple to my son and strat my first project.

Thanks

 

Share this post


Link to post
Share on other sites

Thanks for explanation.

But for stopping a train  if there is another train in front you only need to control the second  train itself, no need to send command to the leading train?

I cannot imagine any scenario why trains should interact with each other.

 

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.