Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

To connect a sensor to an Arduino, first identify the exact board, sensor module, voltage requirements, and signal interface. Then wire the sensor to the matching power and signal pins, use an example or library for that interface, and check the readings in the Serial Monitor. There is no single wiring diagram that works for every Arduino and sensor.

What to check before connecting a sensor

Read the model printed on the Arduino board and the labels on the sensor module. Then consult the documentation for both. Sensor breakouts can differ in supply voltage, signal names, and communication method; a pin marked VCC does not automatically mean the module accepts 5 V. Arduino’s power-pin guidance explains the distinction between 3.3 V and 5 V supplies.

Identify how the sensor sends data before choosing pins or code. It may produce an analog voltage, a basic digital signal, or communicate over a bus such as I2C or SPI. Arduino separates analog input and digital input from its communication protocols, because each requires a different approach.

  • Board: Confirm the specific model and use its pin map.
  • Sensor: Find its supply range, pin labels, output type, and any pull-up or address requirements.
  • Software: Check that an example or library supports both the sensor and your board.

How to connect an analog-output sensor

Connect the sensor’s power and ground as specified in its documentation, then connect its analog output to an available analog input on the board. Start by printing the raw input readings to the Serial Monitor. Arduino’s Analog Read Serial and Analog Input examples show the basic code patterns.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
#1 Best Overall
Sale
ELEGOO 37-in-1 Sensor Modules Kit with Tutorial Compatible with Arduino
  • Build a 37-Module Sensor Lab: Add motion, distance, light, sound, temperature, touch, display and control functions to compatible UNO, MEGA, Nano, ESP-32 or STM32 projects for prototyping, classroom experiments and maker builds
  • Explore Input Sensors and Motion: Experiment with GY-521 motion sensing, PIR detection, ultrasonic ranging, temperature and humidity, DS18B20, flame, Hall, touch, light, sound, tilt, tracking and obstacle-avoidance modules
  • Add Displays, Timing and Control: Use the LCD1602, DS1307 real-time clock, joystick, rotary encoder, relay, buzzers, RGB LEDs and infrared modules to build clocks, alarms, counters, status displays and automated projects
  • Follow Guided Projects Materials: Use digital tutorial materials, datasheets, wiring diagrams and example code for compatible UNO R3, MEGA 2560 and Nano boards, then adjust thresholds, timing and logic to create custom experiments
  • Module-Only Expansion Kit: Controller board, USB cable, breadboard and jumper wires are not included; use 6.5–9 V DC only with the included power module, verify pin requirements before wiring and keep the laser emitter away from eyes

Do not assume raw readings convert to the same physical units across sensors or boards. The sensor’s output-voltage range and the conversion to a measurement depend on its documentation and the board’s input characteristics.

How to connect a digital sensor

Follow the module documentation for its power, ground, signal pin, and any pull-up or library requirements. For a sensor that provides a simple digital signal, Arduino’s Digital Read Serial example demonstrates reading an input.

Rank #2
Arduino Sensor Kit - Base [TPX00031] - Essential Sensors for Beginners, Includes 10+ Sensors for DIY Projects & Learning
  • Comprehensive Sensor Collection: The Arduino Sensor Kit - Base [TPX00031] includes over 10 essential sensors, such as temperature, light, motion, and humidity sensors, providing a complete foundation for learning and experimentation in electronics and IoT applications.
  • Ideal for Beginners and Education: This kit is designed for beginners, making it perfect for educators, students, and hobbyists who want to dive into sensor-based projects. With easy-to-follow instructions, you can start building interactive systems and gain hands-on experience in electronics.
  • Versatile and Expandable: The included sensors cover a wide range of applications, from environmental monitoring (temperature, humidity, air quality) to motion detection and light sensing. This makes the kit highly versatile, allowing for endless customization and experimentation in various fields such as home automation, robotics, and IoT.
  • Complete Learning Platform: Along with the sensors, the kit includes access to a variety of resources, including tutorials and example projects, to help you get started quickly. You'll learn how to wire, program, and use each sensor to create interactive and responsive systems.
  • Perfect for DIY Projects: Whether you're building a weather station, a smart home system, or a motion-activated alarm, this kit gives you the essential sensors to create functional, sensor-driven projects. The Arduino Sensor Kit - Base is the perfect tool for hands-on experimentation, prototyping, and learning.

“Digital” does not always mean the sensor is just a HIGH/LOW switch. A digital sensor may communicate over I2C, SPI, or another protocol; in that case, use the bus pins and device-specific code rather than treating its data connection as an ordinary GPIO input.

How to connect an I2C sensor

For a bare I2C breakout, connect VCC to the supply voltage permitted by that specific breakout, GND to GND, SDA to SDA, and SCL to SCL. Use the board’s designated I2C pins:

What’s actually slowing this PC down?

