Overview
The PCF8591 is a single-chip 8-bit CMOS data acquisition IC manufactured by NXP Semiconductors. It integrates four single-ended (or two differential) 8-bit analog inputs, one 8-bit Digital-to-Analog converter (DAC) output, an internal track-and-hold circuit, and a standard bus interface.
Standard blue PCB breakout modules bundle the PCF8591 alongside three onboard analog components: an NTC thermistor, a photoresistor (LDR), and a trimmer potentiometer connected to AIN0–AIN2 via removable jumpers. It is widely used in beginner Raspberry Pi and Arduino projects to learn analog-to-digital and digital-to-analog conversion over .
Quick reference
Operating voltage (VCC) | 2.5 V to 6.0 V DC |
| ADC resolution | 8-bit (256 discrete levels) |
| ADC channels | 4 single-ended, 2 differential, or mixed |
| DAC resolution | 8-bit (1 analog voltage output pin AOUT) |
| Interface | (Standard 100 kHz) |
| Default address | 0x48 (3 hardware address pins ) |
| Operating current | active / standby |
Pinout
Common 4-pin + 4-pin Analog breakout header:
| Pin | Name | Type | Description |
|---|---|---|---|
| 1 | VCC | Power | Supply voltage (+2.5 V to +6.0 V DC) |
| 2 | GND | Power | Ground (0 V) |
| 3 | SDA | Digital Input / Output | Serial Data |
| 4 | SCL | Digital Input | Serial Clock |
| 5 | AIN0 | Analog Input | Analog Channel 0 (connected to LDR on module jumper P5) |
| 6 | AIN1 | Analog Input | Analog Channel 1 (connected to Thermistor on jumper P4) |
| 7 | AIN2 | Analog Input | Analog Channel 2 (connected to Potentiometer on jumper P6) |
| 8 | AIN3 | Analog Input | Analog Channel 3 (free external analog input) |
| 9 | AOUT | Analog Output | 8-bit DAC output voltage pin |
Specifications
| Parameter | Symbol | Min | Typ | Max | Unit | Conditions |
|---|---|---|---|---|---|---|
| Supply Voltage | 2.5 | 3.3 / 5.0 | 6.0 | V | DC | |
| Reference Voltage | — | V | Analog reference range | |||
| ADC Conversion Time | — | 90 | — | µs | Limited by clock speed | |
| ADC Non-Linearity | -1 | +1 | LSB | 8-bit resolution | ||
| DAC Slew Rate | — | 100 | — | V/ms | Full-scale step output | |
| DAC Load Resistance | 10 | — | — | kΩ | Connected to AOUT |
Control Byte & Protocol
The PCF8591 uses a single control byte sent immediately following the device address (0x48):
- Bit 7: Always 0.
- Bit 6:
ANALOG OUTPUT ENABLE(1 = DACAOUToutput enabled, 0 = High impedance). - Bits 5–4: Analog Input Programming Mode (
00= 4 single-ended inputs). - Bit 3: Always 0.
- Bit 2: Auto-increment flag (1 = automatically cycle through
AIN0–AIN3on sequential reads). - Bits 1–0: Channel Select (
00= AIN0,01= AIN1,10= AIN2,11= AIN3).
Wiring
| PCF8591 Pin | → | Arduino / Raspberry Pi | Notes |
|---|---|---|---|
VCC | 5V / 3.3V | Match logic level of host MCU | |
GND | GND | System ground | |
SDA | A4 / GPIO 2 (SDA) | Data | |
SCL | A5 / GPIO 3 (SCL) | Clock |
Example
#include <Wire.h>
#define PCF8591_ADDRESS 0x48
void setup() {
Serial.begin(9600);
Wire.begin();
}
void loop() {
// Enable DAC output and read AIN0 (Channel 0)
Wire.beginTransmission(PCF8591_ADDRESS);
Wire.write(0x40); // 0x40 = Enable DAC (bit 6), read AIN0
Wire.write(128); // Set DAC AOUT to mid-rail (~2.5V)
Wire.endTransmission();
Wire.requestFrom(PCF8591_ADDRESS, 2);
Wire.read(); // First byte returned is previous conversion result; discard
uint8_t adcValue = Wire.read();
float voltage = (adcValue / 255.0) * 5.0;
Serial.print("AIN0 ADC: "); Serial.print(adcValue);
Serial.print(" | Voltage: "); Serial.print(voltage); Serial.println(" V");
delay(500);
}
Common mistakes
- Discarding first read byte: The PCF8591 uses a pipelined conversion architecture. When reading a channel over , the first byte returned is the previous channel sample. Always discard the first byte or issue two sequential reads.
- Forgetting jumper removal for external signals: On standard blue modules, jumpers P4, P5, and P6 hardwire
AIN0–AIN2to the onboard sensors. To read external analog voltages onAIN0–AIN2, remove the corresponding shunt jumper.
Notes
- PCF8591 vs ADS1115: PCF8591 is 8-bit (256 steps) with DAC output; ADS1115 is 16-bit (65,536 steps) precision ADC without DAC.
Assets & downloads
- datasheetdatasheet
- product-pagereference