What can Arduino MICRO input pins be used for?

The language has similarities to basic,
what is available in books or code for Arduino.

analogRead(pin)integer values range from 0 to 1023
analogWrite(pin,value) range from 0 to 255

So:
0 to 5v
Write limit = 256
5/256= 0.01953125v resolution

It can do what the op-amp does within limited resolution.

I understand the PWM output spending more time high for increasing voltage.
Is their an example code for Arduino input and output used as follower?
Any tricks to getting more resolution.

6 PWM outputs adds versatility
Still, Arduino is of interest!

DrDiettrich:
A digital solution can only work in discrete time steps. This delayed response may lead to overshooting output voltage or instabilities, unless taken into account in the regulator model.

You decide whether 10 bit ADC resolution is sufficient.

I'm not sure whether the lower opamp can do what it should in your circuit. The load draws the same current from both caps, and the upper opamp pushes the same current through both caps. If the capacities are the same, both caps will have the same voltage. So what's the effect of the lower opamp? It only can increase the voltage of the lower cap, so that it will have almost always a higher voltage than the upper cap has. If the lower opamp should compensate slightly different capacities or self-discharge of the caps, it must have push-pull capability.

You are right, I will need to fix that:

So:
0 to 5v
Write limit = 256
5/256= 0.01953125v resolution

But understand that the analogue write only produces PWM and not an analogue signal. See http://www.thebox.myzen.co.uk/Tutorial/PWM.html

Is their an example code for Arduino input and output used as follower?

 analogWrite(outPin,analogRead(inPin) >>4);

A voltage follower can be programmed like this:

 int vSet = analogRead(vInPin); //or use any other source for the setting
 int vDiff = vSet - analogRead(vFeedbackPin);
 analogWrite(vOutPin, (vDiff+offset)*amplification); //chose proper offset and amplification

According to your circuit you'd connect vSetPin to the voltage divider (+in), vOutPin to the TIP base, and vFeedbackPin (-in) to the cap.

Grumpy_Mike:
But understand that the analogue write only produces PWM and not an analogue signal. See http://www.thebox.myzen.co.uk/Tutorial/PWM.html

 analogWrite(outPin,analogRead(inPin) >>4);

In which case I would need a H-bridge to reproduce the input voltage.
I wanted to learn a bit about Arduino, will buy the Arduino MICRO.

The Arduino is not really much good compared to op-amp for this task.
But the power to create PLC circuits on the PC is game changing for me.

DrDiettrich:
A voltage follower can be programmed like this:

 int vSet = analogRead(vInPin); //or use any other source for the setting

int vDiff = vSet - analogRead(vFeedbackPin);
analogWrite(vOutPin, (vDiff+offset)*amplification); //chose proper offset and amplification



According to your circuit you'd connect vSetPin to the voltage divider (+in), vOutPin to the TIP base, and vFeedbackPin (-in) to the cap.

I missed part of your post, are you saying the PWM output of Arduino would hold the Darlington, effectivly at the input voltage or analogRead.

In which case I would need a H-bridge to reproduce the input voltage.

No.

The analogue input can't read negative voltages. You have to bias it at 2.5V, so that bias is carried over when you do the read / write.

While the Darlington is continuously turned on and off by the PWM signal, the RC low pass filter will result in a minor ripple of the voltage on the cap. With a H-bridge output the bridge should be turned off when the voltage difference becomes lower than some arbitrary amount, depending e.g. on the ADC resolution.

In the given circuit, with a 5V supply, no negative voltages can occur.

DrDiettrich:
While the Darlington is continuously turned on and off by the PWM signal, the RC low pass filter will result in a minor ripple of the voltage on the cap. With a H-bridge output the bridge should be turned off when the voltage difference becomes lower than some arbitrary amount, depending e.g. on the ADC resolution.

In the given circuit, with a 5V supply, no negative voltages can occur.

Changed the output circuit to match logic

Thinking I would need an Arduino input and output for top Voltage follower,
And a second Arduino PWM output with the same reference and half the on-time.
Hope I am keeping up, their is a lot to learn.

I do not have a good understanding of H-Bridge.
When you say switch off, do you mean less on time.
Or is this a feature of H-bridge isolation when voltage is reached.

I am a slow learner, but everything sinks in with time.

