Giter Site home page Giter Site logo

relay_usbtmc's Introduction

relay_usbtmc

--> UPDATE: 8 Channel board version added (with same Adafruit QT PY SAMD21) <--

Two relay channels are controlled with an Adafruit QT PY SAMD21 board running USBTMC

picture

I bought a five-pack of single channel AC/DC relays which can be controlled with a 3.3V level. I then glued 2 of them together and then glued an Adafruit QT PY microcontroller board to the top. The QT PY's STEMMA QT connector is used with a STEMMA QT cable to physically connect power, ground and control to the two relays. I modified the TINYUSB project's USBTMC device example to control the SDA and SCL pins of the QT PY as GPIOs. The relays are powered and controlled with the USB connection to the QT PY board through the STEMMA QT cable. The cool part of this new device is that it is a USBTMC device, which can be controlled and queried with simple SCPI commands.

No soldering needed!! (just hot glue)

Here are the SCPI commands which can be used:

RELAY1:EN 1 # relay 1 on, blue STEMMA wire

RELAY1:EN 0 # relay 1 off

REALY1:EN? # this query returns the state of RELAY1

RELAY2:EN 1 # relay 2 on, yellow STEMMA wire

RELAY2:EN 0 # relay 2 off

RELAY2:EN? # this query returns the state of RELAY2

*RST # set both relays off

*IDN? # returns valid commands and this URL

Here's my parts list:

https://www.adafruit.com/product/4600

https://www.adafruit.com/product/4210

https://www.amazon.com/Channel-Optocoupler-Isolated-Control-Arduino/dp/B07XGZSYJV

Feel free to test the UF2 on any QT PY SAMD21 board, as you can observe the SDA and SCL pins and see that they are controlled by the SCPI commands as GPIOs (blue wire is relay 1, yellow wire relay 2, black wire is ground, red wire is 3.3V). When wiring the dual relays, I used two short wires (light blue in picture) to share the PWR and GND with the second relay.

A simpler approach could be to just purchase a USB powered relay which has serial control of the relays. 1, 2 and 4 channel boards are sold on Amazon. I have used these boards and they work just as well as the USBTMC version. The downside is that the operating system determines the COM or TTY device name, and they can not be queried to check their presence or status.

I have used this board from Amazon: https://www.amazon.com/NOYITO-2-Channel-Module-Control-Intelligent/dp/B081RM7PMY

relay_usbtmc's People

Contributors

charkster avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.