Controlling simple relay switch via USB

前端 未结 6 2124
死守一世寂寞
死守一世寂寞 2020-12-24 04:40

I\'m looking to control a mains powered light from a simple relay switch connected via USB to the computer.

The relay switch isn\'t even a USB device, it\'s just a s

6条回答
  •  北荒
    北荒 (楼主)
    2020-12-24 05:07

    You could do it by combining these two products from Pololu, for about $25:

    1. Micro Maestro (assembled)
    2. Basic SPDT Relay Carrier with 5VDC Relay (Assembled)

    The Maestro is mainly a servo controller but you can set any of its channels to be simple digital outputs instead. The output can be controlled from the Maestro Control Center software or you can write your own software. A digital output from a Maestro is suitable to turn on the relay on the relay carrier. The relay could be powered from USB through the Maestro; I think it draws about 100 mA of current so that probably will not be a problem for most USB ports, though it would not be USB-compliant because the total current drawn by the Maestro and the relay would be over 100 mA. You could supply your own power source for the relay if you are worried about that.

提交回复
热议问题