Lowa

Brick to connect PF motor to Arduino board

Recommended Posts

This is a fully functional prototype of a brick (2 x 4 x 1) that we developed to make it easy to control PF motors with Arduino boards.  It has a PF connector on the top to connect the PF motor  and a 4PIn cable to connect to  the Arduino board; it has 8 anti studs on the bottom to connect it to LEGO bricks.  It allows controlling the direction and speed of the PF motors.  We tested it with the M-motor, L-motor, XL motor and the train motor. 

 

4dbrix-pf-to-arduino.jpg4dbrix-pf-to-arduino2.jpg

 

This is the brick in action with an M-motor:

Let us know what you think or what you would use it for! 

 

 

Share this post


Link to post
Share on other sites

Seems like an interesting idea to me, For M motor typical requirement is 150MA, is the motor driven directly by Arduino or is there a motor driver in-between?

Share this post


Link to post
Share on other sites

I am in the process of trying to find interface for power functions to Arduino. So far all I have found are generic motor driver shields and motor drivers and shields for interfacing NXT motors and sensors.

is this prototype going to go into production? When and how much? Are there libraries written for this module? I am extremely interested in integrating Arduino in LEGO constructions.

Andy D

Share this post


Link to post
Share on other sites
7 hours ago, Lowa said:

We tested it with the M-motor, L-motor, XL motor and the train motor. 

But what about the servo motor? And do the wedo sensors work?

Share this post


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

Seems like an interesting idea to me, For M motor typical requirement is 150MA, is the motor driven directly by Arduino or is there a motor driver in-between?

You can indeed not drive a motor directly from an Arduino board.  This brick contains a motor driver to provide the power/current the motor requires.  That's why there are 4 pin on the cable:

  • GND: connected to the 9V power supply
  • 9V: connected to the 9V power supply
  • Control pin 1; connected to a PWM arduino pin
  • Control pin 2; connected to a PWM arduino pin

Share this post


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

I am in the process of trying to find interface for power functions to Arduino. So far all I have found are generic motor driver shields and motor drivers and shields for interfacing NXT motors and sensors.

is this prototype going to go into production? When and how much? Are there libraries written for this module? I am extremely interested in integrating Arduino in LEGO constructions.

Andy D

It's very easy to use and does not require any Arduino libraries.  Connect the two control pins (orange and yellow wires) to two PWM pins of your Arduino board.  To run the motor, set control pin 1 to GND - analogWrite(0) - and control pin 2 to a higher voltage - analogWrite(0-255).  The higher the voltage, the faster the motor goes.  To run the motor in the other direction, set control pin 2 to GND and control pin 1 to a higher voltage.  If both pins are GND the motor stops.

We're thinking of starting a Kickstarter campaign later this month.  The bricks are going to be 3D printed; we have a lot of experience with 3D printing LEGO compatible parts.  We currently producing and selling automation systems for LEGO trains and monorail.  All our motors and sensors are mechanically compatible with LEGO and electrically with Arduino.  You can find detailed information on how to link our LEGO compatible components to Arduino on our website: https://www.4dbrix.com/documentation/arduino/  

The price point for this motor driver would be around $15.

 

 

Share this post


Link to post
Share on other sites

Very interesting project, it may be a great base for a custom arduino bluetooth control for lego models. Good luck with the Kickstarter campaign!

3 hours ago, move5 said:

But what about the servo motor? And do the wedo sensors work?

The photos show that this version has only 2 connections on the PF plug rather than typical 4, what means that the servo won't work , and I believe that WeDo sensors neither. 

Edited by Xewyz2001

Share this post


Link to post
Share on other sites
2 hours ago, move5 said:

But what about the servo motor? And do the wedo sensors work?

I'm not familiar with the LEGO servo motors and wedo, so thank you @Xewyz2001 for your feedback on this one.

