What can Arduino MICRO input pins be used for?

Can the Arduino MICRO input pin, be used as a Voltage Follower?

The 1st Voltage Follower is connected to a variable voltage.
The 2nd Follower input, is exactly half the voltage of first.

My guess is Arduino inputs could not substitute for op-amp!

Also, can community suggest any books or info on the programing!
Has it got much similarity to basic?

Your circuit diagram does not make much sense to me, at least not without any load that unloads the caps. The feedback from the + output tends to make it quite unstable.

You'll need a 5V 20A supply to power the circuit.

Input pins are for input only, not for output. You can use the ADC and analogRead() to read the divided input voltage and the voltages on the caps, then output the required voltage to the TIP bases using PWM or DACs.

The capacitors are part of an experiment, work in progress.
I do have concerns about power segregation, and feedback from Capacitor Bank +.
This was drawn up initially to graphically represent the basic logic

After looking at a few related posts, I was pretty certain Arduino inputs could not substitute for op-amp.

I thought the Arduino might be able to act like a Half Bridge from a logical prospective!
New to Arduino, would you mind telling me a bit more to help.

ADC and analogRead()
It Reads the value from the specified analog pin.
Quote: to read the divided input voltage and the voltages on the caps.

How accurate is a Arduino analog pin?
What is your thinking in reading the Cap as well? (You are probably ahead of me)

Do you also refer to DACs function through Arduino?

This could be a tidy solution.
Appreciate any help with the basics.

It seems strange to want to use a £20/$20 complex digital device to try and emulate a £0.50/$0.50 analogue IC.

An opamp does not more than output vOut = (in+ - in-)*amplification, with vOut clipped to the operating voltage. This is what an Arduino can do as well. If you attach a H-Bridge, and assume infinite amplification, the bridge can be off (in+ = in-), source (in+ > in-) or sink (in+ < in-). Or from your circuit diagram, the attached TIP can only be turned on (source) and off, it cannot sink current.

If you want to use the Micro, look up its features in the data sheet. AFAIK the ADC has 10 bit resolution.

DrDiettrich:
An opamp does not more than output vOut = (in+ - in-)*amplification, with vOut clipped to the operating voltage. This is what an Arduino can do as well. If you attach a H-Bridge, and assume infinite amplification, the bridge can be off (in+ = in-), source (in+ > in-) or sink (in+ < in-). Or from your circuit diagram, the attached TIP can only be turned on (source) and off, it cannot sink current.

If you want to use the Micro, look up its features in the data sheet. AFAIK the ADC has 10 bit resolution.

In the case of 1st op-amp it is operating off 5v and with follow voltage up to 3.529v.
The op-amps are being used as voltage followers, and are doing no more then volts out = volts in.
Basically, yes.

This is what an Arduino can do as well.
So are you saying there is no difference between the op-amp and Arduino in this application.
Good to know!

Quote: the attached TIP can only be turned on (source) and off, it cannot sink current.
Yes, the 2 TIP100 charge the Capacitor.

Quote: AFAIK the ADC has 10 bit resolution.
Is that a no?

I only mentioned H-Bridge because it has the same logic function as op-amps.
Please ignore any posters trying to insist I use H-bridge,or demanding answers.

=

So The Arduino can perform PWM and has suitable input pins.
Seems like it should be able to do follower and drive switches for series Capacitor Charger.

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.

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