Results 1 to 8 of 8

Thread: LED Light Controlling on PC!

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Aug 2016
    Posts
    104

    LED Light Controlling on PC!

    Hi dears
    How can I control turning on/off my LED light connected to PC (by VB 6.0), I want to turn on/off automatically in different times.

    Name:  led.jpg
Views: 700
Size:  22.7 KB

  2. #2
    Smooth Moperator techgnome's Avatar
    Join Date
    May 2002
    Posts
    34,531

    Re: LED Light Controlling on PC!

    Looks like it's plugged into a USB port. So, you'd need to know what port it's plugged into and turn the power to it on/off.

    -tg
    * I don't respond to private (PM) requests for help. It's not conducive to the general learning of others.*
    * I also don't respond to friend requests. Save a few bits and don't bother. I'll just end up rejecting anyways.*
    * How to get EFFECTIVE help: The Hitchhiker's Guide to Getting Help at VBF - Removing eels from your hovercraft *
    * How to Use Parameters * Create Disconnected ADO Recordset Clones * Set your VB6 ActiveX Compatibility * Get rid of those pesky VB Line Numbers * I swear I saved my data, where'd it run off to??? *

  3. #3
    PowerPoster
    Join Date
    Feb 2006
    Posts
    24,482

    Re: LED Light Controlling on PC!

    This is probably a lost cause.

    Even though many hub chipsets support per port power switching most laptops are likely to have cheaped out to save on cost and space and omitted the outboard MOSFETs to do the actual switching, and instead hard wire ports to a 5v rail.

    Even when that isn't true, most newer laptops have newer hub chipsets designed to manage the use of ports for USB-sourced external device charging. As a result power management hardware and software probably has control, making it very difficult or impossible to switch the power on and off from an application.

  4. #4
    Addicted Member
    Join Date
    Aug 2017
    Location
    South Africa (in the middle)
    Posts
    160

    Re: LED Light Controlling on PC!

    Yep. It's a tricky one this. Have tried it some time ago and this is what I have found:

    Use a USB stick in the same usb port. Windows will pick it up and give it a drive letter.
    You can then eject the drive letter.

    BUT

    Plug a light in the same usb port, and windows does not give a drive letter as it's not a drive.
    ...it does not work. There must be another way to do it...

  5. #5

    Thread Starter
    Lively Member
    Join Date
    Aug 2016
    Posts
    104

    Re: LED Light Controlling on PC!

    Thank you for your trick ...

  6. #6
    PowerPoster CDRIVE's Avatar
    Join Date
    Jul 2007
    Posts
    2,620

    Re: LED Light Controlling on PC!

    Quote Originally Posted by Inside View Post
    Yep. It's a tricky one this. Have tried it some time ago and this is what I have found:

    Use a USB stick in the same usb port. Windows will pick it up and give it a drive letter.
    You can then eject the drive letter.

    BUT

    Plug a light in the same usb port, and windows does not give a drive letter as it's not a drive.
    ...it does not work. There must be another way to do it...
    That's because USB LED lights have no brains in them. There's no chip in those lamps that communicate with the PC. They're not a USB HID. The only circuitry in those lamps are the LED, and either an LM317 constant current source or just a simple series wired current limiting resistor. These components are connected to the USB +5V and Common pin. The data pins aren't connected to anything. As far as the PC's OS is concerned there's nothing plugged into the port the LED is using.

    All is not lost though. If you have elementary electronics skills you can use a USB/RS232 converter and control the LED using VB's MSCommControl. Most USB/RS232 converters employ the Prolific UART chipset. Prolific also offers a direct USB/TTL (CP2102) chip/module. Clones can be had on ebay for <$3.00.
    http://www.ebay.com/itm/130683943875
    With one of these puppies you could even write code in the MSCommControl to (PWM) the LED which would provide dimming control.

    On my electronics forum (ElectronicsPoint) we had a recent discussion on what keeps RS232 alive and well at this late date. Your LED project is a good example of why it's still popular. Same for embedded programming.

    Cheers!
    Chris
    <--- Did someone help you? Please rate their post. The little green squares make us feel really smart!
    If topic has been resolved, please pull down the Thread Tools & mark it Resolved.


    Is VB consuming your life, and is that a bad thing??

  7. #7
    Addicted Member
    Join Date
    Aug 2017
    Location
    South Africa (in the middle)
    Posts
    160

    Re: LED Light Controlling on PC!

    Quote Originally Posted by CDRIVE View Post
    All is not lost though. ...
    Chris
    Thanks.
    It's through these little pieces of info that let others grow their minds and ideas.

  8. #8

    Thread Starter
    Lively Member
    Join Date
    Aug 2016
    Posts
    104

    Re: LED Light Controlling on PC!

    Quote Originally Posted by CDRIVE View Post
    That's because USB LED lights have no brains in them. There's no chip in those lamps that communicate with the PC. They're not a USB HID. The only circuitry in those lamps are the LED, and either an LM317 constant current source or just a simple series wired current limiting resistor. These components are connected to the USB +5V and Common pin. The data pins aren't connected to anything. As far as the PC's OS is concerned there's nothing plugged into the port the LED is using.

    All is not lost though. If you have elementary electronics skills you can use a USB/RS232 converter and control the LED using VB's MSCommControl. Most USB/RS232 converters employ the Prolific UART chipset. Prolific also offers a direct USB/TTL (CP2102) chip/module. Clones can be had on ebay for <$3.00.
    http://www.ebay.com/itm/130683943875
    With one of these puppies you could even write code in the MSCommControl to (PWM) the LED which would provide dimming control.

    On my electronics forum (ElectronicsPoint) we had a recent discussion on what keeps RS232 alive and well at this late date. Your LED project is a good example of why it's still popular. Same for embedded programming.

    Cheers!
    Chris
    Thank you CDRIVE I got it . . .

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width