If you want to integrate servo motors into your Arduino powered LEGO creations you might want to take a look at our servo motor.  It's fully LEGO compatible: technic axle for actuation, 4 technic peg holes in the front and 4 axle holes on the sides to mount the motor.  Our servo motor has a range between 0 and 180 degrees with a step of 1 degree.  You can use the Arduino servo.h library to control it.  The servo motors are available in our online store (www.4dbrix.com) for $15/motor.

This video shows one in action.  The motor is on the left, on the right you have a prototype of a LEGO / Arduino compatible rotation sensor.  In this demo, the servo copies the angle of the sensor.

4dbrix-servo.jpg

We have an Arduino compatible 'train detection sensor'.  It detects objects that are in a range of 1 - 5 studs of the sensor.  You can use it a proximity sensor, but I guess we would have to change the shape of the brick to make it practical for robotics applications.  

train-sensor.png

 

 

 

 

 

 

Share this post


Link to post
Share on other sites
40 minutes ago, Xewyz2001 said:

Very interesting project, it may be a great base for a custom arduino bluetooth control for lego models. Good luck with the Kickstarter campaign!

The photos show that this version has only 2 connections on the PF plug rather than typical 4, what means that the servo won't work , and I believe that WeDo sensors neither. 

Thank you!

Share this post


Link to post
Share on other sites

Your youtube channel is strange....

I can watch the arduino test video and the servo motors test video, but once I get into your channel, I can't see where they are.

Share this post


Link to post
Share on other sites
25 minutes ago, move5 said:

Your youtube channel is strange....

I can watch the arduino test video and the servo motors test video, but once I get into your channel, I can't see where they are.

Sorry for the confusion.  We try to keep our channel 'clean' and only make the videos that are properly edited visible.  Short clips like this that are meant to embed in our website or forum post are indeed not visible.  You certainly have a point that this might be confusing...  I added a playlist with all the short clips like this to our channel:

https://www.youtube.com/playlist?list=PL2Uj7DpKkZjiwdvn7WX6OJKwq8qhpRFxU

Share this post


Link to post
Share on other sites
2 hours ago, Lowa said:

The price point for this motor driver would be around $15.

 

Get the Kickstarter going! I will sign up,for two (2)!

Andy D

Share this post


Link to post
Share on other sites
54 minutes ago, Andy D said:

Get the Kickstarter going! I will sign up,for two (2)!

Andy D

Great!  

Any ideas on how we can spread the word ?  Our main contacts are within the LEGO train / monorail community.  Are you aware of something specific for AFOLs involved in Arduino ?

Share this post


Link to post
Share on other sites
18 minutes ago, Lowa said:

Great!  

Any ideas on how we can spread the word ?  Our main contacts are within the LEGO train / monorail community.  Are you aware of something specific for AFOLs involved in Arduino ?

I only use Eurobricks, so I have no connection to other AFOL communities. Spreading the word on an Arduino and LEGO product could be difficult and time consuming, but if you just post something about your KS on every LEGO site that will allow it that would be a start. You might look at how others have spread the word about LEGO KS and Arduino KS. 

Why do you need a KS? Seems like you already have a lot going on?

Andy D

4 hours ago, Lowa said:

You can indeed not drive a motor directly from an Arduino board.  This brick contains a motor driver to provide the power/current the motor requires.  That's why there are 4 pin on the cable:

  • GND: connected to the 9V power supply
  • 9V: connected to the 9V power supply
  • Control pin 1; connected to a PWM arduino pin
  • Control pin 2; connected to a PWM arduino pin

Is the motor driver an IC (like the L293D) of a darlington transistor or other?  Just curious what you are using to buffer the Arduino from the motor.

Thanks,

Andy D

Edited by Andy D

Share this post


Link to post
Share on other sites
27 minutes ago, Andy D said:

I only use Eurobricks, so I have no connection to other AFOL communities. Spreading the word on an Arduino and LEGO product could be difficult and trim consuming, but if you just post something about your KS on every LEGO site that will allow it that would be a start. You might look at how others have spread the word about LEGO KS and Arduino KS. 

