high-frequency, modulated square wave generator?

Hi all,

I'm trying to make a function generator controlled by arduino, but I'm afraid I'm too much of an electronics novice to know whether the specifications will be up to standards. I've found several on Google, but the specifications that come along with them aren't specific enough to tell me if they'll work for my purposes.

Here's what I'd like: a DC (+12V)-powered device that emits short square waves (0.2 milliseconds) with larger spaces (3 milliseconds) between pulses. Though it will be powered off of a +12V source, I'd like to be able to adjust the pulse voltage, the duration of the pulse, and the duration between pulses (or, say, number of pulses emitted per second). I'd also like to be able to input when to start the train of spikes and when to stop.

I know some, probably most of this will be controlled by the code that I load into the Arduino, which is fine, but if I could have knobs that adjust those things manually, that might be even better.

Can anyone help out a newcomer with how to get started building such a thing?

Thanks so much.

--Nick

You could do all that with arduino, read pot values from analog inputs to adjust all but the pulse voltage, you'll have to do that externally - 0/5V by dividing down with a pot, higher by other means.
For more precision, use rotary encoder instead for finer adjust of widths, frequency, duration, etc.

Use blink without delay style programming, with micros() for timing, 0.2mS = 200uS.

Thanks so much for the input, CrossRoads!

So, I think I've got a schematic forming. Please let me know what you think.

I'll use a TIP120 Power Darlington Transistor (TIP120 Power Darlington Transistors - 3 pack : ID 976 : $2.50 : Adafruit Industries, Unique & fun DIY electronics and kits) and hook it up like this:
http://bildr.org/2011/03/high-power-control-with-arduino-and-tip120/

That way, whenever the arduino sends a high signal to the base, the output (in the example above, it is a motor) will spike.

Do you think that this resistor will be able to open/close within 50uS or so? I does not need to be any more precise than that.

If that transistor will be quick enough, what will the limiting factor on speed be? The Arduino itself?

Thanks so much.

--Nick

If you intend to use external components with the Arduino, it is always a good idea to download the data sheet for the device and keep a copy for your records. All the important safety information, lead identification and essential performance characteristics are to be found there. For the TIP120, switching time is about 1 microsecond. See http://www.onsemi.com/pub_link/Collateral/TIP120-D.PDF

OK, great. I've got most all the things on order that I think I'll need, except for regulating the power supply.

I know I can regulate the +12V with a couple of resistors if I use something like this: Voltage Regulator - Adjustable - COM-00527 - SparkFun Electronics), but I'd like to do it with a pot. However, at that point, I'm stuck -- how do I take the resistance from a pot and use it to regulate voltage?

Thanks so much!

--Nick

Again, consult the data sheet. A schematic diagram for a variable voltage regulator using a pot is presented.
http://www.fairchildsemi.com/ds/LM/LM317.pdf

I have a similar project in mind, but I'd like to be able to control the current of the square wave up to a maximum of 120 mA and on a 2000 Ohms load; the power supply would be a 7.2 V battery. I believe there must be some device in the middle that elevates the voltage intermittently, given the nature of of the pulsed square wave. I've been searching around for devices that can do off-the-shelf or with minimal modifications, and that can be driven by an Arduino. Any suggestion for where to look?

gidmark:
Do you think that this resistor will be able to open/close within 50uS or so? I does not need to be any more precise than that.

transistor? Yes, nothing is that slow in the electronics world... You might expect a couple of
microseconds turn off worst case for a darlington, but turn on will be quicker.