0

I am trying to find the simplest off-the-shelf way to control a single LED from a PC.

This will be used to illuminate a sample in a lab under control of a human via a GUI. So there are no serious timing constraints.

I want the LED to emit continuously, so a device that does PWM is not suitable. Brightness will be taken care of by selecting an appropriate LED; there is no need to be able to change the intensity.

The solution needs to be robust; cost is not really a factor; and an off-the-shelf solution is preferred. I know this is trivial to do using a Raspberry Pi or an Arduino, but I'd rather just order something that works than tinker.

Ideally, this would be controlled as a serial device that I can send ON and OFF commands to, so I can control it from a normal desktop PC from user space.

It's an embarrassingly simple problem, but the best solution so far that does not involve tinkering seems to be a low-end programmable current source. I would appreciate to hear about simpler off-the shelf solutions.

reddish
  • 101
  • 1
  • Welcome to EE.SE but please note that direct shopping questions will result in fairly prompt closure of your question as per [site rules](https://electronics.stackexchange.com/help/on-topic). To save your question you need to remove the shopping elements. – Transistor Aug 19 '21 at 05:55
  • So you just want an on/off current source? What is the current? – jonk Aug 19 '21 at 06:01
  • It's for a standard LED, so ~ 20 mA I guess. – reddish Aug 19 '21 at 06:04
  • @Transistor: I don't think this is purely a shopping question. I am looking for a type of device with certain requirements. If people can point to example products I think that should be okay; much like people would point me specifically to a Raspberry or Arduino if I hadn't specified them as solutions to avoid. – reddish Aug 19 '21 at 06:06
  • 1
    @reddish Since this is from a PC, I would gather from that you would be looking for a USB connection. Perhaps communicating using a virtual COM port driver? Also, [look here](https://electronics.stackexchange.com/a/481317/38098). – jonk Aug 19 '21 at 06:09
  • You want a serial device, meaning a COM port showing in the OS? Which OS is th PC running, which OSes you want supported? Is an USB serial port using CDC class OK, or is USB chip driver installation allowed, or does the PC already have an RS-232 port? – Justme Aug 19 '21 at 06:42
  • 2
    considering you can shove your led into an arduino's female headers, I don't think it gets any more turn-key. You could even use a parallel port with no other hardware... – dandavis Aug 19 '21 at 07:19
  • You can buy USB controlled relays for 3 or 4 dollars on Amazon/eBay. There are open source projects on GitHub for controlling them. – user1850479 Aug 19 '21 at 14:54

3 Answers3

3

You can buy ready-made USB to GPIO boards, e.g. from USBMicro. These may be able to drive an LED directly at low power, or more current through a transistor.

Simon B
  • 18,609
  • 1
  • 29
  • 55
  • 1
    I had no idea these existed off the shelf. It beats the arduino for simplicity of I/O, and with 50mA per I/O pin! – Simon Fitch Aug 19 '21 at 10:45
1

A USB to IO converter like MCP2210:https://www.microchip.com/en-us/product/MCP2210 It has a sample program that you can run without any coding. Or you can control it using LabVIEW or anything you like. There is a eva board with mini-USB here:https://canada.newark.com/microchip/adm00419/mcp2210-usb-to-spi-breakout-module/dp/82T8759?st=mcp2210 I used this chip a lot as USB to SPI bridge or USB to GPIO expander.

1

It may be possible to power off a USB port programmatically, which could be an easy way to control the lamp.

That did not work for me when I tried it once, but you may have better luck with your hardware / OS combination.

DamienD
  • 3,093
  • 1
  • 14
  • 23