[Lego 51515] Lego 51515 ubluetooth to Arduino

Discussion and questions about boards that can run MicroPython but don't have a dedicated forum.
Target audience: Everyone interested in running MicroPython on other hardware.
Post Reply
osullivp
Posts: 2
Joined: Sat Feb 27, 2021 1:45 pm

[Lego 51515] Lego 51515 ubluetooth to Arduino

Post by osullivp » Sat Feb 27, 2021 1:59 pm

Hi all,

I've been working on a project to develop an object detection capability for my Lego Mindstorms 51515 robot.

Looking at various options I decided to use the ArdObjectTracker Android app to provide the object detection functionality. However, this generates a stream of object detection data over Bluetooth Classic whereas the Lego 51515 hub uses BluetoothLE.

I therefore built a Bluetooth Classic to BluetoothLE bridge using an Arduino Micro, an HC-05 and HM-10 Bluetooth modules. However, getting the Lego 51515 hub to speak to the Arduino board using the MicroPython ubluetooth module was challenging as this is not currently documented in the official MicroPython docs in the Lego 51515/Spike Prime apps. Note that currently the Lego 51515 hub needs to be flashed with the Spike Prime firmware in order to gain access to the ubluetooth module.

I am sharing the full code to the solution in the hope that this can help others wanting to use the Lego 51515/Spike Prime ubluetooth functionality to integrate with external devices. Here is the link to the GitHub repo:

https://github.com/osullivp/Lego51515BL ... ensorFlow

Also, here is a video of the robot in action:

https://www.youtube.com/watch?v=QxI5LIQsAGA


Any questions, please shout!

Regards,

Paul.

hmikelee
Posts: 4
Joined: Tue Apr 06, 2021 5:19 am

Re: [Lego 51515] Lego 51515 ubluetooth to Arduino

Post by hmikelee » Thu Apr 08, 2021 5:22 am

Dear Paul,

Thank you for your post. very inspiring example.

I am trying to link a jetson nano board to Lego 51515 and encountered a very unique problem.

When using terminal emulation and bluetooth on jetson nano board, I can talk to 51515 and ask it to execute commands in raw REPL mode. But when I use pyboard.py to talk to 51515. The same python script can only be executed partially, ie. only some python were executed properly but most of the python calls related to motor functions will have no error response but nothing moved.

I wonder if you can help to point me to some trouble shooting directions

Thank you very much for your help.

hmikelee

osullivp
Posts: 2
Joined: Sat Feb 27, 2021 1:45 pm

Re: [Lego 51515] Lego 51515 ubluetooth to Arduino

Post by osullivp » Fri Apr 09, 2021 8:29 pm

Hi hmikelee,

Thanks for your note. I'm not familiar with the Jetson Nano but by coincidence I was at one point going to use it instead of the Arduino to talk to the Lego 51515 hub.

I found this GitHub project which maybe of use to you:

https://github.com/beemsoft/lego-mindst ... etson-nano

Hope that helps!

Paul.

Post Reply