making the digital 0-5v a -12 +12v

Hi,

I coded a freqout program to make a square wave generator according to a certain pattern.
The digital output is of course 0/5v.

I'm building something similar to a TENS unit, the principle is the same, I need low currents and voltages of about -12 +12v, supplied by batteries (two 12v ?). It's important for this application to have negative and then positive voltages (eletrodes on each hand, so the current flows back and forth through the body).

Maybe I need an H-bridge ? Novice.

Thanks

Try to find a digital to analog converter. There are many on eBay, Mouser, Digikey,and even Radio Shack.

DAC is too vague :slight_smile:

Hi,

OK, you need an output voltage to swing from +12V to - 12V following a square wave from Arduino??

  • Use an RS232 chip that outputs +- 10 to 12 Volts and runs from +5V . They use a few capacitors and create the +- 12V This is a Chip like "MAX232"
    FutureLec has this: RS232 to TTL Converter Mini Board

  • OR use a PNP transistor with emitter connected to +12V and collector connected through a resistor (you said not much current) to -12V. Then controol that PNP base input by a 10K resistor and an NPN transistor driven by Arduino. IF you want to use separate +-12V Batteries

Interesting. What would happen if the load accidentally draws too much current from the RS323 ?
Would this burn the arduino ?

Thanks

(eletrodes on each hand, so the current flows back and forth through the body)...

...What would happen if the load accidentally draws too much current from the RS323 ?
Would this burn the arduino ?

No... The MAX232 will "protect" the Arduino. Whatever you put between the Arduino and the output should limit the current from the Arduino. If you want to protect the MAX232 (or whatever), put a 1K-10K resistor in series with the output(s).

Since the human body has meghoms of resistance, a couple of k-ohms in series shouldn't have any any affect on the output voltage/current unitl you accidently short the output terminals. Then the resistor will limit the current and protect your electronics.*

BTW - We use MAX232 chips on a lot of the boards where I work. They usually put-out +/- 9 to 10V. Some of them generate less than 9V. The only time I've seen 10V or more is when the '5V' power supply is turned-up to about 6V. I've never seen one "fried" by shorting the outputs, so I assume it's not too fragile. (Of course we don't intentionally short the outputs, so maybe it's just never happened...)

  • You might need to put some "protection diodes" (or Zeners) to protect your circuit from static discharge from the body.

robse:
electrodes on each hand, so the current flows back and forth through the body

The heart is in between there. I might avoid passing current through there.

DVDdoug:

(eletrodes on each hand, so the current flows back and forth through the body)...

...What would happen if the load accidentally draws too much current from the RS323 ?
Would this burn the arduino ?

No... The MAX232 will "protect" the Arduino. Whatever you put between the Arduino and the output should limit the current from the Arduino. If you want to protect the MAX232 (or whatever), put a 1K-10K resistor in series with the output(s).

A potentiometer is needed since I need to regulate the output current to not fry the user :slight_smile:

What are other ICs to achieve exactly -12/+12 instead of a MAX232 ?
I quickly saw the circuit i'm trying to replicate and I don't think this one was used