SainSmart USB 4 Channel Relay Automation (5V)
M**M
Great little device!! And Python-able! (see below)
I'm generally not big on writing online reviews, but I felt like I needed to share my experience (and maybe offer some small help to get folks started?). For myself, I was looking for a way to automate control of a fan and a hard drive via program or script (and hopefully in Python!). After some mild growing pains, this device proved extremely useful and super convenient!The device has an FTDI controller as a brain - these chips have been around for years and generally are auto-detected by Windows...mine came up as a "USB Serial Port", and for my purposes, that was all I needed. There *are* special FTD2XX drivers available online for Windows (and documentation available as well - just search "ftd2xx"), but I personally haven't had any need to install them.For Python, I used a publicly available module called "ftd2xx 1.0" (Google [ ftd2xx python ]).Unzip the package, find [ setup.py ], open a command prompt there, and run [ python setup.py install ].Now, there are many wonderful and glorious ways to control/ping the FTDI, all of which can be read in the FTD2XX documentation discussed above - but I *only* cared about turning the relays on and on off. So here's just a simplified example Python script that I used to get started (Amazon doesn't allow text formatting, apparently - please remove the [indent]s below and replace with actual indents ^_^):================================================import ftd2xx as ftimport timeON = TrueOFF = FalseRELAY_0 = 0x01 # Farthest from the USB connectorRELAY_1 = 0x02RELAY_2 = 0x04RELAY_3 = 0x08 # Closest to the USB Connectordevice = ft.open(0) # Opens the device, if it's connecteddevice.setBitMode(0xFF, 0x01) # IMPORTANT TO HAVE: This sets up the FTDI device as "Bit Bang" mode.def setRelay(relay, state):[indent] relayStates = device.getBitMode() # Get the current state of the relays[indent] if state == ON:[indent] device.write( chr(relayStates | relay) ) # Turn on relay(s) (without messing with the others)[indent] # The .write() method requires a CHARACTER, so we[indent] # type-cast our selected state INT to a chr()[indent] elif state == OFF:[indent] device.write( chr(relayStates & ~relay) ) # Turn off relay(s) (again without killing the others)setRelay( RELAY_0, ON ) # Turn Relay 0 ONtime.sleep(.5) # Wait 0.5 secondssetRelay( RELAY_1 | RELAY_3, ON ) # Turn Relays 1 and 3 ONtime.sleep(.5) # Wait 0.5 secondssetRelay( RELAY_1, OFF ) # Turn Relay 1 OFFtime.sleep(.3) # Wait 0.3 secondssetRelay( 0x0F, ON ) # No need to use globals...EVERYTHING ONtime.sleep(.3) # Wait 0.3 secondssetRelay( 0x0A, OFF ) # Turn Relay 0 and 2 OFFtime.sleep(.3) # Wait 0.3 secondssetRelay( 0x05, OFF ) # Turn Relay 1 and 3 OFFHope this helps!!!
M**E
Handy board but poor documentation
I read most of the reviews before ordering this device to use as part of a custom temperature-control system. I have a fair amount of experience with serial devices and machine programming. I expected getting this up and running would be fairly straightforward but it ended up taking a few hours. Here's what I now know:1) I got the 5v version. The relays can be powered from the USB, but this requires a standard PC-type jumper (not included). As-shipped, I guess you would need to connect a 5v external power supply. If you don't have jumpers laying around, order some.2) I was intending to operate this device via the virtual COM port on my PC as some reviewers reported (though I noticed that some reviewers reported trouble doing this...). It wasn't clear to me after reading other reviews but it seems that this device will only respond to serial commands (relays mapped to bits in a single byte, not as documented in the description download) AFTER it has been place in the so-called "bit bang mode" by a prior call to the SetBitMode() function in the FTD2XX.DLL (after each power-up), so you'll have to load/learn that interface to use serial/VCP (or first run the Relay Manager utility in the description download - it apparently leaves the chip in this mode). After putting in the effort to do this, I decided to just use the DLL for everything and not serial. There doesn't seem to be any way to put the FTDI chip in bit bang mode by sending commands to the virtual COM port interface (as far as I could find) - not convenient...3) My program was in 64-bit VBA. FTDI has a 64-bit PC driver but all the examples I downloaded from their website were 32-bit (had 32-bit Declares). I had to modify the Declares for all of the functions I needed (add PtrSafe and handles should be LongLong).
T**T
Solid USB Relay
Been using this daily for 2 years now and it's a workhorse once you get it set up. Just use a Python script or a shell script to control it and it works great. LEDs doe the relays are convenient too.
J**W
Falsely-advertised - no user manual included.
This is in response to Amazon removing my truthful feedback on a SainSmart 5V 4-CH USB relay module. Amazon said my feedback "didn't follow their guidelines".No, the problem with my feedback was that it was a truthful assessment. Amazon obviously did not perform any kind of QA/verification of this module before deciding to distribute it. And sain (the manufacturer) is selling a worthless piece of junk. BOTH Amazon AND sain are at fault. Furthermore, this item by sain is an absolute atrocity regarding quality, design, support, and operation. It's totally useless.More specifically: (1) each relay device on the module lacks a back-EMF (inductive kick) diode connected in reverse polarity across the relay coil which prevents damage to other circuitry on or connected to the module. (2) The module does NOT run on USB port power as packaged (Amazon states that it does); one must modify the module to power from the USB port. This requires installation of a jumper header (not included) and soldering. (3) sain has failed to support this module; after several email exchanges with sain regarding operation/programming of the module, they have failed to provide me with the CORRECT USB command set that controls the module. This is because they probably DON'T KNOW anything about it.In conclusion, from now on, I will NOT trust Amazon to verify quality, operation, and support of the merchandise Amazon distributes. That means, if I can't independently verify product integrity before buying, I will NOT buy from Amazon.Finally, Amazon needs to beware/screen cheap, copied-junk scams.
Trustpilot
2 months ago
3 days ago