Why do you need a KS? Seems like you already have a lot going on?

Andy D

We indeed have a few things going on already.  But kickstarter really helps with the logistics to get things going...  for example, it always us to buy components 'in bulk'.  

Share this post


Link to post
Share on other sites
53 minutes ago, Andy D said:

Is the motor driver an IC (like the L293D) of a darlington transistor or other?  Just curious what you are using to buffer the Arduino from the motor.

Indeed, this brick has a motor driver IC similar to the L293D, the one we use can handle more current than the L293D.  I apologize for not going into more detail; we just had our previous kickstarter campaign copied while we're still fulfilling our backers pledges ... :sceptic:  So I'm a bit cautious now.  Of course we going to provide the specifications you need to use it!

Edited by Lowa

Share this post


Link to post
Share on other sites
2 hours ago, Lowa said:

We indeed have a few things going on already.  But kickstarter really helps with the logistics to get things going...  for example, it always us to buy components 'in bulk'.  

Yeah,  I see, but I see this as a niche product, I really like it,  but I would be surprised if it sells in any substantial volume. 

Good luck with your campaign and business, I really want you to succeed as I believe it will really help the LEGO/Arduino community.

Andy D

Share this post


Link to post
Share on other sites
14 hours ago, Lowa said:

You can indeed not drive a motor directly from an Arduino board.  This brick contains a motor driver to provide the power/current the motor requires.  That's why there are 4 pin on the cable:

  • GND: connected to the 9V power supply
  • 9V: connected to the 9V power supply
  • Control pin 1; connected to a PWM arduino pin
  • Control pin 2; connected to a PWM arduino pin

Excellent, PWM will make it really versatile. Thanks!

Share this post


Link to post
Share on other sites

I've been thinking about this thread. I know that there are more Arduino users on Eurobricks than have responded to this thread. I have heard more than once that some folks only read one or two sub forums on EB, I wonder if @Lowa might consider another thread in the General discussion area to solicit some imput from other users.

i also would be interested in hearing from others. 

I can see Arduino being used in Town for elevators, moving vehicles around and lighting controllers.

We know that Arduino is popular with LEGO trains, yet we did not hear from any of them here.

If @Lowa can only find 4 people on EB interested in your device, well, the prognosis does not look good, and I want 1 or 2 of these devices.

Good luck,

Any D

Share this post


Link to post
Share on other sites

I would also be interested. I've been looking for something like this for a while. 

The only additional part to complete this, for my interest, would be a proximity sensor like shown for the train but with a compact form factor (or mechanical like the mindstorm sensor). Then one could do some nice automation. 

Edited by Minique85

Share this post


Link to post
Share on other sites

I didnt know arduino so far, but if i think about this... if there are some guys using electronics combined with lego... why should they buy a brick wich they could solder themselve?

I think if someone can use a arduino-board, he can also solder 4 wires to a motordriver.  The only plus i see here, is the really nice design of the brick-hull. 

Or do i miss something here?

Edited by TechnicSummse

Share this post


Link to post
Share on other sites
3 hours ago, TechnicSummse said:

I didnt know arduino so far, but if i think about this... if there are some guys using electronics combined with lego... why should they buy a brick wich they could solder themselve?

I think if someone can use a arduino-board, he can also solder 4 wires to a motordriver.  The only plus i see here, is the really nice design of the brick-hull. 

Or do i miss something here?

@TechnicSummseYou are correct. The easy part is putting a couple of parts together to drive a motor. The hard part is making a package that looks nice. 

This is exactly what @Lowais looking to provide... something functional that also looks good. Most of us want our MOCs to look good, not a bunch of wires and exposed circuits and this is a good start for making Arduino controlled MOCs look good. The next step is box for the Arduino that is LEGO compatible to conceal the electronics.

i really hope @Lowa succeeds because this is a direction I want to take my MOCs that use Power Functions.

