I Need a Device that Can Tell a PC the State of Relay Contacts - Page 1
Forum section: electronics / projects

author: PeteCal
author_rank: Newbie
timestamp: January 10, 2024, 08:50:24 pm
content: A friend of mine needs to know when his furnace turns off and on. He has installed a relay that switches state when the furnace changes.All he needs is a USB device with two wires hanging out to place across the relay contacts (and maybe a pull-up resistor). Maybe some software to log the changes. I thought finding something like this would be easy but I can't seem to turn up anything reasonable.I found a $260 device with no software support.A sparkfun device for $19.99 but again no software support and requiring both Arduino coding and PC coding.If needed I could whip up some VBA code for the PC but I don't have the time to learn Arduino. In the distant past I did a lot of assembly language for the same chip family as the Arduino but I'm not ready to restart that stuff.Any ideas?

author: Kleinstein
author_rank: Super Contributor
timestamp: January 10, 2024, 08:59:07 pm
content: There may be some USB-UART converter modules that could do the trick. Some offer also other protocolls like SPI or I2C and may have some level of SW support. Worst fast using a µC to send something via UART and UART - USB module should be reasonable easy.

author: Kim Christensen
author_rank: Super Contributor
timestamp: January 10, 2024, 08:59:19 pm
content: Get a serial (RS232) to USB adapter and connect the relay contacts to the handshaking lines. Write some code to access the port and handshake status.

author: pqass
author_rank: Super Contributor
timestamp: January 10, 2024, 09:05:07 pm
content: RS232 serial to USB cable.Relay breaks a loop-back connection between DTR and DSR.VBA toggles DTR and checks state of DSR pin.No match = relay open. Match = relay closed.

author: nightfire
author_rank: Frequent Contributor
timestamp: January 10, 2024, 09:09:16 pm
content: In the industrial world there are lots of ready-made devices to do this, and present their findings in whatever protocol needed.Question here: In which way your friend wants to process this information?There are dataloggers with inbuild Webserver, for example, or devices like Digital in to SNMP etc.An example from a german manufacturer I have very good experience with:https://www.wut.de/e-57737-ww-dade-000.php(We used the thermometer devices from them to monitor some rooms in a datacenter and feed the data via SNMP to a nagios system)If you want to do things on the cheap/cost efficient side and have some programming skills, some Arduino or Raspberry Pi with industrial grade breakourb board/shield (read: galvanic insulation) also could to the job depending on the requirements.

author: nightfire
author_rank: Frequent Contributor
timestamp: January 10, 2024, 09:16:46 pm
content: Some thought: Maybe some USB->Relay contacts ready made solution like the Labjackhttps://labjack.com/could be the thing your friend can manage and expand? I played around wiith an older model some time ago, and that stuff looked quite good, and has ready-made features in it so not to waste lots of time doing everything in programming by oneself...

author: soldar
author_rank: Super Contributor
timestamp: January 10, 2024, 09:31:34 pm
content: I do exactly this with a Velleman K8055 which has digital and analog inputs and outputshttps://www.velleman.eu/products/view/?id=351346This has been replaced by: WSI8055Nhttps://www.velleman.eu/products/view/?id=461858This interface board has 5 digital input channels and 8 digital output channels. In addition, there are 2 analogue inputs and 2 analogue outputs with 8 bit resolution. The number of inputs/outputs can be further expanded by connecting more (up to a maximum of four) cards to the PC's USB connectors.All communication routines are contained in a Dynamic Link Library (DLL). You may write custom Windows (XP, Vista, Windows7) applications in Delphi, Visual Basic, C++ Builder or any other 32-bit Windows application development tool that supports calls to a DLL.Source code examples for Visual Basic, Visual C++, Visual C#, Excel, Delphi and Borland C++ builder are available.Hard- and software are downwards compatible with our previous versions.