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.
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.
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)
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.
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/
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.
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?
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?
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?
[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