Skip to content
If this is your first visit, please click here to learn about shipping and delivery.
If this is your first visit, please touch here to learn about shipping and delivery.
MCP4725 I2C digital-to-analogue converter breakout board

Using an MCP4725 DAC for Analogue Control: Output Voltage, Startup State and Calibration

A digital-to-analogue converter is useful when a project needs a programmable voltage: a test input for another circuit, an adjustable threshold or a setpoint for a compatible controller. It can make a microcontroller interact with analogue equipment in a predictable, measurable way.

The MCP4725 I2C DAC breakout from PMD Way is a compact example. A successful project requires more than sending a number: the supply determines the scale, the load influences the output and stored settings affect what happens before your firmware takes control.

Define the receiving circuit first

Write down the voltage range that the receiving input accepts, its input resistance, its reference ground and what it does when the signal disappears. Check whether it expects a voltage, current, resistance or PWM signal. Those interfaces are not interchangeable just because each represents a setting.

A DAC output is a signal source, not a general-purpose power supply. Do not connect motors, relay coils or speakers directly. If the final equipment requires more voltage or current, design a suitable buffer or driver and include its behaviour in the project tests.

For an initial experiment, use a high-impedance voltmeter as the load. This lets you verify the basic conversion before introducing the electrical requirements of another circuit.

Calculate the ideal voltage and code

The Microchip MCP4725 data sheet specifies a 12-bit converter using VDD as its reference. Its ideal relationship is VOUT = VDD × code / 4096, with codes from 0 to 4095.

At an illustrative measured supply of 3.300 V, code 2048 represents 1.650 V and one ideal step is about 0.806 mV. Code 4095 represents approximately 3.2992 V, one ideal step below the reference. Actual endpoint behaviour also depends on the analogue circuit and load.

To request a voltage, calculate code = round(4096 × requested voltage / measured VDD), then constrain the result to the allowed code range. Validate the requested voltage separately so an invalid user entry cannot silently become an unintended maximum output.

Keep the physical quantity distinct from the raw code in your program. A function called “set millivolts” should perform the conversion; a function called “write code” should accept only an integer code. This makes later calibration changes less likely to break unrelated software.

Check power, pull-ups and addressing

The chip operates from 2.7–5.5 V. Its I2C address depends on factory-programmed address bits and the A0 input. The PMD Way listing identifies 0x62/0x63 for this board; confirm the fitted device and jumper state rather than copying another breakout's address.

Verify the board's pull-up connections before attaching a controller. A DAC powered from 5 V can pull the bus towards 5 V if its pull-ups connect there. A 3.3 V-only controller needs an electrically compatible arrangement, not merely a library that recognises the chip.

Start with a short connection and one DAC. Record the discovered address, controller bus settings and board supply. Check acknowledgements and expose communication failures in the application. Displaying a newly requested voltage does not prove the hardware received it.

Separate ordinary updates from saved settings

The MCP4725 has a volatile DAC register and EEPROM. At reset it reloads the saved configuration. EEPROM writes take much longer than ordinary output updates and have finite endurance, so reserve them for deliberate persistent changes.

A useful interface offers an “apply” action and a separate “save startup value” action. Moving a slider should update the output without repeatedly writing nonvolatile memory. Save only when the operator requests it, wait for completion using the documented status behaviour and verify the stored value.

Choose the startup setting according to the receiving system. Zero volts may be appropriate for one input and mean full output for another. Test what appears at the connector while the DAC starts, while the controller resets and while communication is unavailable.

If an unintended output could matter, give the receiving circuit an independent enable condition or other suitable hardware control. Firmware that writes a safe value after boot does not define the entire interval before it runs.

Treat resolution and accuracy as different questions

Twelve-bit resolution gives many possible steps. It does not guarantee that every requested voltage is accurate to one step. Offset, gain error, nonlinearity, supply variation and measurement uncertainty all contribute. Analog Devices' converter overview explains these distinctions.

Measure several codes across the range with a suitable meter. Record the supply at the same time and repeat with the intended load attached. A falling output under load calls for an electrical investigation, not an immediate software correction.

Because the reference is the supply, sharing a noisy rail with a motor or heavily switched load can affect the output. Compare measurements during the project's quiet and busiest operating conditions. Review supply regulation, decoupling and grounding if the result changes with unrelated activity.

Calibrate a useful working range

Choose two well-separated points inside the range your application actually uses, avoiding endpoints if the circuit cannot reproduce them cleanly. Measure the outputs and calculate a linear correction for offset and scale. Then test intermediate points that were not used to create the correction.

Analog Devices' calibration guidance describes how gain and offset corrections fit into a DAC signal chain. Calibration does not remove every source of error, so retain the measured residuals and define an acceptable tolerance.

Store calibration with its date, supply arrangement, load and board identity. Replacing a buffer or changing the power source may invalidate it. Avoid displaying more decimal places than your measurements justify.

Test changing outputs as well as steady values

A slow setpoint is different from a waveform generator. Bus transfer time, software timing, output settling and the load all limit useful update speed. A quoted I2C bit rate is not the frequency of an accurately reproduced analogue waveform.

When driving a cable or capacitive input, check stability and settling with the actual load. Buffer selection needs attention to input range, output swing, current and capacitive-load behaviour. TI's capacitive-load reference design illustrates why a suitable amplifier arrangement matters.

  1. Verify several static outputs with only the meter connected.
  2. Repeat with the intended receiver attached.
  3. Step between representative settings and observe the response.
  4. Restart the DAC and controller separately.
  5. Disconnect communication and verify the resulting state.

Once these checks pass, document the complete signal path. The DAC breakout collection offers a starting point for comparing converters, but the best choice is the one whose voltage range, reference, interface and startup behaviour match the receiving circuit.

Previous article Battery Power for Arduino Projects: Voltage Range, Runtime and Regulator Heat