If you’ve spent any time in the Indian maker electronics community, you’ve almost certainly come across the DFRobot Gravity sensor ecosystem. Gravity is DFRobot’s proprietary plug-and-play interface standard that allows makers and engineers to connect sensors to microcontrollers in seconds — no breadboard, no loose wires, no soldering required for basic use. The Gravity interface has become so popular that many other manufacturers now design boards compatible with it.
This comprehensive overview covers the Gravity interface standard, the most popular sensor categories available, how to choose the right Gravity sensor for your project, and tips for getting the most out of the ecosystem on Arduino, ESP32, and Raspberry Pi platforms.
What Is the Gravity Interface?
The DFRobot Gravity Interface is a standardised connector and PCB colour-coding system designed to eliminate wiring complexity for beginners while maintaining full compatibility with professional microcontrollers. Launched around 2012, it has grown into one of the largest open sensor ecosystems, with over 200 compatible modules spanning environmental, chemical, biometric, motion, and communication categories.
The core concept is simple: every Gravity sensor module uses a consistent 3-pin (analog/digital) or 4-pin (I2C/UART) connector with standardised voltage levels and colour-coded PCBs for easy identification. When you buy a Gravity sensor and a Gravity-compatible shield or board, the connectors match physically and electrically — you plug in and code.
Beyond the convenience factor, Gravity sensors are known for their quality signal conditioning circuitry. Rather than selling bare sensor chips, DFRobot designs complete modules with appropriate op-amps, voltage dividers, EMI filtering, and protection diodes. This means the signals reaching your microcontroller’s ADC are clean, properly scaled, and protected against accidental shorts.
Gravity Connector Types Explained
There are four main Gravity connector types you’ll encounter:
3-Pin Analog (Blue PCB)
Used for sensors that output a continuously varying voltage proportional to the measured quantity. Examples: pH sensor, turbidity sensor, soil moisture sensor, temperature sensor. The three pins are always in the same order: VCC (red wire), GND (black wire), and Signal (yellow wire). Compatible with any analog input on Arduino, ESP32, or STM32.
3-Pin Digital (Blue PCB with D prefix)
Used for sensors that output a discrete HIGH/LOW signal or pulse trains. Examples: PIR motion sensor, fire sensor, crash sensor, sound sensor (digital output). Same 3-pin layout as analog but the signal is either 0 or VCC. Connect to any digital GPIO pin.
4-Pin I2C (Blue PCB with I prefix)
Used for sensors that communicate over the I2C protocol. Examples: BME280 environmental sensor, VL53L0X time-of-flight sensor, OLED displays, IMU sensors. The four pins are: VCC, GND, SDA, SCL. The JST PH 2.0mm 4-pin connector is standard.
4-Pin UART (Blue PCB with U prefix)
Used for sensors with serial communication. Examples: CO2 sensor (MH-Z19), GPS modules, fingerprint readers. Four pins: VCC, GND, TX, RX. Note the TX of the sensor connects to RX of the microcontroller and vice versa.
Gravity Sensor Categories
The Gravity catalogue spans nearly every sensing domain used in DIY, education, industrial prototyping, and agricultural IoT. Here’s a high-level map of what’s available:
| Category | Examples | Interface |
|---|---|---|
| Environmental | BME280, DHT22, LM35 | Analog / I2C |
| Gas & Air Quality | CO2, VOC, O2, NO2, NH3 | Analog / UART / I2C |
| Water Quality | pH, EC, TDS, ORP, DO | Analog / I2C |
| Motion & IMU | 6-axis IMU, gyro, accel | I2C / SPI |
| Biometric | Heart rate, SpO2, GSR, EMG | Analog / I2C |
| Soil & Agriculture | Soil moisture, NPK, salinity | Analog / UART |
| Force & Weight | Load cell, flex sensor | Analog |
Environmental and Climate Sensors
Environmental sensors are the most popular entry point into the Gravity ecosystem. The flagship environmental module is the Gravity BME280 (temperature, humidity, barometric pressure) — a single I2C module that gives you three critical climate metrics.
For temperature alone, the Gravity LM35 analog module is a classroom staple — the LM35 outputs 10 mV per degree Celsius directly readable by any Arduino analog pin. More precise is the Gravity DS18B20 module, using Dallas 1-Wire protocol with ±0.5°C accuracy and support for multiple sensors on a single data wire.
The Gravity DHT22 module combines temperature and humidity on a single-wire digital protocol. It’s superior to the DHT11 with ±0.5°C temperature accuracy and ±2% RH humidity accuracy — significantly better than the DHT11’s ±2°C and ±5% RH. For Indian monsoon season projects where humidity swings dramatically, the DHT22’s range (0–100% RH with no condensation issues) is essential.
Motion, Position, and IMU Sensors
DFRobot’s motion sensing line includes PIR sensors, ultrasonic rangefinders, and full IMU modules. The Gravity PIR sensor uses a pyroelectric sensor element with an adjustable sensitivity potentiometer, making it ideal for intrusion detection systems, automatic lighting, and people counters.
The Gravity URM09 is DFRobot’s I2C ultrasonic rangefinder — a significant upgrade from the ubiquitous HC-SR04, offering 3–500 cm range with ±1 cm accuracy and I2C communication that doesn’t require precise timing like HC-SR04’s trigger/echo approach.
For IMU applications, the Gravity SEN0142 (LSM6DS33) offers 6-axis motion sensing in a compact I2C module. The Gravity 9-axis IMU (ICM-20948) adds magnetometer data for complete orientation tracking, useful in drone attitude estimation, robotic arm joint monitoring, and wearable motion capture.
Gas and Air Quality Sensors
DFRobot’s gas sensor lineup is arguably the most comprehensive in the hobbyist market. Built around the MQ-series electrochemical sensors, the Gravity gas modules add precision signal conditioning that raw MQ breakout boards lack.
Key sensors in this category:
- CO2 Sensor (MH-Z19B): NDIR CO2 measurement 400–5000 ppm with UART/PWM output. No warm-up drift issues like MOX sensors. Essential for ventilation control applications.
- O2 Sensor (ME2-O2-Ф20): Electrochemical oxygen sensor 0–25% O2. Used in combustion analysis, medical, and confined space safety.
- NO2 Sensor: Nitrogen dioxide 0–20 ppm. Useful for indoor air quality monitoring near gas stoves and diesel generators.
- Flame Sensor: IR-sensitive phototransistor for fire detection. Digital output with range up to 100 cm.
- MQ-2 Smoke/LPG Sensor: Analog output sensitive to LPG, smoke, alcohol, propane, hydrogen. Popular for kitchen safety.
Bio and Medical Sensors
DFRobot’s biometric Gravity sensors enable student projects in health monitoring and human-computer interaction:
- Heart Rate Sensor (SEN0203): Optical pulse oximetry sensor for fingertip or earlobe. Outputs analog PPG waveform for HR calculation. Used in wearable fitness trackers.
- Muscle Sensor (SEN0240): EMG (electromyography) sensor module that amplifies muscle electrical signals. Can be used to control servos or robotics with muscle gestures.
- Galvanic Skin Response (GSR) Sensor: Measures skin conductance as a proxy for emotional arousal. Used in lie detector demos and stress-level monitoring.
- Respiration Sensor: Thin piezo film belt that detects chest expansion. Outputs analog voltage proportional to respiratory effort — used in sleep apnoea and biofeedback projects.
Compatible Microcontroller Boards
The Gravity ecosystem is intentionally board-agnostic — any microcontroller with I2C/SPI/UART/analog pins can be used. However, DFRobot produces specific shields and boards that make Gravity connectivity even simpler:
- DFRobot Romeo V2: Arduino-compatible board with integrated Gravity connectors and L298 motor driver. All analog and digital pins exposed as Gravity 3-pin connectors.
- DFRobot Firebeetle ESP32: Ultra-low-power ESP32 board with Gravity connectors. Excellent for battery-powered IoT sensor nodes.
- Gravity I2C Hub: Multiplexer board that expands one I2C bus into 8 Gravity I2C sockets. Essential when using multiple I2C sensors with conflicting addresses.
- Gravity Analog Expansion Shield (for Arduino): Breaks out all analog pins as Gravity 3-pin connectors, plus UART and I2C ports.
For non-DFRobot boards (standard Arduino Uno, ESP32 DevKit, Raspberry Pi), you can use standard dupont-to-JST-PH cables to connect Gravity sensors to bare header pins. Most users do this in practice — the Gravity connector is useful but not mandatory.
Wiring Tutorial: Gravity Analog Sensor to Arduino
Let’s walk through connecting the Gravity Capacitive Soil Moisture Sensor to an Arduino Uno as a practical example.
What you need:
- Arduino Uno
- DFRobot Gravity Capacitive Soil Moisture Sensor (SEN0193)
- Gravity 3-pin wire (included with sensor)
Wiring:
| Gravity Sensor Pin | Wire Colour | Arduino Pin |
|---|---|---|
| VCC | Red | 5V |
| GND | Black | GND |
| SIG | Yellow | A0 |
// Gravity Capacitive Soil Moisture Sensor Example
const int sensorPin = A0;
const int AirValue = 520; // Analog value in dry air (calibrate this)
const int WaterValue = 260; // Analog value submerged in water (calibrate)
void setup() {
Serial.begin(9600);
Serial.println("Gravity Soil Moisture Sensor Ready");
}
void loop() {
int rawVal = analogRead(sensorPin);
int moisturePercent = map(rawVal, AirValue, WaterValue, 0, 100);
moisturePercent = constrain(moisturePercent, 0, 100);
Serial.print("Raw: "); Serial.print(rawVal);
Serial.print(" | Moisture: "); Serial.print(moisturePercent);
Serial.println("%");
delay(1000);
}
Calibrate AirValue and WaterValue for your specific soil type — dry clay has different capacitance than sandy loam. Note that the capacitive sensor doesn’t corrode like resistive sensors, making it suitable for long-term deployment.
Gravity vs. Grove vs. Qwiic Comparison
Three major plug-and-play sensor standards compete in the maker market. Here’s how they compare:
| Feature | DFRobot Gravity | Seeed Grove | SparkFun Qwiic |
|---|---|---|---|
| Connector | JST PH 2mm (3/4 pin) | HY 2mm (4-pin) | JST SH 1mm (4-pin) |
| Voltage | 3.3V / 5V variants | 3.3V / 5V variants | 3.3V only |
| Protocol Support | Analog, Digital, I2C, UART | Analog, Digital, I2C, UART | I2C only |
| Catalogue Size | 200+ sensors | 300+ sensors | 100+ boards |
| Best For | Chemical/water quality/bio | General purpose / Raspberry Pi | I2C chain projects, clean wiring |
For Indian makers, Gravity has a slight advantage in the water quality and agricultural sensor categories — DFRobot’s pH, EC, TDS, and DO sensors are among the best-documented and most affordable in their class, and these are in high demand for hydroponics, aquaponics, and water treatment projects.
Buying Guide: Which Gravity Sensor for Your Project?
For Classroom Education (School / College Projects)
Start with: Gravity DHT22 (temperature + humidity), Gravity Soil Moisture Sensor, Gravity PIR sensor, and Gravity Light Sensor. These four sensors cover most standard Arduino curriculum topics and are robust to student handling. All are 5V compatible with Arduino Uno.
For Home Automation with ESP32
Choose I2C sensors for ESP32’s dual I2C buses: BME280 (climate), SEN0321 (TVOC/eCO2 — DFRobot’s ENS160 Gravity version), VL53L0X (proximity), and the Gravity I2C Hub to manage multiple addresses. Use the Gravity UART CO2 sensor (MH-Z19B) on the ESP32’s second UART for true CO2 monitoring.
For Hydroponics / Aquaponics
The complete kit would include: Gravity pH Sensor (SEN0161-V2), Gravity EC Sensor (SEN0165), Gravity TDS Sensor (SEN0244), and Gravity Dissolved Oxygen Sensor (SEN0237). All are analog output, compatible with the Gravity Analog Expansion Shield for easy simultaneous reading.
For Industrial IoT Prototyping
Consider the Gravity 4-20mA current loop modules (SEN0262) for connecting industrial sensors to Arduino/ESP32. Also: the Gravity RS485 module for MODBUS communication with industrial PLCs and meters.
Capacitive Soil Moisture Sensor
A corrosion-free capacitive soil moisture sensor perfect for long-term garden and agricultural IoT installations — compatible with all Gravity-style systems.
LM35 Temperature Sensors
The classic analog temperature sensor used in countless DFRobot Gravity projects — simple, linear 10 mV/°C output, no calibration needed.
Frequently Asked Questions
Are Gravity sensors only compatible with DFRobot boards?
No. Gravity is a connector and voltage standard, not a proprietary protocol lock-in. Any microcontroller with the appropriate pins (analog, I2C, UART) can interface with Gravity sensors using standard dupont cables or JST PH 2mm adapters. The connectors are simply a convenience feature — the sensors themselves output standard electrical signals.
Can Gravity sensors be used with Raspberry Pi?
I2C and UART Gravity sensors work directly with Raspberry Pi (3.3V logic). Analog Gravity sensors require an external ADC (like the ADS1115 or MCP3008) as the Raspberry Pi has no built-in ADC. DFRobot sells a Gravity ADC hat specifically for this purpose.
What is the difference between Gravity analog V1 and V2 sensors?
V2 versions typically include improved signal conditioning for better accuracy, wider input voltage range (some V1 sensors were 5V only, V2 adds 3.3V compatibility), and updated Arduino libraries. When purchasing, check which version is in stock and confirm the voltage compatibility with your target microcontroller.
How do I handle multiple Gravity I2C sensors with the same address?
Use the DFRobot Gravity I2C Hub (SEN0412) or a TCA9548A I2C multiplexer. These modules create separate I2C bus segments, each addressable independently, allowing multiple sensors with identical I2C addresses to coexist. The Gravity I2C Hub is available in 1-to-8 and 1-to-4 configurations.
Are Gravity water quality sensors calibrated?
DFRobot ships water quality sensors (pH, EC, DO) with factory calibration, but environmental calibration is required at installation. pH sensors need two-point calibration using pH 4.01 and pH 7.0 buffer solutions. EC sensors calibrate against a reference conductivity solution. The Arduino libraries include calibration routines and EEPROM storage for calibration constants.
Conclusion
The DFRobot Gravity ecosystem has earned its place as one of the most comprehensive and beginner-friendly sensor platforms available. Its standardised plug-and-play connectors, excellent documentation, and wide range of sensor categories make it an ideal choice for everyone from school students building their first Arduino projects to professional engineers prototyping industrial IoT solutions.
Whether you’re measuring soil moisture on a rooftop farm, monitoring CO2 in an office, tracking water quality in an aquaponics system, or building a wearable health monitor, there’s almost certainly a Gravity sensor module designed precisely for your application. The colour-coded PCBs and foolproof connectors mean you spend less time debugging wiring and more time writing code and building features.
For Indian makers, the combination of strong documentation, DFRobot’s active community, and availability through Indian distributors makes the Gravity ecosystem a particularly sound investment for project development.
Explore Sensors & Modules at Zbotic
Browse our curated selection of analog, digital, and I2C sensor modules for Arduino, ESP32, and Raspberry Pi — with fast shipping across India.
Add comment