9 Sensors for Arduino You Must Learn

Not sure what sensors to use for your next Arduino project? Then you'll want to read this article.

Disclosure: Some of the links in this post are affiliate links. This means that, at zero cost to you, Learn Robotics will earn an affiliate commission if you click through the link and finalize a purchase. Learn Robotics is a participant in the Amazon Services LLC Associates Program, an affiliate advertising program designed to provide a way for websites to earn advertising revenues by advertising and linking to Amazon.com.

Table of Contents

Are you building an electronic prototype using Arduino? Maybe you need to measure a specific condition and you’re looking for the right sensor to use. Regardless of the project, you can use this growing list of popular Arduino sensors to retrofit your next project.

The goal of this article is to outline some of the most popular sensors and then expand on this list over time. If your favorite sensor isn’t on this list, be sure to add it to the comments below. I will revise this list to create a comprehensive reference guide.

Tip: Bookmark this page (Windows: CTRL-D or Mac: CMD-D) to save it for future reference.

Popular Arduino Sensors List

Here’s a growing list of popular sensors for Arduino. A lot of these sensors can also be used with Raspberry Pi. So, if you plan on building electronics prototypes, I highly recommend having these sensors in your collection.

What it’s used for Where to Buy
Ultrasonic Sensor Calculate distances between objects Buy on Amazon
IR Sensor Detect contrast and distances of objects Buy on Amazon
IR Receiver Read data from IR remotes Buy on Amazon
Photoresistor Determine brightness Buy on Amazon
Temperature Measure the ambient temperature Buy on Amazon
Numeric Keypad Provide numerical input data Buy on Amazon
Potentiometer Send rotational position data to Arduino Buy on Amazon
Joystick Provide (x,y) coordinate input data Buy on Amazon
RFID Reader Read data from RFID tags Buy on Amazon

If you’re going to be working with Arduino and sensors for multiple projects, I recommend purchasing an Arduino sensor kit.

What’s the difference between Analog and Digital Sensors?

Analog sensors allow us to take readings over a range of values rather than just an ON/OFF condition. The digital pins on the Arduino provide a 1-bit signal (HIGH/LOW). The Arduino has a built-in 10-bit Analog-to-Digital Converter (ADC).

analog vs digital signals Arduino

Analog signals allow us to precisely measure Temperatures, Distances, across a range and then respond accordingly. Whereas digital signals only tell us if a signal is active or not.

1. Ultrasonic Sensor with Arduino

Ultrasonic Sensors are popular for measuring distances and object avoidance. The HC-SR04 and PING sensors are two common models. For less than $2 per sensor, you can calculate distances of 0.78 in-196 in (2cm-500cm). The HC-SR04 has four pins (Ground, Power, Trig, and Echo).

Rather than connecting the signal pins (Echo and Trig) into the analog pins on the Arduino, you’ll use two digital PWM pins. Here’s a wiring diagram that you can use to connect this sensor to the Arduino.

HC-SR04 ultrasonic sensor pin diagram

If you’re using the PING sensor, you can wire it to the Arduino using the diagram, below.

PING ultrasonic sensor pin diagram

Then, refer to this article to program your Ultrasonic Sensor.

Buy on Amazon


2. IR Sensor with Arduino

Another popular sensor is the IR sensor. This sensor can be used to detect objects or contrast. It’s a popular choice for line following or line avoidance in robotics.

The IR sensor has three pins (Ground, Power, and Signal). Connect the signal pin to any analog pin on the Arduino. Here’s how to wire an IR Sensor to an Arduino Uno.

IR Sensor pin diagram

Buy on Amazon


You can also use this sensor digitally by connecting the signal pin to any digital pin on the Arduino. Once you have this sensor connected to the Arduino, you can learn how to program it using this guide.

3. IR Receiver with Arduino

Another type of IR sensor is an IR receiver. Rather than using IR light to detect an object or read a line, we’ll use an IR receiver to decode the signal from a TV remote.

This is helpful if you have a device you want to control or if you want to use a remote to drive a robot around. The IR Receiver has three pins (Ground, Power, and Signal). Connect the signal to any digital pin on the Arduino. Here’s a fritzing diagram for an IR receiver connected to the Arduino Uno.

IR receiver wiring diagram to Arduino

Once you have this wired up, install the IR Remote Library and you’re ready to start making. Check out my tutorial on how to control a robot using a TV remote to see a guided walk-through on how to use this sensor.

Buy on Amazon


4. Photoresistor with Arduino

The fourth analog sensor for Arduino is a photoresistor (also known as a light-dependent resistor or LDR). Photoresistors can detect brightness. If you want to build a robot that follows a light or a prototype that triggers an action based on light or dark conditions, you’ll want to use a photoresistor. wire photoresistor to Arduino diagram

Photoresistors have two pins (Ground and signal). Because a photoresistor is a special type of resistor, you’ll create a voltage divider against the signal. You’ll also use a 10KΩ resistor to pull the signal up or down. This will determine whether dark is a high or low reading.

Connect the resistor to Ground if you want low values to represent darkness and high values to represent brightness. Connect the resistor to power if you want to flip this metric and have light values represent low reading. Refer to this tutorial to program a photoresistor.

Buy on Amazon


5. Temperature Sensor (TMP36) with Arduino

