Can the voltage on a mega or uno be adjusted at 5v or 3.3v pin?

My question is can you program a lower voltage to be produced from the 5v pin or 3.3v pin that is lower then what either pin supplies? I did google a few different things and didn't find anything that really related to my question.

https://www.arduino.cc/reference/en/language/functions/analog-io/analogreference/ Would analogReference work? INTERNAL4V3, and adjust the 4 and 3 to desired voltage?

Could it be supplied with a petentiometer to adjust desired voltage from min to max?

No, you can supply a little bit less on the 5V pin (assuming a 5V Arduino!) but beside that there is no control on those pins. They are just supply voltages.

No, you'd need extra circuitry, just curious but why would you want to do that?

can you program a lower voltage to be produced from the 5v pin or 3.3v pin that is lower then what either pin supplies?

What do you want to do with the lower voltage ?

Would a PWM output do whatever it is you want to do ?

More details please

Yes, PWM and a capacitor/resistor to change it from PWM to analog, but I don't think it produces much current 40ma? yeah I know its from indestructibles but https://www.instructables.com/id/Analog-Output-Convert-PWM-to-Voltage/

Would like to control voltage to a atomizer if possible, I do have many supplys avail capacitors resistors ic's many things for designing and building circuits for arduino(mega electronics kit from amazon)

Leveller: 40ma?

It's more like non at all ;)

Because once you load an RC filter it will mess with it. So fine for a high impedance input of something but the moment you try to really draw current from it you effectively just end up with a voltage divider.

Atomizer, that's the vapor heating thingy? If so, use PWM via a transistor.

yes, heating things requires higher current, would that be a transistor to switch a higher current?

You can draw 40mA from an Arduino pin but not continuously for long before the pin burns out.

Use the pin to switch a transistor on, the transistor must be able to conduct whatever current you need.

For small current (less than 500mA) you can get away using a BJT (bipolar junction transistor, the old type). The newer FETs (field effect transistor) are better especially with more current/

Leveller: Yes, PWM and a capacitor/resistor to change it from PWM to analog, but I don't think it produces much current 40ma? yeah I know its from indestructibles but https://www.instructables.com/id/Analog-Output-Convert-PWM-to-Voltage/

I dont know if those ma matter for this, would like to supply between 3v to 4.8v I guess so far. Checking out that link right now.

https://www.arduino.cc/reference/en/language/functions/analog-io/analogread/

Would that work, using a petentiometer to adjust voltage between 1 n 4.76?

I have a good selection of transistors, but according to the above link can just use a pent to adjust voltage. I have a LCD I can print what the voltage should be, So the pent gets wired to ground 5v and the pwm pin, while the pin a0-5 pins goes to what im applying voltage to correct?

And the other shoe drops.

No, pot's also can't supply real currents (at least most, you can get high power ones).

Start by measuring the current ;) And no need to check the Instructables of Leveller for this application ;)

A voltage divider with a pot as one leg... to adjust 5V or 3.3V to less V.

"thunk" goes the shoe

Voltage is not the issue, it's the current required, you need to find out how much it requires, before you start plugging stuff in.

edit: cause I can't post new

Measure the resistance of the atomiser and then use ohm's law to work out the current required at any voltage (i=v/r)

https://www.allaboutcircuits.com/tools/voltage-divider-calculator/

Outside pins of the pot go to ground and input voltage and middle should output the regulated volate according to that

Ok going to use a 5k pot, attach one end to ground and the other to 5v with the middle going to aref on a uno board I dont have being used currently. Should I connect the end of the pot to A0-A5 instead or keep it at the 5v pin so when analogreference external is enabled the pins at 0-5 drop to the adjusted voltage correct? while the 5v pin would stay constant?

What? What do you think to gain by feeding Vref some voltage and messing with analog*Read*()?

Sure as hell isn't going to help you drive a heater ;)

Ok 5v and ground go from uno to breadboard then from breadboard to each side of the pot. I had the AREF connected to the middle but no luck, tried A2 now on A3. If I measure with my meter at the right and center of the pot I cant adjust voltage from 0-5v but I dont know how to read the voltage read at the middle of the pot at A3.

int a = A1;
int c = A2;
float b = 0;

void setup()
{
  Serial.begin(9600);
}

void loop()
{
  analogReference(EXTERNAL);
  pinMode(c,INPUT);
  digitalWrite(c,HIGH);
  pinMode(a, INPUT);
  a = analogRead(c);
  Serial.println(a);
  b = map (c,0,1024,0,5);
  Serial.print("V= ");
  Serial.println(b);
  delay(1000);
}

I have ground on the side and 5V on side with the AREF in the middle of the pot and can go from 0-4.5V which is plenty, but what would be the best code to read this in the serial monitor?

But how is any of that helping is controlling a heater? ???

[quote author=septillion link=msg=4282512 date=1566396868]
But how is any of that helping is controlling a heater? ???
[/quote]

It always power to a atomizer fine but I need to figure out how to read the voltage from A0 right now which is tied to the same input as AREF through a breadboard
[code]

void setup()
{
  Serial.begin(9600);
  analogReference(EXTERNAL);
}

void loop()
{
  int sensorValue = analogRead(A0);
  float voltage= sensorValue * (5.0 / 1023.0);
  float b;
  Serial.println(voltage);
  b = map (b,0,1024,0,5);
  Serial.print("V= ");
  Serial.println(b);
  delay(1000);
}

Says A0 is putting out 5V which is untrue when its reading 3V after adjusting the pot by reading my meter