Skip to content

Instantly share code, notes, and snippets.

View omenlabs's full-sized avatar

John Hickey omenlabs

  • Long Beach, CA, USA
View GitHub Profile
@omenlabs
omenlabs / sainsmart_16_relay.py
Last active February 18, 2024 06:31
Example code for driving the Sainsmart 16-Channel 9-36V USB Relay Module (Product 101-70-208)
#!/usr/bin/env python3
"""
Example code for driving the Sainsmart 16-Channel 9-36V USB Relay Module (Product 101-70-208)
Documents for this module were found at:
https://s3.amazonaws.com/s3.image.smart/download/101-70-208/101-70-208.zip
The protocol appears to be MODBUS ASCII:
https://en.wikipedia.org/wiki/Modbus#Protocol_versions