Im building an RC car but the motors doesnt work properly, if I send the forward option, the motor keeps running and thats not what I want. also, my bluetooth module sometimes fell out or stop working whenever I try to control the DC motor. (I use one motor instead of 2)
The components I use are:
Bluetooth HC-06 module
Microservo 9g SG90
L298N
Arduino Uno
1 Yellow DC gearboxmotor
9V battery
Can someone help me to get this thing worked?
If you can answer dutch, please do, that would be easier for me!
the motor is a DC gearbox motor with ratio 1:48
Input between 3 and 6 v
Max current: <200mA (6v) <150 (3v)
RPM: 200 (+/- 10% 6V) 90 (+/-10% 3V)
torque: 0.8kgcm (3v), 1.1kgcm (6v)
If it is a PP3 battery then it is not suitable for your purpose as it cannot supply enough current for long enough to be useful. Consider using 6 AA batteries in series instead or rechargeable batteries if you have a charger
4 AAs is OK if you put a diode in series with the supply to reduce the voltage to nearer 5V when new and then feed the voltage to the 5V and GND pins to bypass the onboard voltage regulator.
This can even be a better solution as it avoids waste of power by the voltage regulator. However, I note that in your Fritzing diagram the voltage input to the motor control board is labelled 6-12V, but I don't know how significant this
What diode I need and how do I connect it? now the battery is connected to the +12V from the L298N driver, the - is connected to the servo, gnd from L298N and the ground on the arduino
If you have a 12V battery then you can use a DC Buck Converter to >90% efficiently change >5V (like 12V) to 5V. You get more current with a converter, a rectifier just dumps any excess power into heat.
Ok, so if I get this converter, what problem I have is solved?
And does it work with the 9v battery I already have?
So I have to connect the converter to all used gnd ports on the arduino and the 5v port? And also connect the vcc port from the converter to the servo, l298n, hc06? For the gnd the same?
And what do I have to do with this Vin pin? Not getting what that is for?
You might solve problems with motors not running, the Arduino behaving weird if a motor runs or stops, etc. Basically anything inexplicable to do with motors.
The 9V battery can go back into the smoke detector where it belongs. Get a 9V or 12V 'wall wart' adapter instead.
I think it's time for you to do some reading. Google 'powering Arduino projects' and read a few pages here and there. Build a basic understanding and then come back with further questions.
No just a tiny cheap DC-DC Buck Converter (search that on ebay or a local source).
It will have a max rating for output current. Get adjustable converter, screw sets output voltage. For a tiny board with 3A max output (so I use only 2/3 max at most) before the covid was less than $3.
The output of these is not perfect flat. Arduino doesn't need perfect flat, it has bypass caps to moderate what the chip does which is "noisy" on voltage compared to the tiny converter ripple.
so I have ordered this buck connector and connected it, my bluetooth module keeps disconnecting ffs.
if i put a powerbank on the arduino and use the 9v for the other components, it will work properly, but not with the powerbank replaced by the Buck converter.
how I connected it:
the in+ is on the + from the 9v battery, ( its together connected at the +12V of the driver L298N)
the in - is on the - from the 9v battery (its together connected at the gnd of the driver L298N)
the out + is on the Vin on the arduino
the out- is on the gnd on the arduino
The 12V of the car is placed across the 9V battery terminals and the converter?
Don't the voltages add?
Will the 9V battery get charged? -- doubt it myself
Doesn't make sense; should be at the 5V pin because you're feeding it 5V anyway. It's surprising the Arduino runs at all this way.
Are you still using an alkaline 9V battery? You really shouldn't.
Also, I'm confused. Do you have a 9V or a 12V power source? Or both? In case of both, you didn't connect them parallel to each other, did you? Do you have fire insurance?
If the 9V battery is the transistor radio kind, that must go. Your motors need more power. A 6V rechargeable pack or 12V input to the converter lets you power the Arduino yes, but feed the servo and motors unconverted battery power that the Arduino uses a FET (power transistor) and PWM to control the servo and a motor-driver board (the L289N, right? nice module) should be good.
If you havent made the car body yet, consider 2 wheels on front and 1 driving wheel behind like the Dymaxion or the BMW 3 wheeler. It'd be real cool to build a motor into the rear wheel hub.
Only run the Arduino with 5V converted power. It uses so little when you put resistors on outputs to limit current draw.
Consider to power it with supercapacitors? Cap banks that can start a truck show up on youtube.
The problem is, I have made the body myself, its custom made and fits with the motor I already have. the problem is the battery I think, Im still using this 9volt block, but want a small replacement for it with enough output.