Go Down

Topic: Can the voltage on a mega or uno be adjusted at 5v or 3.3v pin? (Read 336 times) previous topic - next topic

GoForSmoke

the amps arnt high enough for what id need, would need a external power supply n was hoping might power a vape atomizer.
Do you know the term 'thermal mass'? It has thermal inertia, anything that you would heat up has this.

So you can use PWM to deliver ~500 pulses every second. The length of the pulses makes a smooth average as the pulse is a tiny push against the thermal mass inertia. Uno has ~1000/sec PWM on, IIRC 2 pins.

Even at full power, how much heat gets delivered in one or two milliseconds? A 50% pulse looks the same as half of 100% (no pulse, just ON the whole time). Thermal inertia will smooth the heating out, a physical mass filter.

You read the pot with an analog pin to get the pulse percent to use. A tiny trim pot could be used since it won't be carrying a current load to speak of.
1) http://gammon.com.au/blink  <-- tasking Arduino 1-2-3
2) http://gammon.com.au/serial <-- techniques howto
3) http://gammon.com.au/interrupts
Your sketch can sense ongoing process events in time.
Your sketch can make events to control it over time.

johnwasser


Code: [Select]
 analogReference(EXTERNAL);
  int sensorValue = analogRead(0);
  float voltage= sensorValue * (5.0 / 1023.0);
Unless the Aref (EXTERNAL reference) pin is 5.0V your 'voltage' calculation is wrong.  Replace the '5.0' value with the actual analog reference voltage.
Send Bitcoin tips to: 1G2qoGwMRXx8az71DVP1E81jShxtbSh5Hp

septillion

And now that you are there anyway, change the 1023 to the correct 1024 :)
Use fricking code tags!!!!
I want x => I would like x, I need help => I would like help, Need fast => Go and pay someone to do the job...

NEW Library to make fading leds a piece of cake
https://github.com/septillion-git/FadeLed

GoForSmoke

You do know that the difference between /1023 and /1024 is less than the accuracy of the ADC, by about half?

I get my chuckles when the difference argued over isn't really there.
1) http://gammon.com.au/blink  <-- tasking Arduino 1-2-3
2) http://gammon.com.au/serial <-- techniques howto
3) http://gammon.com.au/interrupts
Your sketch can sense ongoing process events in time.
Your sketch can make events to control it over time.

septillion

Yeah, but why introduce extra error? And extra calculations. Division by 1024 is a lot easier to handle :)
Use fricking code tags!!!!
I want x => I would like x, I need help => I would like help, Need fast => Go and pay someone to do the job...

NEW Library to make fading leds a piece of cake
https://github.com/septillion-git/FadeLed

GoForSmoke

There was a long thread about this a few years ago.

Yeah, there are times when /1023 makes more sense to reasonable un-fixated people.
1) http://gammon.com.au/blink  <-- tasking Arduino 1-2-3
2) http://gammon.com.au/serial <-- techniques howto
3) http://gammon.com.au/interrupts
Your sketch can sense ongoing process events in time.
Your sketch can make events to control it over time.

Go Up