Go Down

Topic: How to generate square wave pulses >5V? (Read 2844 times) previous topic - next topic

Cloverleaf

I'm trying to use an arduino Uno to replace an older piece of equipment--a Grass SS88 square pulse generator.  I don't need to reproduce the broad range of function, just a particular set.  Specifically, I need to generate square wave pulses in a range of 1-10V, duration from 0.1-10 ms, and at a frequency up to 200 Hz.

I'm not experienced with electronics, but I've found a few ideas to start from.  Particularly, using a relay to open/close a circuit at the desired voltage; however, I'm not sure of the relay's response time.  I've also seen TRIACs mentioned, though I'm not clear how to use them.

In addition to controlling the open/closed state of the circuit, I'm looking for a way to reliably control the voltage on a 0.1-10ms time frame.  I've seen diagrams that combine a capacitor and resistor to produce a low-pass filter that, combined with PWM duty time, can serve as a sort of analog control for voltage but the ramp up time is relatively long compared with the ideal pulse duration.  Currently I'm set up with a 12V wall mart adapter plugged into a voltage regulator to bring the voltage down to 9V.  If fine-tune control over the voltage from 1-10V is complicated, I could instead use a fixed voltage of 7V (the range of 1-10V is merely to extend the flexibility of the device to projects which haven't been thought of yet and not a necessity).

Thanks for your time.  Let me know if there are any bits of information missing, I'm afraid I'm too new to the electronics side of this to know if I've left anything out.

Magician

Start from the theory: http://www.electronics-tutorials.ws/transistor/tran_4.html
To generate different freq. with 50% duty cycle you can use Tone: http://arduino.cc/en/Reference/HomePage
To generate pulses, with variable duration, same freq. use analogWrite on PWM pin,
and to mix both , freq. and duty cycles, look into library with TIMER's: http://arduino.cc/en/Reference/Libraries

MarkT

Are the pulses to be positive only (0V to 10V range) or do you want bipolar pulses (-5V..+5V)?  How much output current does it need to supply?

I'd suggest an opamp-circuit to amplify the Arduino logic output using a potentiometer to vary the gain.
[ I won't respond to messages, use the forum please ]

Cloverleaf

Thanks  for the reading. I'm working my way through it.

The voltage needs to be positive +0 to +10.  The current I'm not sure of, but probably in the 100 milliamperes range. I'll do some reading about op-amps. I saw one in a diagram for a square pulse generator so I think you're on to something.

Thanks

PiJoy


I'm trying to use an arduino Uno to replace an older piece of equipment--a Grass SS88 square pulse generator.  I don't need to reproduce the broad range of function, just a particular set.  Specifically, I need to generate square wave pulses in a range of 1-10V, duration from 0.1-10 ms, and at a frequency up to 200 Hz.

I'm not experienced with electronics, but I've found a few ideas to start from.  Particularly, using a relay to open/close a circuit at the desired voltage; however, I'm not sure of the relay's response time.  I've also seen TRIACs mentioned, though I'm not clear how to use them.

In addition to controlling the open/closed state of the circuit, I'm looking for a way to reliably control the voltage on a 0.1-10ms time frame.  I've seen diagrams that combine a capacitor and resistor to produce a low-pass filter that, combined with PWM duty time, can serve as a sort of analog control for voltage but the ramp up time is relatively long compared with the ideal pulse duration.  Currently I'm set up with a 12V wall mart adapter plugged into a voltage regulator to bring the voltage down to 9V.  If fine-tune control over the voltage from 1-10V is complicated, I could instead use a fixed voltage of 7V (the range of 1-10V is merely to extend the flexibility of the device to projects which haven't been thought of yet and not a necessity).

Thanks for your time.  Let me know if there are any bits of information missing, I'm afraid I'm too new to the electronics side of this to know if I've left anything out.


@Cloverleaf,

If what you need is just digital pulses, it's pretty simple.  If I recall correctly, most Grass devices give you a modest (tens of mA) "courtesy power supply (? +12V or so) that you can tap off from.  Simple open-collector drives (ULN2803) is available in a through-hole package (perfect for protoboarding) and would probably do fine, up to tens of mA.  But a TIP121, with an input resistor and (for safety) a diode to protect from reverse-voltage transients from any inductance lurking can really sink some serious current (Amps, if properly heat sunk.  For analog (variable) voltages, an OpAmp is your friend, and can source or sink at least 5 mA without letting the magic smoke out; add a push-pull pair after the OpAmp if you need more current.  If you don't need to control 120 VAC, you can  get away without the hassle of Triacs.

Hope this helps!


CrossRoads

#5
Jul 16, 2012, 07:25 am Last Edit: Jul 16, 2012, 07:27 am by CrossRoads Reason: 1
If you just need the one output, than an arduino output pin driving an NPN transistor such as 2N2222A with 1K pullup to 10V on the collector is all you need.
If you need several outputs, than ULN2003 or ULN2803 is really convenient for bundling several transistors into one package.
Designing & building electrical circuits for over 25 years.  Screw Shield for Mega/Due/Uno,  Bobuino with ATMega1284P, & other '328P & '1284P creations & offerings at  my website.

Cloverleaf

The 2N2222A with 1K pullup on the collector seems to reproduce what I need on the oscilloscope; however, the output is in the is only in the 5V.  I assume that is because I have the collector attached to the 5V source on the arduino.  If I change this to a 12V source from a wall mart style 12V DC plug I assume I'll have access to a range up about 12V, which I'll adjust manually using a potentiostat.  I think this is my solution.  Thanks for the help!

CrossRoads

"I assume that is because I have the collector attached to the 5V source on the arduino. "
What?
No, you should have the collector connected to one end of the pullup resistor, and the other end connected to the voltage you are pulling up to, such as 12V.
You can replace the pullup resistor with a pot, or with 2 fixed resistors, to make a 10V reference.

Designing & building electrical circuits for over 25 years.  Screw Shield for Mega/Due/Uno,  Bobuino with ATMega1284P, & other '328P & '1284P creations & offerings at  my website.

Go Up