Flashing LED via usb. or something else.

Discussion in 'The Projects Forum' started by Mitchpope93, Nov 20, 2013.

  1. Mitchpope93

    Thread Starter New Member

    Nov 20, 2013
    5
    0
    I'm not really sure where to start with this, but in the end I's like an LED strobe where I can control how fast is flashes precisely (for example 2.76khz). My Ideas so far is you have an LED hooked up to my laptop via usb with a simple program to control the speed and how many times it flashes. Right now I've got LED's and usb's and 100ohm resisters if i need them. From what I've read I don't think I can control the usb port's power so I'm assuming I need a driver board or something? I'd love some help with this but I assume I've been too vague, mostly because I'm not sure what i'm talking about. Any help I can get would be amazing. Thanks
     
  2. mcgyvr

    AAC Fanatic!

    Oct 15, 2009
    4,769
    969
    Why attached to a computer?
    What is the purpose of this blinky led?
     
  3. BobTPH

    Active Member

    Jun 5, 2013
    782
    114
    And you do realize that an LED flashing at 2.76KHz will look like it is always on?

    Bob
     
  4. wayneh

    Expert

    Sep 9, 2010
    12,100
    3,034
    I have a data acquisition device - a LabJack - that could do this easily. It runs off USB power and provides a number of outputs in addition to the inputs. Huge overkill to flash an LED, but it would give you full control.
     
  5. Mitchpope93

    Thread Starter New Member

    Nov 20, 2013
    5
    0
    I Wanted to attach it to a computer because I thought that would be the easiest way to control the speed precisely. The purpose of this little blink thing is for some shlieren photography i'm going to try out, and I need the led to flash in at the same rate at a 2.76KHz sound wave. This labjack thing sounds interesting but they look expensive :/
     
  6. wayneh

    Expert

    Sep 9, 2010
    12,100
    3,034
    If all you need is an LED to flash in synch with an audio signal, you don't need a computer or anything very complicated.

    Tell us more about the details. Is the desired frequency always near that value, and is it a "pure" tone (not a mixture of many frequencies)? How much LED power do you need? Any power supply ideas?
     
  7. Mitchpope93

    Thread Starter New Member

    Nov 20, 2013
    5
    0
    The desired frequency will be somewhere between 2.5KHz and 4KHz, maybe up to 5KHz but essentially it will always be in sync with the audio which will be a pure tone. I'm also wanting to make it so i could offset the LED bit by bit. If I don't need to hook this up to a computer then that's great
     
  8. wayneh

    Expert

    Sep 9, 2010
    12,100
    3,034
    Well a phase shift is a bit out of my league but I'm sure someone here will show us. For a simple in-phase flashing, I would send the audio signal into a comparator. This would turn on and off, switching state with the amplitude of the wave. The comparator output would switch a MOSFET and thereby control just about any sort of load you want, e.g. a string of LEDs.
     
  9. Mitchpope93

    Thread Starter New Member

    Nov 20, 2013
    5
    0
    I've never heard of a comparator but now I have and yes I think that will do exactly what I need! Thanks! I was just wondering what comparator would you recommend? I don't want to get the wrong type or anything.
     
  10. wayneh

    Expert

    Sep 9, 2010
    12,100
    3,034
    The LM339 is 4 comparators in one package, and is widely available. You may not think you need all 4 but once you learn how to use them, they're handy for all sorts of things like detecting connections, indicating power on, and so forth.

    The biggest mistake noobs miss is that the output of the comparator can pull itself low (to sink ~5mA of current, enough to light an LED), but it must be pulled up with an external resistor. It cannot drive an external transistor, for instance, on its own - it needs that pull-up resistor.
     
Loading...