How to control this motor using arduino??

LesJones

Joined Jan 8, 2017
2,687
The motor itself will probably only have two wires going to it. You will need to trace out the schematic of the circuit board (Or get the FULL specification of the motor unit from the manufacturer.) to understand what the function of the circuit board is. It may be to provide a limit switch function or it may be to provide a number of pulses for each revolution of the motor.
A picture of the component side of the board may help us to guess what function it performs.

Les.
 

djsfantasi

Joined Apr 11, 2010
6,692
The cylindrical protrusion on the unit is the motor. The rest of the box contains gears for converting the motor’s rpms to a slower rate.

I’ve had several similar units.

The circuit board is likely drive circuitry. As LesJones stated, there are likely just two wires to the motor housing. Black likely is ground; red is power. With these two wires and the Arduino, you should be able to control the motor with a BJT or MOSFET switched by an GPIO pin.
 

Thread Starter

R0hit

Joined Aug 13, 2020
4
The motor itself will probably only have two wires going to it. You will need to trace out the schematic of the circuit board (Or get the FULL specification of the motor unit from the manufacturer.) to understand what the function of the circuit board is. It may be to provide a limit switch function or it may be to provide a number of pulses for each revolution of the motor.
A picture of the component side of the board may help us to guess what function it performs.

Les.
The small pcb does contain a micro switch. And when i asked the manufacturer they send me the following picture. As i am new to the projects. I dont have much experience on the motors and arduino.
Thanks
 

Attachments

Thread Starter

R0hit

Joined Aug 13, 2020
4
The cylindrical protrusion on the unit is the motor. The rest of the box contains gears for converting the motor’s rpms to a slower rate.

I’ve had several similar units.

The circuit board is likely drive circuitry. As LesJones stated, there are likely just two wires to the motor housing. Black likely is ground; red is power. With these two wires and the Arduino, you should be able to control the motor with a BJT or MOSFET switched by an GPIO pin.
I tried directly powering the motor. It only operates when i press the switch on the microswitch on the pcb. Is it possible to switch on the micro switch automatically??

Thanks
 

djsfantasi

Joined Apr 11, 2010
6,692
Where did you power the motor directly? At the red and black wires on the motor? Try disconnecting one wire from the PCB before powering the motor directly.
 

LesJones

Joined Jan 8, 2017
2,687
These comments are based on the schematic you posted in post #4 being correct. With the PCB connected to the motor it can only rotate in one direction (Even with a direct connection to the motor.) as there is a diode connected in parallel with the motor. (With power applied to the motor in the opposite polarity to that show on the schematic the diode would short out the power supply.) The micro switch will have NO DIRECT control over the motor, it only supplies a signal that probably causes the control circuit to stop the motor when the micro switch is operated by a cam. With your comment in post #5 that the motor only operates when you press the micro switch I think the schematic is wrong. Trace out the schematic of the PCB yourself (Or post a picture of the component side of the PCB.) to confirm if the schematic is correct. EXACTLY how do you want the motor to behave ? Are you using the signal from the micro switch ? Can you post a picture of the vending machine mechanics and your electrical schematic of the vending machine so we can see what you are trying to achieve ? A flow chart of your control program would also be helpful.


Les.
 

Thread Starter

R0hit

Joined Aug 13, 2020
4
These comments are based on the schematic you posted in post #4 being correct. With the PCB connected to the motor it can only rotate in one direction (Even with a direct connection to the motor.) as there is a diode connected in parallel with the motor. (With power applied to the motor in the opposite polarity to that show on the schematic the diode would short out the power supply.) The micro switch will have NO DIRECT control over the motor, it only supplies a signal that probably causes the control circuit to stop the motor when the micro switch is operated by a cam. With your comment in post #5 that the motor only operates when you press the micro switch I think the schematic is wrong. Trace out the schematic of the PCB yourself (Or post a picture of the component side of the PCB.) to confirm if the schematic is correct. EXACTLY how do you want the motor to behave ? Are you using the signal from the micro switch ? Can you post a picture of the vending machine mechanics and your electrical schematic of the vending machine so we can see what you are trying to achieve ? A flow chart of your control program would also be helpful.


Les.
The circuit works now. I tried giving 5V to the control pin and the motor works. It seems that I was using the digital IO pins for testing which doesnt supply 5V or rather even 3.3V so that the switch didnt activate. I tried giving 5V directly from the 5V output pin of arduino. The circuit worked but since a lot of current was taken from arduino which was connected to my laptop via USB, my laptop disconnected the USB saying that there was a power surge. Then I tried giving power to arduino directly from AC main using a 5V adapter and it worked perfectly. Now, I will use a transistor to supply 5V to the control pin of the above mentioned circuit and control the transistor using arduino.
Thanks for your help.
 
Top