Hardware parts used in the project (I already own):
- Arduino Uno
- Adafruit MCP4725 12-Bit DAC: [login to view URL] used like in the following tutorial: [login to view URL]
- Adafruit INA219 Current Sensor Breakout: [login to view URL]
- Resistor for ohm-meter: [login to view URL]
- Display 16x2
Software part (your job):
Basic demo code is already available on the websites provided above. I'm looking for someone who would create automatic output voltage regulation from Adafruit MCP4725 (0 to 10 V) based on the input parameters from Adafruit INA219. The logic is similar like battery charging+checking process: apply voltage and then periodically measure voltage/current/resistance of the battery. MCP4725 output should be turned off while measuring with INA219 because input and output terminals are common and if they would work simultaneously, INA219 would just measure the output voltage of MCP4725, while we actually need to measure our target.
To put it in other words, flowchart looks like this:
1. Measure voltage/current with INA219 + resistance (I can add transistors or relays into circuit if needed for all 3 measurements)
2. Turn off measurement and apply voltage with MCP4725 based on the previous input measurements from INA219
3. After X amount of time, temporarily disable MCP4725, wait Y amount of time, repeat measurement and apply the corresponding voltage with MCP4725 again.
The output voltage on MCP4725 should be adjustable in defined, custom value ranges, e.g. when measured input voltage is between 1.20-1.49 V, output voltage is 3 V; when input voltage is between 1.50-1.79 V, output voltage is 3.5 V etc. It should also be possible to adjust the output voltage on MCP4725 based on the input current, resistance or a combination of all 3 (input voltage, current and resistance).
Any suggestions are greatly appreciated.