I’m not gonna describe the actual process, but you can easily find it with google (Warning: it isn’t very easy if you don’t know electromagnetism theory). Tutorial: What we are going to learn today is how to work a simple DC motor with the Arduino, but first of all we need to understand what is a DC motor.Ī DC motor is a simple device that turns electromagnetic energy into mechanical energy. It doesn’t mean necessarily that it is gonna be different than the ones I found, though I’ll try very hard to make it understandable and useful. That’s why I decided to write this tutorial. A couple of good videos on YouTube, but they lack of good explanations and circuit schematics. After many hours of searching and investigating I found out numerous things, but mainly I found that there is not a coherent and fully abrasive article on assembling a simple DC motor (there probably is, I just didn’t find it). Something that bugged me for quite some time was how to correctly connect a small DC motor to the Arduino (since an expert friend of mine told me I couldn’t just directly wire it to the Arduino, something I came to understand). So far I’ve had a couple of problems, but I’ve always found a way out. There is technically no right or wrong way.Introduction: So as you probably know, I’ve recently taken the challenge of learning electronics and building a robot. You can swap out your motor’s connections. Note that both Arduino output pins 9 and 3 are PWM-enabled.įinally, wire one motor to terminal A (OUT1 and OUT2) and the other to terminal B (OUT3 and OUT4). Now connect the L298N module’s Input and Enable pins (ENA, IN1, IN2, IN3, IN4 and ENB) to the six Arduino digital output pins (9, 8, 7, 5, 4 and 3). We’ll use the on-board 5V regulator to draw 5V from the motor power supply, so keep the 5V-EN jumper in place. Next, we need to supply 5V to the logic circuitry of the L298N. Because L298N has a voltage drop of about 2V, the motors will receive 10V and spin at a slightly lower RPM. We will therefore connect an external 12V power source to the VS terminal. In our experiment, we are using DC gearbox motors, also called “TT” motors, which are often found in two-wheel-drive robots. Let’s begin by connecting the motor power supply. Now that we know everything about the module, we can start hooking it up to our Arduino! Wiring an L298N Motor Driver Module to an Arduino This is why the L298N based motor drivers require a big heatsink. This excess voltage drop results in significant power dissipation in the form of heat. The image below shows PWM technique with various duty cycles and average voltages. The shorter the duty cycle, the lower the average voltage applied to the DC motor, resulting in a decrease in motor speed. The higher the duty cycle, the higher the average voltage applied to the DC motor, resulting in an increase in motor speed. This average voltage is proportional to the width of the pulses, which is referred to as the Duty Cycle. PWM is a technique in which the average value of the input voltage is adjusted by sending a series of ON-OFF pulses. A widely used technique to accomplish this is Pulse Width Modulation (PWM). The speed of a DC motor can be controlled by changing its input voltage. H-Bridge – to control the spinning direction. This is possible by combining these two techniques. We can only have full control over a DC motor if we can control its speed and spinning direction. If you are planning on assembling your new robot, you will eventually want to learn how to control stepper motors.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |