I am new to Arduino and am seeking some help to create a project for my design course. I'd like to make an RC car that is controlled via a Bluetooth module on an Arduino. I'd like to be able to control 4 drive motors to go forwards and backwards (preferably controlled in pairs), one stepper motor to move a certain angle on a button push, another stepper motor to move to preset angles but has the option to adjust + or - a few degrees, and finally one motor that is always spinning.
I have a 2BYJ-48 stepper motor and it's controller that came in an Arduino kit, and I'd like to use that set-up for the stepper motors.
I'm unsure if I need to get motor controllers for the two pairs of drive motors or the motor that is spinning all of the time. If I use 5-6V motors, can I control them directly from the Arduino?
Also, what sort of battery would be ideal for this, and does anyone have any recommendations for drive motors that could move a <30cmx30cm RC car?
I realize that maybe my team has chosen a difficult task to program, But I believe we can do it and am hoping that you all are willing to provide some insight as to how the best approach would be. Thank you!
"If I use 5-6V motors, can I control them directly from the Arduino?"
To save yourself some time and effort you might consider using continuous rotation servos for the wheel drive motors. Motors of any size need to have power supply independent of the arduino.
"Motors of any size need to have power supply independent of the arduino."
Okay, no problem, we'll just have a 9V for the Arduino and a separate battery for the motors then. With that being the case, won't we definitely need some kind of motor control module for the motors?
And also, why would a servo be a better choice than a regular DC motor that would typically be found in an RC car?
You didn't understand what he said, he didn't say that you will need 2 power sources for the arduino and the motors, he just said that you cant give power to the motors from the arduino pins, you will need a motor shield.
You just need to power the motor shield from the battery and give the required signal from the arduino, usually PWM.
You could use servo motors with PPM to precisely aim your "gun" instead of the stepper motor, there are actually servo driven aluminim "arms" for sale that can be used for the "turret".
For the battery you can choose to use a 4xAA battery pack (6.0V) or simply a rechargable Li-Po (3.7V, 7.4V, 11.1V, 14.8V).
2x LiPo will do great for both the motors and the Arduino, assuming your motors are rated for that voltage (7.2V nominal). Let the Arduino's regulator take care of producing the regulated 5V out of it.
Alternative, especially for a smaller robot: find motors that are designed for a single LiPo battery (nominal 3.7V), and run a 8 MHz/3.3V Pro Mini off of that voltage directly (no need to go through the regulator, straight to the Vcc pin).
If you prefer to go for higher battery voltage (like 3x LiPo), get a buck converter to produce 5V out of the battery voltage, and connect that to the Arduino's 5V pin.
4xAA is a horrible voltage: too low for the Vin pin, too high for the 5V pin. It may work with a 3.3V Pro Mini, using its Vin pin, as 6V is enough for a 3.3V regulator without too high risk of overheating. Non-rechargable AA batteries are expensive when used with motors compared to LiPo, as you need so many of them.
"And also, why would a servo be a better choice than a regular DC motor that would typically be found in an RC car?"
The continuous rotation servos are easy and inexpensive to implement as simple drive motors. That brings up the idea why don't you just get a large RC car/truck and modify it for use as your mobile platform?
zoomkat:
That brings up the idea why don't you just get a large RC car/truck and modify it for use as your mobile platform?
A requirement of the project is that we build it ourselves instead of modifying/parting out an already built RC car.
I'm not sure if I want to use a servo motor for the drive, I still don't understand the advantage. Maybe I should describe the goal a little more.
We have to overcome 4 obstacles: A tunnel (so it has to be within a certain size), a rough terrain area with bumps made from PVC slices (max radius is 6cm), a bridge essentially, and a see-saw type thing. There are those obstacles, and we have to hit 5 targets with balls.
The two stepper motors will be moving the aiming system up and down, and rotating the ball-storage mechanism. The continuous motor will be what fires the ball, similar to those baseball launching things. Is the consensus that servo motors will be easier than stepper motors? Why?
Because of the rough terrain and the see-saw, we're thinking that reasonable torque will be necessary. With this in mind, I'm not sure if cheaper servos will be ideal. Looking around online, I'm thinking of getting something like this for the motors, and one or two L298N's for them (I think I could just use one, and run two motors off of each motor out on the L298N). With the L298N, I could also power the Arduino.
A typical servo has a limited motion (typically 180°) which will be enough for your targeting needs. A servo has absolute positioning, you just tell it to go toa point and it will figure it out for you. A stepper needs a home switch of sorts so you can figure out where it is. It's also far less power efficient, you must keep it powered on at all times or you lose position.
For the drive, a continuous rotation servo is basically a motor with speed control. It is controlled through the servo library of the Arduino, and will rotate at the speed you set it to.
In contrast with a DC motor you can control the speed of by PWM, but what you really control is the power to the motor, and the speed follows from that. So to set it to an actual speed you need speed feed-back, such as using an encoder to read back how fast the motor runs, and adjust the power accordingly.
In both cases the servo options are the easier to control, just mind that while the control is the same, the two are very different types.
Leave the L298 in the museum, if you do need an H-bridge controller (you don't if you go the servo/ESC route) get something modern like the TB6621FNG controller (and there are many other MOSFET based options).
But before you even go there: first decide on what motor type are you going to use, and how you are going to power them. Then based on the voltage of your power source you can decide on how to power the Arduino.
A picture from back in the day of a "routerbot" before the wifi boards were available. Large plastic jar lids are hot glued to the control horns on the continuous rotation servos to be the drive wheels.
derpm:
I'm not sure if I want to use a servo motor for the drive, I still don't understand the advantage.
To make it clear - a continuous servo is not really a servo any more. It is a geared motor with it's own built-in driver circuit. That's the advantage, no external driver needed.
slipstick:
To make it clear - a continuous servo is not really a servo any more. It is a geared motor with it's own built-in driver circuit.
Oh that is certainly an advantage. The car will be moderately heavy, are continuous servos able to produce a decent amount of torque and move a heavy RC car?
"Oh that is certainly an advantage. The car will be moderately heavy, are continuous servos able to produce a decent amount of torque and move a heavy RC car?"
That depends on something only you know, aka, the weight of the car. You really need to set the bounds of your project before you can design a drive system for it. If it is fairly heavy and you can't modify existing platforms for it, then you may be getting into some design areas that take time and $$$.
slipstick:
How heavy is moderately heavy? If you mean 1000Kg, then no. Less than 1Kg, sure.
For questions like that you really need numbers not waffle.
Steve
Doing some napkin calculations as I don't know exactly what motors, and it's not built yet, I think a reasonable estimate is between 3kg and 6kg. The piece of steel that will act as a frame is 2kg, and the canister to hold the balls is probably .5-1kg. So in addition to those would be the mass of the motors, wheels, Arduino/Bluetooth module/possible motor module, and battery.
So I'm thinking between 3kg and 6kg. Let's assume that is a reasonable estimate. With that in mind, would servo motors still be a reasonable choice for the car? As mentioned earlier, I will need to traverse a rough terrain area that has mounds made with PVC (max radius 6cm), and need to climb a few 30deg ramps.
Based on the 30 degree incline, a maximum weight of 6 kg, and the size of your wheels you can calculate the bare minimum torque needed just to move that thing.
Use that number to have a look at motor options.
Then you have an idea on how much current you need (the motors will use 90% or more of your battery's energy), and that plus required time it operates gives you an idea of how big a battery you need.
Use that number to have a look at batteries.
The battery is one of the heaviest components of your car, so now you know what the actual weight of the battery is going to be, and you can do a better calculation of the weight of your car.
It might be productive to look at similar projects and see how they were built. The below ball shooting robot seems to be some what advanced and gets the job done. Schools often have robotic competitions involving ball shooting robots, so many have been previously built.
Thank you all for the helpful advice and recommendations. I've learned quite a bit, I think my team and I will be able to move forward a little more efficiently now. I'll post back when we're further along to update!