controling Arduino output voltage using a power supply

Thread Starter

Kadav

Joined May 11, 2018
158
Hello i am new to programing and especially Arduino i am looking for some help

I am currently working on a project where i need to drive an outuput voltage of 12v to a heater, but i want to use a power supply .. that i can manually change the values of the output

I also have in my mind an idea of using a rotary encoder or a potentiometer to change the output voltage in order to to change the heating but most importantly want to use a power supply to see how it works.

Do you have an idea of which power supply i can use?

And please can you tell me if my point of using a rotary encoder or potentiometer is a good one ?

Thanks..
 

dl324

Joined Mar 30, 2015
16,788
And please can you tell me if my point of using a rotary encoder or potentiometer is a good one ?
The devil is in the details. It depends on how your're going to use them.

You'll probably achieve better results using PWM to drive the heater. Arduino has outputs that support PWM and you can use a pot to control pulse width.

Arduino is setup for novices. There's a library for just about everything, but you'll learn more if you roll your own. I've only been using Arduino for about a year and that's my preference. But I have decades of experience designing circuits and programming.
 

Thread Starter

Kadav

Joined May 11, 2018
158
Yeaah

Can you please tell me which power supply ,,normaly could be used to do that . i am having trouble finding the power supply on internet
 

djsfantasi

Joined Apr 11, 2010
9,155
Yeah but how do i regulate the voltage , if i want to change the heat for example
You connect the heater to the Arduino with a n channel logic level MOSFET, connected to ground and the heater. Then, you drive the pin connected to the MOSFET Gate with PWM. If the supply is 12V and the PWM signal is 50%, the heater gets 6V.

You’d connect the pot to 5V, ground and an analog pin. Then, analogRead() gets the pot value. You’d map() that value to a PWM value, and output that to the PWM pin.
 

Thread Starter

Kadav

Joined May 11, 2018
158
You connect the heater to the Arduino with a n channel logic level MOSFET, connected to ground and the heater. Then, you drive the pin connected to the MOSFET Gate with PWM. If the supply is 12V and the PWM signal is 50%, the heater gets 6V.

You’d connect the pot to 5V, ground and an analog pin. Then, analogRead() gets the pot value. You’d map() that value to a PWM value, and output that to the PWM pin.
I thaught if i use A MOSFET i won't need a power supply because , that would be its job. to magnify the 5v from the arduino
 

Thread Starter

Kadav

Joined May 11, 2018
158
PWM. Reread my first post.
OK in any case i will have to use a POT. i thaught that there are power supplies that are regulated manually , without using a potentiometer.

but if so . in this case is it not prefferable to use a MOSFET rather than a power supply ? or even when we use a MOSFET we have to use a power supply ?

David
Best regards !!
 

dl324

Joined Mar 30, 2015
16,788
I thaught if i use A MOSFET i won't need a power supply because , that would be its job. to magnify the 5v from the arduino
A MOSFET by itself can't step up the voltage of the 5V Arduino supply. Besides, varying the voltage for the heater might not work.

If you have a 12V heater that requires 3A, that works out to 36 watts. If you want to run it at half power, you probably won't be able to operate it from 6V. But you could drive it with a PWM signal at 50% duty cycle from a 12V power source. That will result in a 50% reduction in power to the heater.
 

djsfantasi

Joined Apr 11, 2010
9,155
I thaught if i use A MOSFET i won't need a power supply because , that would be its job. to magnify the 5v from the arduino
No, a MOSFET cannot “magnify” 5V. If the heater needs 12V, you’ll need a 12V power supply. Most Arduino’s can take 12V at Vin, but they run at a much lower voltage.

The choice is not a MOSFET or a power supply. A MOSFET can be used as a switch to the power supply.
 

Thread Starter

Kadav

Joined May 11, 2018
158
No, a MOSFET cannot “magnify” 5V. If the heater needs 12V, you’ll need a 12V power supply. Most Arduino’s can take 12V at Vin, but they run at a much lower voltage.

