# L298N and arduino powered from same source

#### SeanV123

Joined Nov 12, 2020
105
Hello,

I am currently working on a project where I need to supply 10-12V to a L298N motor driver (https://wiki.dfrobot.com/MD1.3_2A_Dual_Motor_Controller_SKU_DRI0002) and around 7.5V to an arduino. My goal is to power both the arduino and the l298n from the same source. So I tried to use a voltage divider in to drop the voltage from 12v to 7.5V for the arduino while 12v was connected to the l298n in parallel. However when I powered it, there was only 2V being supplied to the arduino while the l298n got its full load intended. Does anyone know why this is? Is there something fundamental I’m missing? I’m an electronic hobbyist and I’ve a good understanding of circuits and circuit design so I don’t know where I’m going wrong.
Thanks

#### dl324

Joined Mar 30, 2015
16,732
Does anyone know why this is? Is there something fundamental I’m missing?
A voltage divider for that situation is almost always the wrong thing to do. You don't mention the resistances in the divider, but it probably wasn't stiff enough.

If you can't see reducing the voltage with a voltage regulator, you could use a zener diode. Might need to be a power device depending on how much current the Arduino will want.

Joined Jul 18, 2013
28,534
I would suggest a better way of reducing the voltage, LM317 or 7805 etc.

#### SeanV123

Joined Nov 12, 2020
105
A voltage divider for that situation is almost always the wrong thing to do. You don't mention the resistances in the divider, but it probably wasn't stiff enough.

If you can't see reducing the voltage with a voltage regulator, you could use a zener diode. Might need to be a power device depending on how much current the Arduino will want.
Resistances were r1 = 10k and r2 = 15k

#### SeanV123

Joined Nov 12, 2020
105
I would suggest a better way of reducing the voltage, LM317 or 7805 etc.
Thanks very much mr head room

Joined Jul 18, 2013
28,534
I don't use Arduino, but don't they have a built in regulator?

#### SeanV123

Joined Nov 12, 2020
105
I don't use Arduino, but don't they have a built in regulator?
Yes they’ve a 5V built regulator mr head room

#### dl324

Joined Mar 30, 2015
16,732
Resistances were r1 = 10k and r2 = 15k
Definitely not stiff enough. The current in the voltage divider should be at least 10 times the load current. When you do the calculations, you'll see why that's the wrong way to go.

Since you don't need a regulated voltage for the Arduino, you could use a zener diode.

Joined Jul 18, 2013
28,534
So apparently the Arduino will take 6 to 20 volts so why the need?

#### SeanV123

Joined Nov 12, 2020
105
Definitely not stiff enough. The current in the voltage divider should be at least 10 times the load current. When you do the calculations, you'll see why that's the wrong way to go.

Since you don't need a regulated voltage for the Arduino, you could use a zener diode.
What do you mean by “not stiff enough” ?

#### SeanV123

Joined Nov 12, 2020
105
What do you mean by “not stiff enough” ?
And by using a zener, I would connect it the ‘wrong’ way to control the voltage?

Joined Jul 18, 2013
28,534
So why do you have the need for regulation, if the Arduino already has it?

#### SeanV123

Joined Nov 12, 2020
105
So why do you have the need for regulation, if the Arduino already has it?
Because I also need to power to logic input of the l298n which has a limit

#### BobTPH

Joined Jun 5, 2013
8,688
Because I also need to power to logic input of the l298n which has a limit
So take that from the 5V regulated rail on the Arduino board.

#### SeanV123

Joined Nov 12, 2020
105
So take that from the 5V regulated rail on the Arduino board.
I could, I’ll need to re do the circuit. Will update everyone how it goes!

#### dl324

Joined Mar 30, 2015
16,732
What do you mean by “not stiff enough” ?
The 10k resistor dropped 10V. It only takes 1mA to do that...

If you had made the resistors 100 times smaller, the voltage drop would have been more like 100mV.

#### djsfantasi

Joined Apr 11, 2010
9,154
I don't use Arduino, but don't they have a built in regulator?
Yes, they do. You can power an Arduino with either 5V regulated through the 5V pin or anywhere from 7V to 20V through the Vin pin. In the latter case, the onboard voltage regulator will convert the voltage appearing in the Vin pin to 5V needed by the Arduino.

With a couple of caveats. If the motors are noisy, a separate voltage source is needed. This can be as simple as a 7809 (with necessary filter capacitors) to feed in 9V. Or as complex as a completely separate power source with both grounds tied together.

Also note this is true for most Arduino models. Some have a different input voltage range. Check the specific product’s specifications.

#### dl324

Joined Mar 30, 2015
16,732
And by using a zener, I would connect it the ‘wrong’ way to control the voltage?
Yes. Put a 5V zener in series with the 12V source. It will drop about 5V, depending on the current. A half watt zener would tolerate 70-80mA. If you need higher current, you can use a power zener or add a power transistor to convert a lower wattage zener into a power device.

Use a 4.7V zener if you want something closer to 7.2V.

Last edited:

#### SeanV123

Joined Nov 12, 2020
105
So take that from the 5V regulated rail on the Arduino board.
I’ve read somewhere that you’re not supposed to do that. Not sure why

#### djsfantasi

Joined Apr 11, 2010
9,154
I’ve read somewhere that you’re not supposed to do that. Not sure why
I’ve done it many times. There is a limit to how much current you can draw, however. Check the specs because I’m not sure how much the limit is. I seem to remember that it’s less than 200mA. The logic for your IC should be well within the limit as long as your not using the Arduino’s 5V to run the motor!