Pick the symptom - the matching free tool is one click away.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Rank #3
Lonely Binary 46-in-1 Sensor Kit for ESP32, Raspberry Pi Pico and STM32
  • 【46 TINKERBLOCK SENSOR MODULES IN ONE KIT】Includes 1.8" TFT LCD, 8x8 LED Matrix, 4-Digit 7-Segment Clock Display, Rotary Encoder, IR Sender & Receiver, Hall Sensor, Microphone, Joystick, Steam Sensor, EEPROM Memory, and 36 more. Every module takes standard 2.54mm jumper wires — no soldering. Storage case and quick-start card included; jumper wires and development board not included.
  • 【WORKS WITH EVERY MAJOR BOARD】Compatible with UNO R3, ESP32, ESP32-S3, Raspberry Pi Pico, and other 3.3V/5V microcontrollers. Supports DIGITAL, ANALOG, I2C, SPI, PWM, and IR interfaces. No soldering required. Each module clearly labeled.
  • 【IMMERSION GOLD (ENIG) PCB】Gold-plated contacts via the ENIG process for good signal integrity and corrosion resistance. Lead-free and RoHS-compliant.
  • 【BEGINNER-FRIENDLY GUIDED LEARNING】Each module comes with reference code, wiring diagrams, and step-by-step tutorials. Suitable for beginners, students (ages 12+), STEM educators, hobbyists, and engineers. Build weather stations, alarms, clocks, and games.
  • 【ORGANIZED FOR EDUCATION AND DIY】All modules are neatly packaged in a storage case with labeling for easy identification. Suitable for STEM classrooms, makerspaces, and personal projects — expand your skills in electronics and coding without sourcing parts individually.
Arduino board SDA SCL
UNO A4 A5
Nano A4 A5
MKR D11 D12
GIGA D20 D21
Mega D20 D21
Due D20 D21

These pin assignments are those listed in Arduino’s Wire library and I2C guide. For another board or revision, check its current pin map instead of assuming the same pins apply.

I2C lets a controller communicate with one or more peripherals over shared clock and data lines. Multiple I2C devices can share SDA and SCL when their addresses and electrical requirements allow it. Check the device documentation for address conflicts and pull-ups before connecting several modules.

Rank #4
Jaybva 37 in 1 Sensor Module Kit for Arduino Starters - Sensor Kit DIY for Raspberry Pi Mega2560 UNO R3 Nano Including Tutorial in USB Flash Driver
  • This sensor kit includes 37 sensor modules for you to learn basic knowledge about Raspberry Pi and sensors. It's a full set of Arduino's most common and useful electronic components for the beginners.
  • 37 sensors + USB flash driver with Tutorial : The USB flash driver card containing tutorial , code examples, a user manual to illurstrate the usage of each module and sensor
  • This kit really has the best assortment out there for modules and sensors for any DIY electronics project. It's a perfect learning tool for intelligent robot and car
  • Everything is packed in a box marked with detailed name of each sensor module
  • It comes with basic code examples for each module and sensor ( File in pde and excel), so you can quickly start hundreds of interesting projects

Arduino’s Wire library provides I2C communication functions. A sensor-specific library may use Wire internally and provide simpler functions for reading that device. Start with the matching example; Arduino’s I2C guide includes an example that reports when an accelerometer is not found and prompts the user to check wiring.

A breadboard and jumper wires can make it easier to connect a bare breakout during setup, but follow the module’s pin labels and voltage requirements rather than relying on a generic wiring picture.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Best Value
Comidox 37/Set Sensor Assortment Kit 37 in 1 Sensor Module Starter Kit for Arduino MCU Educ(Infrared/Temperature/Avoid Obstacle/Buzzer Sensor etc)
  • One set contains 37 different sensor modules that give you a comprehensive understanding of the basics of Arduino and sensors.
  • A complete set of the most common and practical electronic components of the Arduino is the perfect choice for electronics enthusiasts.
  • Arduino enthusiasts can easily control and use these modules.
  • Including temperature sensors, water level sensors, pressure sensors,,infrared receiver modules, etc., to meet your different needs.
  • Whether you are learning Arduino or other controllers, sensors are a must, because we have to control the data, such as photoresistors, temperature sensors, infrared receiver modules, etc. are often used. This time, we put the sensors that most learners need in a suit, so that everyone can get 37 sensors at a time, which is convenient for everyone to use and learn.
Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

Connecting Grove sensors

If your Arduino does not have a Grove connector, Arduino lists options such as the MKR Connector Carrier, Nano Grove Shield, and Arduino Sensor Kit Base Shield. These adapt connector formats; they do not guarantee that every Grove module is electrically or software-compatible with every board. Check the module and board documentation.

What about SPI sensors?

SPI wiring depends on the board and sensor, including the relevant pin assignments and chip-select connection. Consult the documentation for your exact board and sensor, and do not reuse an I2C wiring diagram or assume SPI pin numbers are universal. Arduino’s learning index includes an Arduino and SPI guide.

How to read a sensor value in Arduino

  1. Open the matching example. Use an analog or digital built-in example for a simple input, or the sensor library’s example for a bus-based device.
  2. Confirm the wiring and voltage. Match each connection to the module documentation and the correct board pins.
  3. Upload the sketch and open Serial Monitor. Initialize the sensor as the example requires, then print the readings to inspect them.
  4. Check the result. Look for a sensor-detected message if the example provides one, and compare changing readings with the sensor’s expected behavior.

If readings are absent or implausible, check power and ground first, then the signal connection, board-specific I2C pins, voltage compatibility, and any library or address configuration.

How to choose a sensor for an Arduino project

Compare candidate sensors against the measurement and conditions your project requires. Check these points before buying or wiring one:

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
  • What physical quantity does it measure?
  • Does it output analog data, a digital GPIO signal, I2C, SPI, or another protocol?
  • What supply and logic voltage does it require?
  • Does your selected Arduino expose the required pins?
  • Is there an example or maintained library that supports both the sensor and your board?

A sensor cannot be ranked as the best choice without knowing the project’s measurement needs and operating environment.

Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.