The analog pins are only analog inputs but digital outputs (and inputs too). You use digitalWrite() to control a pin's HIGH or LOW state.

ànalogWrite() is for use with the PWM pins (I hate the name the chose for that function it's so wrong on so many levels).

Also this powering trick only works for things that need very small currents (< about 20mA) since that is the maximum an IO pin can deliver.


Incidentally, you can use analogWrite() on a non-PWM pin, but it's either fully on (analog value >= 127) or fully off (analog value < 127). The macros HIGH and LOW are 1 and 0 respectively, so that equates to "fully off" and "fully off" on a plain non-PWM pin.

Answer from Majenko on Stack Exchange
🌐
Arduino
arduino.cc › en › Tutorial › AnalogInputPins
Analog Input Pins | Arduino Documentation
The converter has 10-bit resolution, returning integers from 0 to 1023. While the main function of the analog pins for most Arduino users is to read analog sensors, the analog pins also have all the functionality of general purpose input/output (GPIO) pins (the same as digital pins 0–13).
🌐
Arduino Forum
forum.arduino.cc › projects › general guidance
Can I use analog pins(A0,A1, ...) as analog outputs??? - General Guidance - Arduino Forum
December 29, 2019 - I tried using "analogWrite(A0,100)" function on my Arduino Uno but it doesn't output anything.My question is: Can analog pins(A0,A1, ...) be used as the analog output pins? I know they can be used as digital outputs, but…
Discussions

How do analog Pins? How do they measure input and what characteristics do they have?
I can't visualise your circuit from this description, but if there's no current, there's no voltage drop. Chat GPT is trash btw. More on reddit.com
🌐 r/arduino
50
0
November 8, 2023
arduino uno - Using Analog Pins for Power - Arduino Stack Exchange
I'd like to power something needing 5V DC using the Arduino Uno analog pins. Specifically, I'm following the "Fun Plug-in Hack for Arduino UNO" section of this Adafruit tutorial. It states: "If you set analog pin A3 to an OUTPUT and HIGH and A2 to an OUTPUT and LOW you can power the RTC directly ... More on arduino.stackexchange.com
🌐 arduino.stackexchange.com
How do I use the Arduino analog pins as outputs? | UDOO Forum
Discussion in 'UDOO NEO' started by Crazy Guy, Jun 9, 2016 · Separate names with a comma More on udoo.org
🌐 udoo.org
Analog Output Problems with Analog Pins
Hi everyone, I have quite a beginner-level question. I want to control LEDs through an 'analogWrite(...)' function to dim them. I did this with the digital pins '3' and '11' through the PWM wave. This worked as inten… More on forum.arduino.cc
🌐 forum.arduino.cc
1
0
August 1, 2022
🌐
DeepBlue
deepbluembedded.com › home › blog › using arduino analog pins as digital output input pins
Using Arduino Analog Pins As Digital Output Input Pins
July 26, 2025 - ... Yes, you can use analog pins for LCD control. Just set the correct pinMode for each pin you need to use and use the pins (A0 to A5) as you’d do with any other Arduino digital pin.
🌐
Reddit
reddit.com › r/arduino › how do analog pins? how do they measure input and what characteristics do they have?
r/arduino on Reddit: How do analog Pins? How do they measure input and what characteristics do they have?
November 8, 2023 -

So i have been trying to make sense of the the electrical side of the whole arduino thing, but i am not quite getting it. Simple example: I connect the 5V Pin and two 1k Ohm resistors in series and then i put another cable into one of the analog pins. What i can measure is 5V. What i was expecting is atleast a slight drop in voltage, because i learned that over a resistor, the voltage drops. Then i asked ChatGPT and it told me that the analog pins have a very high resistance value. That would mean that almost no voltage would drop over the other two resistors. But if that is the case, i do not understand how ,when i set up a very simple voltage divider with the analog pin connected in the middle and the other end to the ground, the analog pin would not somehow influence the voltage value measured in this scenario. The voltage here splits exactly like expected so that i can measure 2,5V at the analog pin.
Maybe i just have a "knot" in my brain, but i am not able to make sense of it. Would love to hear an explanation from you guys. :)

