how to make simplest pulse generator that is controlled by laptop

Thread Starter

JJoll

Joined May 7, 2013
49
Hi,

I need to make a pulse generator so that whenever it is called, it has to produce one pulse of 150ms. I need to control this pulse generator with a laptop, because I am automating a system of circuits and I need to trigger one specific circuit by sending a 150ms pulse to it. How can I approach this? Any suggestions? I was thinking of using a 555 pulse generating circuit, something like this: http://www.electroschematics.com/5834/pulse-generator-with-555/

But this seems a little bit of overkill. I just need to send only 1 pulse. I am currently writing the code to control connect and integrate my system with some devices using a GPIB-USB adaptor and any recommendation on the pulse generating circuit and way of connecting it to a laptop would be greatly appreciated.

Thanks
 

MikeML

Joined Oct 2, 2009
5,444
The big problem with modern laptops is that they lack parallel or serial ports of old... With those, this was easy.

A USB to Serial Port Dongle can be used by toggling one of the control pins, like DTR. This gives you a signal you can control via any programming environment.

I assume you want the PC program to determine when you want the pulse. You need the external timer to determine how long the pulse is, once triggered.

Either the rising-edge or the falling-edge of DTR can be used to trigger your timer. I would add an opto-isolator between the DTR signal and your circuitry, to protect the laptop. Use a real power supply instead of trying to power your circuit via the USB from the laptop...

Try this:

163.gif
 
Last edited:

Brownout

Joined Jan 10, 2012
2,390
Hi
But this seems a little bit of overkill.
It is, as this is a free-running pulse gen (astable mulitvibrator) What you want is a one-shot or monostable multivibrator. Also can be made with a 555. There are lost of schematics available via google. Trigger from your computer using a USB-to-Serial adapter as described above. Or, you can use a USB to parallel (FTDI) adapter and trigger your one-shot by directly writing the IO register.
 

cmartinez

Joined Jan 17, 2007
8,219
Yup... I'd definitely go with an MCU too. I can show you how to do it with an AT89LP4052 (or 8051), and a simple MAX232 driver.
You'd need a USB to RS232 adapter, though. Which btw are not expensive and easy to come by.
 

wayneh

Joined Sep 9, 2010
17,496
In the category of overkill, you could also use data acquisition hardware - connected to your computer via USB - to accomplish this. Such hardware could also take over a lot of your automation chores. I like the LabJack devices but Dataq is another choice. $50-120 or so, depending on which model.
 

AnalogKid

Joined Aug 1, 2013
10,986
Couldn't the USB to Serial Port Dongle that Mike talks about in post #3 drive the output signal directly? If you can turn DTR on and off to trigger a 555, why not turn it on and off with a 150 ms software time and ship it out?

ak
 

crutschow

Joined Mar 14, 2008
34,283
If the 150ms time is not particularly critical then AK's approach should work.
But a USB to parallel adapter might allow easier control of the time period of the pulse.
 

MikeML

Joined Oct 2, 2009
5,444
When I tried to time events from a Visual Basic program running in Windoz, it seems I could get about +- 10ms...
 

BReeves

Joined Nov 24, 2012
410
I wrote a C++ Windows program that does what you need to test trigger a thrill ride photo system. Used the parallel port as a poor mans DIO interface and a 3rd party game timer library for accuracy. You can find older laptops with a parallel port on eBay for less that what a DIO adaptor would cost. The Parallel port will give you a 5 volt pulse which could be used to do almost anything with a few added components. The app isn't very large and I wouldn't mind sending it to you if interested.

Just keep in mind it is a test app with no documentation and will require Windows XP or the 32bit version of Windows 7.
 

GopherT

Joined Nov 23, 2012
8,009
@JJoll

You could go low tech as well, depending how accurate your timing requirement is.

You could program a black screen on your laptop and have it flash white for 150 mSec. Then build a simple phototransistor trigger circuit. Place the phototransistor in front of your screen and poof, done. No risk of a bad circuit design or execution blowing out a USB port and all is done. .
 
Last edited:

spinnaker

Joined Oct 29, 2009
7,830
@JJoll

You could go low tech as well, depending how accurate your timing requirement is.

You could program a black screen on your laptop and have it flash white for 150 mSec. Then build a simple phototransistor trigger circuit. Place the phototransistor in front of your screen and poof, done. No risk of a bad circuit design or execution blowing out a USB port and all is done. .

Hey Rube, can't you do better? Maybe add a golf ball and a toy airplane into the mix??? :)
 

GopherT

Joined Nov 23, 2012
8,009
Hey Rube, can't you do better? Maybe add a golf ball and a toy airplane into the mix??? :)
Piss off man! My answer is easier than any of the others. The rest all required copper wire and connectors. Even a suggestion of finding an old PC with a parallel port.

On the other hand, a glass ball and a spiral wire track could make this fun...

Never mind, no way to interface the hamster wheel to the trigger circuit.

 
Top