I am trying to a run a bit of code to test the output of my DAC (MCP4725). I am using an Arduino Uno, and the endgame of this endeavor is to control a micropump. My code is simply outputting a voltage, but I am reading ~5v supplied by the Uno. It should cycle between 1-5v.
Have You made this run without any load connected to the DAC analog output?
If You have I have to ask You for schematics, and the link to the DAC datasheet.
Checking the load is needed. Know that the DAC most likely only manages some milliamps.
It's not clear what that is supposed to tell. Load, or no load is the number one question. If the only load is a digital voltmeter set for voltage, not current, and plugged to the proper places on the DVM, we need to widen the search area.
This is the one, apologies for not providing it.
Shouldn't my approach work though? According to the datasheet, if you provide a constant voltage at the range specified. The pump should function accordingly. My problem is that the DAC will not change its voltage.
Forget the pump for the moment. @JohnLincoln has verified your software, and @Railroader agrees with you wiring, such as you show.
If you can't get that to function, there must be a wiring error or a faulty component.
Your twin brother might try using a potentiometer to directly feed a controlling voltage to the pump to confirm the data sheet's claims.
But the two parts can remain separate until each is working.
There's still the question of the DAC providing enough current to the motor input. Since it says it goes direct to an analog converter it probably doesn't need much, but that specification is missing or buried, so may be a problem.
It looks like you are using the DAC chip directly, are you sure all the pins you don't mention in your drawing are connected appropriately?
It would probably be better if you had the kind that used digital control. Just sayin'.
I think there is a faulty component, and that is the DAC. I used this configuration before, and it worked before. The DAC I am using only has 6 pins. My diagram shows everything that is relevant to my situation. It is a very simple circuit. The job of the DAC is to provide a steady voltage. I think I have to get a new DAC.
But you mentioned a DAC that has digital control? Please elaborate.
No worries, it would sure be easier to not use so many in between parts, alas this is the path I chose. I would like to see it through. I think I have to get a new DAC.
@JohnLincoln did you use a MCP4725 DAC to verify that code works? How new is the DAC. I am finding that the older my DAC is the less it functions. When I say old its been a few months since I used it last.
If you are inadvertently stressing the part in some way, that might make it slowly go bad. More common is works -> doesn't work due to some mishap like applying voltage in reverse or in excess of chip limits.
Obvsly in your current circumstances the thing to do would be trying a new copy of the chip. You might take a look to see if there is indeed something about your circuit or how you are talking to it or powering it that creates this wearing out kinda process.