Voltage DC mcp4725

Hi guys,

I bought the mcp4725 for I understand that with it is possible to take out a certain DC, for example 2.5V.
I can't get it to work.
I don't know if it's a problem of how to connect to Arduino (Uno) or programming.

Thanks in advance for the help.

How would anyone else know if you don't show either your code or your wiring schematic.

Are you using it with a library? Adafruit has one available through the library manager.

yes, sorry, you're right.

I use the "trianglewave" example of Adafruit Library MCP4725. And then I connect the mcp4725 to Arduino Uno :
GND = GND
VDD -> 5V
A0 -> free
SDA -> A4
SCL -> A5
OUT -> Tester (I don't have an oscilloscope)

But I always got a fixed voltage number. I couldn't do it even by changing the program, e.g.:

#include <Wire.h>
#include <Adafruit_MCP4725.h>

Adafruit_MCP4725 dac;

void setup(void) 
{
  Serial.begin(9600);
  Wire.begin();
  dac.begin(0x62);
}
void loop(void) {
    uint32_t counter=0;
    for (counter = 0; counter < 4095; counter++)
    {
      dac.setVoltage(500, false);
      delay(1000);
    }
}

I always get the same: 3,2 V

thanks!

Hi,
Can you post your code in code tags please, or use the "copy for forum" function in the IDE EDIT tag?

Can you please post a circuit diagram of your project?

Thanks.. Tom.. :grinning: :+1: :coffee: :australia:

1 Like

Run this i2c scanner program from the ide (File>Examples>Wire>i2c_scanner) and confirm the address

// --------------------------------------
// i2c_scanner
//
// Version 1
//    This program (or code that looks like it)
//    can be found in many places.
//    For example on the Arduino.cc forum.
//    The original author is not know.
// Version 2, Juni 2012, Using Arduino 1.0.1
//     Adapted to be as simple as possible by Arduino.cc user Krodal
// Version 3, Feb 26  2013
//    V3 by louarnold
// Version 4, March 3, 2013, Using Arduino 1.0.3
//    by Arduino.cc user Krodal.
//    Changes by louarnold removed.
//    Scanning addresses changed from 0...127 to 1...119,
//    according to the i2c scanner by Nick Gammon
//    https://www.gammon.com.au/forum/?id=10896
// Version 5, March 28, 2013
//    As version 4, but address scans now to 127.
//    A sensor seems to use address 120.
// Version 6, November 27, 2015.
//    Added waiting for the Leonardo serial communication.
//
//
// This sketch tests the standard 7-bit addresses
// Devices with higher bit address might not be seen properly.
//

#include <Wire.h>

void setup() {
  Wire.begin();

  Serial.begin(9600);
  while (!Serial); // Leonardo: wait for serial monitor
  Serial.println("\nI2C Scanner");
}

void loop() {
  int nDevices = 0;

  Serial.println("Scanning...");

  for (byte address = 1; address < 127; ++address) {
    // The i2c_scanner uses the return value of
    // the Write.endTransmisstion to see if
    // a device did acknowledge to the address.
    Wire.beginTransmission(address);
    byte error = Wire.endTransmission();

    if (error == 0) {
      Serial.print("I2C device found at address 0x");
      if (address < 16) {
        Serial.print("0");
      }
      Serial.print(address, HEX);
      Serial.println("  !");

      ++nDevices;
    } else if (error == 4) {
      Serial.print("Unknown error at address 0x");
      if (address < 16) {
        Serial.print("0");
      }
      Serial.println(address, HEX);
    }
  }
  if (nDevices == 0) {
    Serial.println("No I2C devices found\n");
  } else {
    Serial.println("done\n");
  }
  delay(5000); // Wait 5 seconds for next scan
}
1 Like

thank you!!

"No I2C devices found\n" that´s the result

what can I do?

Hi,

Can you post a circuit diagram and a picture of your project so we can see your component layout please?

Thanks.. Tom... :grinning: :+1: :coffee: :australia:

1 Like

I connected the red cable to 5v instead of 3.3v.

Thank you Tom!

Matias

Tom, the cables were not connected properly! now i soldered them and it works! thank you very much!!!

I2C device found at address 0x62 !

it worked!!! thank you very much to all of you guys!!!

Matias

This topic was automatically closed 120 days after the last reply. New replies are no longer allowed.