Don't forget the feedback. You need at least a digital P controller, eventually a PID controller.

In a H-bridge one or none transistor can be on at a time. In TTL terms it has a tri-state output.

DrDiettrich:
Don't forget the feedback. You need at least a digital P controller, eventually a PID controller.

Sorry, you lost me here with feedback and needing digital P controller, eventually a PID controller.
I searched for P controller and only found PID controller, what do you mean.
Are you referring to Arduino code to test the output against input?

I was thinking analogRead and analogWrite covered requirements

Reading: https://www.pdx.edu/nanogroup/sites/www.pdx.edu.nanogroup/files/2013_Arduino%20PID%20Lab_0.pdf

The input voltage from divider is the variable set point.
Only user adjustment feature, to be set once before tests,
increments up to 100 millivolt gain adjustment to the first followers output voltage.
The logic has to follow through as with the circuit logic with op-amps

It might be the right time now, to make your hands dirty, and to come back with more specific questions.

I posted before seeing your reply, this might include additional questions?
Not sure if I have understood what you were explaining

A voltage follower requires feedback from the driven circuit, and thus is a controller, regardless of analog or digital implementation. It can be implemented as simple as in #10 (Proportional controller), or as a full fledged PID controller.

DrDiettrich:
A voltage follower requires feedback from the driven circuit, and thus is a controller, regardless of analog or digital implementation. It can be implemented as simple as in #10 (Proportional controller), or as a full fledged PID controller.

I have enough information to know Arduino can cover the task.
The programming seems to be Basic with different words, no problems.

Here is a tool: RC Low-pass Filter Design for PWM.
http://sim.okawa-denshi.jp/en/PWMtool.php

Arduino Micro Board with Headers $33.86 including freight
https://www.freeshippingtech.com.au/product/SEVARD0005/Arduino-Micro-Board-with-Headers

Just to confirm, this and a standard USB chord is all that's required?

The board can be powered by USB.

Grumpy_Mike:
No.

The analogue input can't read negative voltages. You have to bias it at 2.5V, so that bias is carried over when you do the read / write.

I would like to know how you are getting the 2.5v bias?
Because I am having some hiccups in design and looking for the simple alternatives!


My idea at present is to Multiply the divider voltage by 4 through resistor values.

Starting with the original baseline voltage division:
62.05v 132000/82500 ohm 3.65v
42.5v 132000/82500 ohm 2.5v

Lift Voltage divider output by factor of 4:
62.05v 132000/40600 ohm 14.6v
42.5v 132000/40600 ohm 10v

This widens the output voltage differential from 1.15v to 4.6v.

If I can supply 10v to the op-amps (-) input,
this should give an output of at 0v corresponding with the original 2.5v division,
And 4.6v corresponding with original 3.65v division.

Not sure how this would be done otherwise?

--

This would only just fit within the op-amps specs, with an increased supply voltage.
If I can create an accurate reference and it works, an extra voltage regulator is not a problem!

TL082 Dual JFET-input op-amps
Max Supply voltage 18
The magnitude of the input voltage must never exceed the magnitude of the supply voltage or 15 V, whichever is less.

Open to surgestions

I would like to know how you are getting the 2.5v bias?

By a 10K pull up and a 10K pull down on the analogue input, then you normally AC couple it, but I suspect you might not want to do that.

My solution at the moment is op-amp with adjustable reference.

using this logic:
Starting with the original baseline voltage division:
62.05v 132000/82500 ohm 3.65v
42.5v 132000/82500 ohm 2.5v

Lift Voltage divider output by factor of 4:
62.05v 132000/40600 ohm 14.6v
42.5v 132000/40600 ohm 10v


Numbers are just to show how adjustment widens variation voltage from 1.15v to 4.6v as example.

I am happy with this as a solution, but persisted a little longer thinking Arduino users would have come up with a low voltage solution to such situations?

It would seem not, or at least not with the same simplicity.

Thank you for the guidance.

I am happy with this as a solution

Good because I for one have no idea what this solution is. No schematic == no idea what you mean.

but persisted a little longer thinking Arduino users would have come up with a low voltage solution to such situations? It would seem not,

This is because what you are doing is so bazaar as to be verging on the insane, and no one who knew anything about electronics would even consider this. Wrong tools for the job. It is like having a dentist remove your teeth with a sledgehammer.