Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

Working with USB RELAY Problem

Status
Not open for further replies.

roma4ka

New Member
Hello there ,
I am new here , and I would like for some help with my relay system

I am useing this :
https://www.ebay.com/itm/1806463008...X:IT&_trksid=p3984.m1497.l2648#ht_8613wt_1220

and my problem is :

I am trying to use a USB relay controller to control the light in my house. I want to be able to on/off with a momentary switch. So If I turn on the light with the switch my DRM software (https://denkovi.com/page/13/drm-software.html) will show light state and Will turn of the light by pressing a button on the program.

for now it's work only if I turn on the light with the program and turn off with the program only
I want to contact with the switch and get it's state how to do that ?

Thanks in advance
 
If you bought a relay board that you want to work with momentary switches then why didn't you just buy one directly instead of a USB based one?

You'll need another I/O board that will connect to USB and have to write your own software to read the switches to send the commands to the relay board, the relay board is run by an FTDI chip which means it's just a serial port so you'll have to find the command set from Denkovi's sight, or use a serial port sniffing program to watch what the software is sending to the relay board.

You could write your own software that does the same thing and then just use the keyboard input as momentary switches that would probably be easiest. Depends on your programming experience.
 
If you bought a relay board that you want to work with momentary switches then why didn't you just buy one directly instead of a USB based one?

You'll need another I/O board that will connect to USB and have to write your own software to read the switches to send the commands to the relay board, the relay board is run by an FTDI chip which means it's just a serial port so you'll have to find the command set from Denkovi's sight, or use a serial port sniffing program to watch what the software is sending to the relay board.

You could write your own software that does the same thing and then just use the keyboard input as momentary switches that would probably be easiest. Depends on your programming experience.

I am good with programing this is not a problem ,
Hany any suggest for I/O board that I need to buy?
 
If you just want to use the PC keyboard buttons as your momentary switches you don't need any external I/O board. Could you explain in a little more detail exactly what you're trying to do?
 
I'm very hazy (and probably wrong :)) as to USB operation, but don't attached USB slave devices signal their presence and/or current requirements by putting some signal or resistive load on the data/clock line? If so, could you use a momentary switch to do the same thing and use the Windows API in some way to recognise the switch closure?
 
If you just want to use the PC keyboard buttons as your momentary switches you don't need any external I/O board. Could you explain in a little more detail exactly what you're trying to do?

I want the light switch work also ,I want to turn on the light by presing my light switch and turn off it useing pc and vica versa,
 
alec_t said:
I'm very hazy (and probably wrong ) as to USB operation, but don't attached USB slave devices signal their presence and/or current requirements by putting some signal or resistive load on the data/clock line? If so, could you use a momentary switch to do the same thing and use the Windows API in some way to recognise the switch closure?

No absolutely not.

Some cell phone's have a 'connection detect' that works this way, however this is technically outside of USB specifications, it's just for the phone to know it's connected to a charger that supplies USB voltages, and may actually violate USB specs under some circumstances (particularly high speed communication)

The USB specifications requires actual full protocol enumeration and bi directional transfer to negotiate current to a specific port.
 
Last edited:
Thanks for the USB explanation, Sceadwian. I knew I was on shaky ground there :).
So, the OP wants to use a domestic (wall?) switch to turn the light on and the PC to turn it off, and vice versa. That's going to require a modification to the mains wiring and involve a heavy-current switch (relay/contactor?) with mains isolation from the PC.
 
Thanks for the USB explanation, Sceadwian. I knew I was on shaky ground there :).
So, the OP wants to use a domestic (wall?) switch to turn the light on and the PC to turn it off, and vice versa. That's going to require a modification to the mains wiring and involve a heavy-current switch (relay/contactor?) with mains isolation from the PC.

oh, and how do I do that?
 
Something like this?
View attachment 65798
Component types/values will depend on the relay used.
If you don't use a latching relay/contactor then for one or the other set position of the mains switch the relay will draw current continuously. A latching relay only needs a brief pulse to change state. A single coil relay is shown, but a dual coil version would simplify the coil drive.
Another option would be to use opto-isolated triacs or solid-state relays instead of the mechanical relay.
As mains voltage is involved here BE CAREFUL and take all due precautions. Circuit parts/wires at mains voltage should be kept at least 3mm from low voltage parts/wires, should be well insulated, and should be installed in compliance with local regulations.
 
Last edited:
If this is going into a home, or a practical environment, I won't comment further, as much as I know, I know, you know less, and you could hurt someone with what you think you know.

Basically what I'm trying to say is you should not try to do this, if you do you endanger life.
 
I would just add that you should entrust the mains wiring modification to a qualified electrician in the interests of safety.
 
Status
Not open for further replies.

Latest threads

New Articles From Microcontroller Tips

Back
Top