The choice is not a MOSFET or a power supply. A MOSFET can be used as a switch to the power supply.
OOOh ok i got that so why do they say that a MOSFET VGS is 20 ,VDS 100 , i thaught that it means if it has a 5v at Vgs it can drive a 100 V load
 

dl324

Joined Mar 30, 2015
16,788
OOOh ok i got that so why do they say that a MOSFET VGS is 20 ,VDS 100 , i thaught that it means if it has a 5v at Vgs it can drive a 100 V load
Those specs are probably absolute maximum ratings. The device can tolerate \(V_{GS}=+/-20V and V_{DS}=100 \). But they can't generate voltage from nothing. People have tried things like that, but they're generally labeld as quacks.
 

Thread Starter

Kadav

Joined May 11, 2018
158
Those specs are probably absolute maximum ratings. The device can tolerate \(V_{GS}=+/-20V and V_{DS}=100 \). But they can't generate voltage from nothing. People have tried things like that, but they're generally labeld as quacks.
Those specs are probably absolute maximum ratings. The device can tolerate \(V_{GS}=+/-20V and V_{DS}=100 \). But they can't generate voltage from nothing. People have tried things like that, but they're generally labeld as quacks.
yeah

Its strange because i managed to drive a 9v motor from a combination of BJT and MOSFET , by making the output power of a BJT collector, the input power of a base at the MOSFET, but from a video i had seen online..
can you explain me that phenomenon ?
 

dl324

Joined Mar 30, 2015
16,788
Its strange because i managed to drive a 9v motor from a combination of BJT and MOSFET , by making the output power of a BJT collector, the input power of a base at the MOSFET, but from a video i had seen online..
can you explain me that phenomenon ?
Maybe if you provide a schematic for the circuit you're describing.

Regarding YouTube videos. There are a lot of idiots there masquerading as so called experts. Most of the people here have years of formal education in the discipline and decades of experience.
 

Thread Starter

Kadav

Joined May 11, 2018
158
Maybe if you provide a schematic for the circuit you're describing.

Regarding YouTube videos. There are a lot of idiots there masquerading as so called experts. Most of the people here have years of formal education in the discipline and decades of experience.
Hello thank you for the information ..

can i ask what is the difference between a voltage amplifi
Maybe if you provide a schematic for the circuit you're describing.

Regarding YouTube videos. There are a lot of idiots there masquerading as so called experts. Most of the people here have years of formal education in the discipline and decades of experience.

Hello i am still confortable asking you some questions that i have , why is it that when i say that i want to buy for a example a power supply , you ask about , how much current does it need ...
 

dl324

Joined Mar 30, 2015
16,788
why is it that when i say that i want to buy for a example a power supply , you ask about , how much current does it need ...
Because the current capacity of a power supply is just as important as it's input and output voltages.

If you have a 12V heater that requires 3A, buying one that can supply 1A would be inappropriate (assuming the heater manufacturer gave an accurate power requirement). Buying a power supply that is rated for significantly more than what you need (say 30A) is unnecessary and will cost and, likely weigh, more; unless you plan to use it to power other 12V devices at the same time, or you have other applications in mind.

Without sufficient information, you can't make a "good" decision.
 

Thread Starter

Kadav

Joined May 11, 2018
158
Because the current capacity of a power supply is just as important as it's input and output voltages.

If you have a 12V heater that requires 3A, buying one that can supply 1A would be inappropriate (assuming the heater manufacturer gave an accurate power requirement). Buying a power supply that is rated for significantly more than what you need (say 30A) is unnecessary and will cost and, likely weigh, more; unless you plan to use it to power other 12V devices at the same time, or you have other applications in mind.

Without sufficient information, you can't make a "good" decision.
OK thank you very Much

Can you please tell me how i can control the voltage from the power source in order to reduce the heat from the heater ... I seem to not understand how to do it .

I understand that from this code below , that i have already made the pin to work on 50% to produce a heater of 6v if the input is 12v but i don't understand how and where i should apply the potentiometer , to PWM the signal from the power source

Code:
const int analogpin=3;
int motorPin=map(analogRead(A0),0,1023,0,255);
Serial.println(motorPin);
analoglWrite(analogpin,128);
 
Last edited:
Top