Andy D

Share this post


Link to post
Share on other sites
52 minutes ago, Andy D said:

You are correct. The easy part is putting a couple of parts together to drive a motor. The hard part is making a package that looks nice.

 

I play around with lego and arduino a lot. For something like this, it doesn't matter where the motor driver is - near the motor or near the arduino. Since you are going to have to bury the arduino somewhere, you might as well bury the driver board with it and have a nice clean cable and the smallest adapter coming out (if you don't mind abusing the original motor you can also cut the connector off if the cable is long enough for you). I use something very similar but made from a lego extension cable - they look nicer, have a smaller adapter and have better clutch than something 3D printed. That said, if you are going non-purist then it is even more cost effective to do away with the lego motors altogether and use a generic one, and assemble it into a case or frame built from lego.

Youtube user "Technic Robot" has some great tutorials on doing this type of stuff. These were really useful a couple of years ago when I was learning.

I imagine most people that like messing about with arduino are also likely to mess about with what they are driving with it. 

 

 

 

And if you can get away with a low torque servo for a project, then you can make a lego compatible one from a £1 / $1.50 SG-90 and you can run this directly from the arduino. Torque here is low, but it is enough to drive railway points or tip a hopper, for example. So you can even play around with something very cheap to get you started.

 

 

Edited by MAB

Share this post


Link to post
Share on other sites
On 8/3/2017 at 6:22 PM, Minique85 said:

I would also be interested. I've been looking for something like this for a while. 

The only additional part to complete this, for my interest, would be a proximity sensor like shown for the train but with a compact form factor (or mechanical like the mindstorm sensor). Then one could do some nice automation. 

Great!  We're indeed thinking of making a IR sensor dedicated for robots.  A LEGO / Arduino compatible touch sensor should be possible too...

12 hours ago, TechnicSummse said:

I didnt know arduino so far, but if i think about this... if there are some guys using electronics combined with lego... why should they buy a brick wich they could solder themselve?

I think if someone can use a arduino-board, he can also solder 4 wires to a motordriver.  The only plus i see here, is the really nice design of the brick-hull. 

Or do i miss something here?

Sure, there will be people who prefer to solder it themselves.  But we're providing an alternative if you want to focus on developing your LEGO creation.  This is also part of a larger project where we'll have additional components so you can create LEGO robots using Arduino without having to make PCBs and soldering components...

9 hours ago, Andy D said:

@TechnicSummseYou are correct. The easy part is putting a couple of parts together to drive a motor. The hard part is making a package that looks nice. 

This is exactly what @Lowais looking to provide... something functional that also looks good. Most of us want our MOCs to look good, not a bunch of wires and exposed circuits and this is a good start for making Arduino controlled MOCs look good. The next step is box for the Arduino that is LEGO compatible to conceal the electronics.

i really hope @Lowa succeeds because this is a direction I want to take my MOCs that use Power Functions.

Andy D

Indeed, the goal to have off the shelf LEGO-Arduino compatible components that also look good.  A box to conceal the Arduino would indeed be interesting...

Share this post


Link to post
Share on other sites
On 8/3/2017 at 5:57 PM, Andy D said:

I've been thinking about this thread. I know that there are more Arduino users on Eurobricks than have responded to this thread. I have heard more than once that some folks only read one or two sub forums on EB, I wonder if @Lowa might consider another thread in the General discussion area to solicit some imput from other users.

i also would be interested in hearing from others. 

I can see Arduino being used in Town for elevators, moving vehicles around and lighting controllers.

We know that Arduino is popular with LEGO trains, yet we did not hear from any of them here.

If @Lowa can only find 4 people on EB interested in your device, well, the prognosis does not look good, and I want 1 or 2 of these devices.

Good luck,

Any D

There are indeed quite a few members of the train community working with Arduino.  I'm not sure what would be the best place to re-post: train or general discussion.  I don't want to start posting it everywhere because then it becomes spamming...

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.