Hey guys,

I'd like to use Arduino to output automatically a voltage from -500 mV to 500 mV with each step of 25 mV, which means exactly -500 mV, -475 mV, -450 mV... . The output rate is 1 Hz. Are there any advices? Thanks a lot!

Hey guys,

I'd like to use Arduino to output automatically a voltage from -500 mV to 500 mV with each step of 25 mV, which means exactly -500 mV, -475 mV, -450 mV... . The output rate is 1 Hz. Are there any advices? Thanks a lot!

Depending on your requirements, you can then feed a opamp to get ± outputs

.

rayxiaoyi: I'd like to use Arduino to output automatically a voltage from -500 mV to 500 mV with each step of 25 mV, which means exactly -500 mV, -475 mV, -450 mV... . The output rate is 1 Hz. Are there any advices?

The answer depends on what you want to do with that voltage, and how much current is needed. e.g. if this is used for electrodes, can the other electrode be connected to a positive voltage. That would eliminate the need for a negative voltage and opamps. Leo..

Wawa: The answer depends on what you want to do with that voltage, and how much current is needed. e.g. if this is used for electrodes, can the other electrode be connected to a positive voltage. That would eliminate the need for a negative voltage and opamps. Leo..

Yes it is used for electrodes. Could you please explain in details? And how can I output the step with exactly 25 mV, since the PWM has only 8 bits, which means the step is about 19.5 mV? Thanks..

since the PWM has only 8 bits, which means the step is about 19.5 m

That's only true if you assume 256 steps and 5 volts.

The T1 timer hardware allows for 16 bit PWM resolution, at the cost of some low level coding.

The step voltage is easy to control. When you need 40 steps over the entire output voltage range, the PWM duty cycle can be varied between 0 and 40% by 1%. 6 bit are sufficient for that many steps.

But PWM requires a low pass filter, i.e. you cannot step really quickly. Do you really need discrete steps with fast rise time?

For 1kHz steps a real DAC were the simplest and most precise solution. Additional electronic is mostly required, to map the analog output into the desired voltage range. And how much current is required by the electrodes?

A voltage divider with equal resistors between 5volt and ground makes 2.5volt. That fixed voltage can be connected to one electrode. Buffered with an opamp if current is needed.

The voltage on the second electrode can come from a smoothed, buffered PWM signal. 2.525mV or 2.475mV from that opamp is + or - 25mV between electrodes.

Same thing can be done with two D/A outputs (external D/A). With one electrode connected to one D/A, and the other one to the other D/A, an AC signal or differential voltage can be generated between electrodes.

Three resistors can reduce the output voltage of the D/A to the desired +/-500mV. One from D/A#1 to one electrode, another one from the second D/A to the second electrode, and one between electrodes. Now you will have more voltage steps to work with over the +/-500mV range, but with reduced current control. Leo..