This is a precision Digital-to-Analog Converter (DAC) module built around the Microchip MCP4921, a 12-bit DAC with SPI interface. Designed for easy integration with microcontrollers such as Arduino, ESP32, and STM32, this module allows you to generate analog voltages from digital values.
A unique feature of this module is the selectable voltage reference—you can choose between using the system VCC or a precise 4.096V reference generated by an onboard MCP1541 voltage reference IC. This flexibility allows you to maintain high output accuracy in various operating conditions.
✅ MCP4921 12-bit DAC (SPI interface, 1-channel)
✅ Selectable VREF:
VCC
4.096V from MCP1541
✅ Compatible with 3.3V and 5V logic systems
✅ Onboard 10k pull-down resistor on output
✅ SPI Header: Easy connection to Arduino or other microcontrollers
✅ Output terminal block for easy analog signal wiring
✅ Decoupling capacitors included (10µF and 100nF) for clean VREF and power lines
| Pin | Signal |
|---|---|
| 1 | VCC |
| 2 | CS |
| 3 | SCK |
| 4 | MOSI |
| 5 | GND |
Learn how DACs work in microcontroller projects
Generate analog voltage signals (waveform, audio, or control voltage)
Sensor simulation and calibration
Signal processing and test equipment DIY projects
Material: FR4, 1.6 mm thickness
Copper: 1 oz (35 µm)
Solder mask: Blue (other colors on bulk order)
Silkscreen: White with clear labeling
Dimensions: Compact (~25×20 mm, adjust per your layout)
Connect this module to your Arduino using the SPI pins and use standard MCP4921 Arduino libraries or custom SPI code to control output voltage (0–4095 steps). The output voltage will scale between 0V and the selected VREF.
Connections (based on your schematic):
MOSI → Arduino pin 11
SCK → Arduino pin 13
CS → Arduino pin 10
VREF: Select with jumper: VCC or MCP1541 output.
#include <SPI.h>
#define DAC_CS 10 // Chip Select pin for MCP4921
void setup() {
Serial.begin(9600);
SPI.begin();
pinMode(DAC_CS, OUTPUT);
digitalWrite(DAC_CS, HIGH); // Idle state
Serial.println(“MCP4921 DAC Test Starting…”);
}
void loop() {
for (int val = 0; val < 4096; val += 256) {
writeDAC(val);
Serial.print(“DAC Output: “);
Serial.println(val);
delay(500);
}
}
void writeDAC(int value) {
// MCP4921: 12-bit value (0-4095), with control bits
uint16_t command = 0b0011000000000000; // Start bits: 0b0011 = A channel, buffered, gain=1x, active
command |= (value & 0x0FFF); // 12-bit DAC value
digitalWrite(DAC_CS, LOW);
SPI.beginTransaction(SPISettings(20000000, MSBFIRST, SPI_MODE0));
SPI.transfer16(command);
SPI.endTransaction();
digitalWrite(DAC_CS, HIGH);
}
Upload the code to your Arduino Uno.
Connect a multimeter to the VoutA pin of the MCP4921 (or screw terminal).
You should see the output voltage step up every 0.5 seconds.
If VREF = 4.096V, expect output from 0V to ~4.095V.
If VREF = VCC, expect output from 0V to ~VCC.
You must be logged in to post a review.
Reviews
There are no reviews yet.