how to make simplest pulse generator that is controlled by laptop

Discussion in 'General Electronics Chat' started by JJoll, Dec 15, 2015.

  1. JJoll

    Thread Starter Member

    May 7, 2013

    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:

    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.

  2. spinnaker

    AAC Fanatic!

    Oct 29, 2009
    This will be a far from "simple" project. You will most likely need a mcu. Is that in your skillset?
  3. MikeML

    AAC Fanatic!

    Oct 2, 2009
    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:

    Last edited: Dec 15, 2015
  4. Brownout

    Well-Known Member

    Jan 10, 2012
    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.
  5. cmartinez

    AAC Fanatic!

    Jan 17, 2007
    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.
  6. wayneh


    Sep 9, 2010
    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.
  7. AnalogKid

    AAC Fanatic!

    Aug 1, 2013
    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?

  8. crutschow


    Mar 14, 2008
    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.
  9. MikeML

    AAC Fanatic!

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


    Nov 24, 2012
    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.
  11. GopherT

    AAC Fanatic!

    Nov 23, 2012

    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: Dec 16, 2015
  12. spinnaker

    AAC Fanatic!

    Oct 29, 2009

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

    AAC Fanatic!

    Nov 23, 2012
    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.