🌐
Arduino
docs.arduino.cc › language-reference › en › functions › analog-io › analogWrite
analogWrite() | Arduino Documentation
analogWrite(), the pin will generate a steady rectangular wave of the specified duty cycle until the next call to
🌐
Meganano
meganano.uno › arduino-analog-input-and-output-pins
Arduino Analog Input and Output Pins – Meganano
February 24, 2020 - Arduino boards typically have both digital and analog pins. Digital pins can only read or output digital signals (0 or 1), while analog pins can read a range of analog voltages between 0V and the board’s reference voltage (usually 5V for most Arduinos).
🌐
Best Microcontroller Projects
best-microcontroller-projects.com › home › arduino coding › arduino analog output
Arduino Analog Output: Impossible Analog; using Digital Pins!
In the Arduino documentation it states that the PWM signal on pins 5 and 6 may not go fully off. This looks to have been corrected by extending the 1st bit output. You can see that waveform 0 is fully off and the 254 output (yellow) is correct. The following Arduino analog output example uses a PMW output (pin 5) with smoothing capacitor 220nF and resistor 20k to generate the Arduino analog output.
Find elsewhere
🌐
All About Circuits
allaboutcircuits.com › home › projects › how to use arduino’s analog and digital input/output (i/o)
How To Use Arduino’s Analog and Digital Input/Output (I/O) - Projects
June 25, 2021 - The Arduino can input and output analog signals as well as digital signals. An analog signal is one that can take on any number of values, unlike a digital signal which has only two values: HIGH and LOW.
🌐
Arduino
arduino.cc › en › Tutorial › AnalogInOutSerial
Analog In, Out Serial | Arduino Documentation
The newly mapped sensor data is then output to the · analogOutPin dimming or brightening the LED as the potentiometer is turned.
🌐
Quora
quora.com › Can-you-use-an-Arduino-analog-pin-as-an-output
Can you use an Arduino analog pin as an output? - Quora
Quora is a place to gain and share knowledge. It's a platform to ask questions and connect with people who contribute unique insights and quality answers.
🌐
UDOO
udoo.org › forum › threads › how-do-i-use-the-arduino-analog-pins-as-outputs.4403
How do I use the Arduino analog pins as outputs? | UDOO Forum
Is it possible to use the Analog pins on the Neo as outputs? For example I've tried addressing A2 as: A2 14+2 54+2 ie: pinMode( A2, OUTPUT );...
🌐
Arduino
docs.arduino.cc › language-reference › en › functions › analog-io › analogRead
analogRead() | Arduino Documentation
The function returns the analog reading on the pin. Although it is limited to the resolution of the analog to digital converter (0-1023 for 10 bits, 0-4095 for 12 bits, etc).
🌐
DigiKey
digikey.com › en › maker › tutorials › 2022 › generating-true-analog-outputs-when-using-arduino-boards
Generating True Analog Outputs When Using Arduino Boards
June 22, 2022 - Unfortunately, generating actual analog outputs with most Arduino boards is not as simple as calling the analogWrite function. While some development boards (such as the Arduino Nano 33 IoT) come with onboard digital-to-analog converter (DAC) capabilities, most popular Arduinos (such as the UNO) don’t have one. As a result, calling the analogWrite function on a pin that doesn’t have proper analog output capabilities will lead to the Arduino generating a pulse-width-modulated digital signal.
🌐
Arduino
docs.arduino.cc › micropython › basics › digital-analog-pins
Digital I/O | Arduino Documentation
To control digital outputs in MicroPython, we use the ... machine module. Setting a pin as an output allows you to control devices like LEDs, relays, or other actuators.
🌐
Besomi
besomi.com › ae_en › blog › post › signals-from-arduino-analog-vs-digital-pins
The Difference Between Analog and Digital Pins in Arduino | Besomi
July 10, 2025 - Afterward, the next step involves determining whether the electronic component functions as an output, where it receives a value, or as an input, where it provides readings. This difference between analog and digital pins in Arduino becomes crucial when writing the code and specifying the functions related to these components.
🌐
The Robotics Back-End
roboticsbackend.com › home › arduino uno pins – a complete practical guide
Arduino Uno Pins - A Complete Practical Guide - The Robotics Back-End
August 22, 2023 - Now, you can use the PWM only on some digital pins, which have a “~” next to their number. The Arduino Uno pins compatible with PWM are the pins 3, 5, 6, 9, 10 and 11. So you have 6 pins where you can create a PWM, using the analogWrite() ...
🌐
Arduino Forum
forum.arduino.cc › other hardware › 3rd party boards
Arduino UNO: Using Analog Input as Digital In/Out - 3rd Party Boards - Arduino Forum
February 6, 2013 - Any things I should watch out when using Analog pins as Digital In/Out. I understand this is possible and allowed according to Arduino website learning. However, is that any item I should watch out in my design or appl…