Core Electronics Forum

Testing 12V Brushless DC Encoder Motor

I’ve bought the 12V Brushless DC Encoder Motor for a design project. Before wiring up the motor to my circuit, I’ve decided to try and test the operation of the motor. To do so, I’ve followed the steps given in the documentation and resources supplied by dfrobot and uploaded the code to the Arduino. The first time testing the operation, it worked for about for a duration of time. I decided to disconnect every and try to connect everything back up to double check its operation. Second time round nothing happened. Repeated the steps made sure everything is connected properly and still no operation of the motor. Any suggestions what the problem may be?

Cheers

2 Likes

Hey Steven,

Sorry to hear it’s giving you trouble!

Could you send through a photo of how you’ve got things wired up? (or a diagram if it’s a bit messy)

Keen to get to the bottom of this!

-James

Hey Steven,

Thanks for posting on the forum! :partying_face:

Was this the motor that you were talking about?

If so, are you running the script from here and hooked the motor up accordingly?

https://wiki.dfrobot.com/FIT0441_Brushless_DC_Motor_with_Encoder_12V_159RPM

As James suggested, can you please send through a photo of the way that you’ve connected it to your Arduino? It’s surprising how useful it can be sometimes to be able to take a look at the rig directly to see whether there are any potential issues there.

1 Like

Hi James,

I can’t supply a photo right at this moment but this is the diagram I followed when trying to test the motor.

I used a breadboard and screw terminals to connect the wiring for the encoder motor and used one side of power rails for my 12V power supply and the side of the power rails to connect ground and 5v for the Arduino

2 Likes

Hi Bryce,

Is it possible to buy those 5 wires at any local electronic shop? I feel like the wires need to be thicker as factory one are quite thin.

Cheers

1 Like

Hi Steven,

Those included on the motor should be suitable for the maximum current draw from it. Have you found that they’re getting hot through operation?

But yes, you could rig it up with some thicker wires if you’d prefer (personally I’d try and go solid core rather than stranded if you’re worried about current limits)

Hi Bryce,

I haven’t really observed any heat coming from the wires but I have used a multimeter to check voltages throughout the circuit and everything seems to have voltage.

Do they have a specific name for those wires ?

1 Like

Hey Steven,

Sorry about the delay in getting back to you, haven’t been in too much myself recently. Is there any way that you’re able to get that photo of the setup added here? Just making sure that there’s no confusion about the wiring and connections that I’m discussing with you as we go.

1 Like

Hi Steven
Have you connected Arduino Gnd to supply negative?
warning_yellow.png NOTE : Remember to connect Arduino GND to the POWER-
Cheers Bob

2 Likes

Good catch Bob, @Steven177053 if you don’t connect that correctly then you may run into issues with the logic voltage from the high pins not triggering board on the motor correctly.

Also, have you used your Arduino for anything else since it stopped running your motor. If the voltage of the rig or current spiked if it wasn’t hooked up correctly it may have fried it.

2 Likes

Thanks for getting back to me.

All the wire colours are the same besides 1: PWM it’s the green wire.
Arduino 5V and GND are connected to the right power rails
Power Supply and DC motor are connected on the left side power rails

2 Likes

Also, when I upload the code onto the Arduino, theres a step instructing to open serial monitor and enter a number between 0 - 255 to set the motors speed, but when I open the serial monitor and type in a number there are all these different characters and symbols that are written onto the serial monitor

2 Likes

Hi Steven
The power rails don’t seem to be connected together. I am assuming the device out of the pic bottom left is the power source. You have pos going to the LOWER pos rail and the neg going to the UPPER neg rail. On the proto board these 2 pos and neg rails are NOT connected (mine aren’t anyway). Put another couple of jumpers in to connect these (pos to pos, neg to neg) and try again.
Cheers Bob

2 Likes

Hi Steven,

You’ve likely got the wrong baud rate set on your terminal, in your sketch, there’s a Serial.begin(115200), as opposed to the usual 9600, and this is probably causing the garbled text you’re seeing.

I’ll have a closer look at your wiring in a bit, keen to get to the bottom of this!
-James

EDIT: Here’s where you change the baud rate:

1 Like

Hi Steven,

I think @Robert93820 has spotted the likely error. The rows between the red and blue stripe on your breadboard are connected lengthways across the board but the rows at opposite ends of the board are not connected to each other. We have a quick rundown on connecting breadboards here.

image

@James suggestion of the baud rate might be a separate issue that could also be causing problems.

3 Likes

@James thanks for your response, I’ll give that a go.

@Trent So those arrows that indicate ‘not connected’ are they supposed to be connected side by side?

If anyone has used this motor, do you have to use all 5 wires to operate the motor? For my project I only need pos, neg, and the PWM. I’ve created a simulation on Proteus and using 3 wires is viable.

Thanks in advance

2 Likes

Look at the board.
There are 4 long rows of contacts in groups of 5 going down the long side of the board, 2 marked with a red line and 2 marked with a blue line. With a jumper connect the 2 red rows together and with another jumper connect the blue rows together. They are not connected internally.
The other option is to just use one pair of these rows for all of these connections.
Cheers Bob

3 Likes

Hi All, problem solved. Thanks for all your feedback and suggestions. Much appreciated.

Issue was grounding. Didn’t ground the left power rail to the other power rail

Time to rig it up to my actual project design. Will be back if I have any issues.

Thank you

Steven

4 Likes

Hi Steven,

Great to hear! Thanks for reporting back with results, it’s always good to know when a problem is solved. Good luck with the rest of the build.

3 Likes

Hi All,

Having a bit of trouble wrapping my head around some concepts. So briefly summarising my project, I’m controlling the rotation speed of the DC motor by means of using a potentiometer. I’m using a PWM signal and a MOSFET as the configuration to regulate the voltage of the motor which controls the rotation speed.

PWM is connected to A0 of the Arduino (Analog Input)
Pin 11 is programmed as an PWM output signal that is connected to the gate of the MOSFET
Drain of the MOSFET is connected to negative terminal of the DC motor

I need some help with theory. Correct me if I’m wrong. If you increase the value of the potentiometer this will increase the voltage applied at the gate of the MOSFET therefore increases the output voltage of the DC motor which increases the speed…? If so what kind of load is imparted on the motor? Does increased rotation speed imply heavy load imparted on the motor?

Hope that makes a little bit of sense

Thanks

1 Like