MX1508 With Arduino and Single Motor
by Paramprakash in Circuits > Arduino
57 Views, 0 Favorites, 0 Comments
MX1508 With Arduino and Single Motor
There are not many tutorials about the mx1508 online (like almost none). They are very cheap to use and quite small too. The best thing about them is that they support voltages from as low as 2v which makes them perfect to use with 3.7v motors as well as their capability to supply 1.5A per motor (perfect for dc coreless motors!!).
So I wrote this instructable as an example for controlling a motor with mx1508 and potentiometer. Do give it a like if it helps you!!
Supplies
1) Arduino
2) MX1508 motor driver
3) Dc motor
4) Jumper wires
5) Arduino cable
6) Potentiometer
7)Breadboard
Thats it
Connections
1) Arduino pin A5 to potentiometer middle pin
2) 5v to Potentiometer 5v and mx1508 +ve [Note that the motor should not take too much current, recomendation is to use a separate battery pack for the motor to prevent burning out your arduino)
3)D9 to IN1
4)D10 to IN2
5) Motor A to Motor connection
MX1508 Library
Install the mx1508 library by Cheng Saetern
https://github.com/Saeterncj/MX1508
This library allows us to easily use the mx1508 with arduino and motors. It has very basic commands such as
1)cwDirection = true/false allows us to set the direction of the motor
2)motor(A/B).motorGo(pwmvalue) this sets the speed of the motor in accordance to the analog input
3)MX1508 motorA(PINA,PINB, FAST_DECAY, NUMPWM)
Code
Upload to Arduino
Upload the given code to Arduino.
Done!!!
Downloads
Afterthoughts
I am thinking about using this motor driver to modify a cheap rc car of mine and make it speed controlled using nrf24. If it works out, will upload an instructable for the same!!
Good Day!