The next sensor on our list is the TMP36 Temperature sensor. You can also get a sensor module like the BME280, which reads the temperature, humidity, and also atmospheric pressure.

This sensor is great for IoT projects or if you want to make a weather station. (Try this kit.) Here’s the wiring diagram to connect the TMP36 to the Arduino Uno.

TMP36 Arduino wiring diagram

Buy on Amazon


Here’s another diagram if you want to connect the BME280 to an Arduino Uno.

BME280 Arduino fritzing diagram

Once you have your sensor wired up, you can learn to program the BME280 in this tutorial.

6. Numeric Keypad with Arduino

A numeric keypad is another awesome sensor to use with Arduino to provide user input. While this isn’t an analog sensor, it does provide many combinations of numbers, passcodes, and inputs for the Arduino.

Buy on Amazon


Numeric keypads use eight digital inputs to map out the rows and columns for each button. You can purchase a 4x3 Keypad or a 4x4 Keypad. Here’s a diagram to wire a 4×3 numeric keypad to the Arduino Uno.

keypad wiring fritzing diagram Arduino

You can access the free example code for the numeric keypad, below. Enter your email to access the Numeric Keypad Example code.

Here’s your download!

/* 4x4 Matrix Keypad connected to Arduino
 * This code prints the key pressed on the 
 * keypad to the serial port
 * For use without warranty
 * www.www.learnrobotics.org


const byte numRows= 4; //number of rows on the keypad
const byte numCols= 4; //number of columns on the keypad

//keymap defines the key pressed according to the row and columns just as appears on the keypad
char keymap[numRows][numCols]= 
{'1', '2', '3', 'A'}, 
{'4', '5', '6', 'B'}, 
{'7', '8', '9', 'C'},
{'*', '0', '#', 'D'}

//Code that shows the the keypad connections to the arduino terminals
byte rowPins[numRows] = {8,7,6,5}; //Rows 0 to 3
byte colPins[numCols]= {4,3,2,1}; //Columns 0 to 3

//initializes an instance of the Keypad class
Keypad myKeypad= Keypad(makeKeymap(keymap), rowPins, colPins, numRows, numCols);

void setup()

void loop()
    char keypressed = myKeypad.getKey();
    if (keypressed != NO_KEY){

7. Potentiometer with Arduino

Another popular sensor for Arduino is a potentiometer. A potentiometer can be used for many different hobby projects with the Arduino Uno.

Buy on Amazon


Some examples include controlling the brightness of an LED or setting the speed of a motor controller. Rotate the knob and you’ll get a proportional reading from the built-in ADC on the Arduino. Potentiometers have three pins (Ground, Power, and Signal).

potentiometer arduino wiring diagram

First, Connect Ground to GND on the Arduino. Then attach the Power pin to 5V on the Arduino. Finally, connect the Signal pin to any available analog pin on the Arduino. Here’s a wiring diagram to connect a potentiometer to an Arduino Uno. You can learn more about potentiometers in this tutorial.

8. Joystick with Arduino

If you’re looking to control x-y positions or send coordinate data to the Arduino, then you’ll want to check out the joystick module. You can also pick up a Gamepad Shield to turn your Arduino Uno into a game controller.

Buy on Amazon


joystick arduino wiring

The joystick module has five wires: Ground, Power, two analog inputs (VRx and VRy) and one digital input (Selector Switch). Refer to the joystick wiring diagram, above.

Using the analogRead() method, you can read the horizontal (x) and vertical (y) positions of the joystick. Since we’re using a 10-bit ADC, the home position or origin ends up being in the center at (511,511). Then, you can map these positions to drive a robot or control an LED matrix. It’s an interesting sensor to use if you need access to (x,y) coordinates.

9. RFID Reader (RC522) with Arduino

The RFID RC522 Reader (and writer) is a popular choice for automating door locks and access systems. There are seven wires for the RFID-RC522 sensor: Ground, Power, and five digital signal wires. Check out the RC522 Wiring Diagram, below.

RFID Arduino diagram

Once you have the RFID reader wired up, you’ll want to download and import the RIFD-RC522 library. Open the Arduino IDE and go to Sketch > Include Library > Manage Libraries… Then search for RC522. You’re now ready to program the RFID reader.

Buy on Amazon Buy on Learn Robotics


Wrap Up & Additional Arduino Resources

In this article, we explored nine popular sensors for Arduino. Whether you want to build a robot or develop a Smart Home, you’ll want to learn how to use analog sensors. Next time you’re developing a prototype, consider these Arduino sensors for your application.

Which Arduino sensors have you used frequently? Comment below! I’ll be adding your favorite sensors to this list. The goal is to create a comprehensive list of popular sensors for Arduino that you can reference at any time.

Do you need help learning Arduino? Enroll in Arduino for Beginners. It’s the only Arduino course you’ll ever need.

Like this article? Help a fellow maker by sharing this guide!

Related Articles

Leave a Reply

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

This site uses Akismet to reduce spam. Learn how your comment data is processed.


Learn Robotics Online
— Get 2 months free!

Exclusive Limited Offer for Serious Beginners Ready to take their Hobby to Engineering Internships, $100k+ Careers, and Beyond!

Enroll now, and earn your first robotics certificate in the next 7 days.

👇 Click below to claim this deal.