Raspberry Pi Pico

Raspberry Pi Pico ADC Reading an Analog Sensor

Raspberry Pi Pico ADC:


Analog Sensor Reading using Raspberry Pi Pico ADC– In this article, I am going to use this Potentiometer as the Analog sensor with the Raspberry Pi Pico Board. You know we have two types of sensors, Digital and Analog. Digital sensor I already explained with the help of a push button. Now, to explain how to read an analog sensor, this time I will use this Potentiometer with one of the Analog pins of the Raspberry Pi Pico. So, what I am going to do next is, I will read this Potentiometer and then I will display its value on the SSD1306 Oled display module. So, let’s go ahead and take a look at the circuit diagram.

Previous Articles:

Raspberry Pi Pico Vs Arduino.

Raspberry Pi Pico Pinout & Specs

Raspberry Pi Pico MicroPython and Thonny IDE Installation.

Raspberry Pi Pico Led examples.

Raspberry Pi Pico Digital Input.

Raspberry Pi Pico Oled Display Module SSD1306

Raspberry Pi Pico Temperature Sensor.

Raspberry Pi Pico Ultrasonic Sensor.

Raspberry Pi Pico PIR Motion Sensor.

Raspberry Pi Pico LDR Sensor, Day & Night Detection.

Amazon Links:

Raspberry Pi Pico

SSD1306 Oled Display Module


Other Tools and Components:

Top Arduino Sensors:

Super Starter kit for Beginners

Digital Oscilloscopes

Variable Supply

Digital Multimeter

Soldering iron kits

PCB small portable drill machines

*Please Note: These are affiliate links. I may make a commission if you buy the components through these links. I would appreciate your support in this way!

Analog Sensor Interfacing with Raspberry Pi Pico ADC:

Raspberry Pi Pico

The SSD1306 Oled display module connections with the Raspberry Pi Pico remains exactly the same.  Left leg of the potentiometer is connected with 3.3v, middle leg is connected with the Raspberry Pi Pico GP26 pin, and the rightmost leg is connected with the GND of the Pico board. Now let’s take a look at the programming.

Raspberry Pi Pico ADC Analog Sensor Programming:

The SSD1306 Oled display module code remains exactly the same and this time I added code for reading the Potentiometer. I defined a pin to which the Potentiometer is connected. I named the GP26 pin as pot_Val.

These two lines of codes read the potentiometer and applies the conversion_factor. These other lines of code simply print the value on the SSD1306 Oled display module. Now, let’s run this code.

Raspberry Pi Pico

As you can see, by rotating the knob of the potentiometer, I am able to change the value. Now you can modify this code to control the LED brightness, you can control the speed of a DC motor, and so on.

Next article, Raspberry Pi Pico Onboard Temperature Sensor

Watch Video:

Engr Fahad

My name is Shahzada Fahad and I am an Electrical Engineer. I have been doing Job in UAE as a site engineer in an Electrical Construction Company. Currently, I am running my own YouTube channel "Electronic Clinic", and managing this Website. My Hobbies are * Watching Movies * Music * Martial Arts * Photography * Travelling * Make Sketches and so on...

Leave a Reply

Your email address will not be published. Required fields are marked *

Back to top button