Interfacing appliance question

Thread Starter

hyper9

Joined Jul 13, 2014
10
Hello all,

I've been looking through my old collection of pc and circuit design how to and stumbled upon one of my favorite bookmarks on a very basic way of controlling home appliances from a linux computer.

http://www.tldp.org/HOWTO/text/Home-Electrical-Control

When looking at the circuit and noticing how its a little dated i was curious if anyone knew of a updated design. NOT using an arduino. Just a very basic circuit that could use a usb cable or something.
 

Thread Starter

hyper9

Joined Jul 13, 2014
10
my apologize, just to clarify ( couldn't find the edit button :) ) :

i would like to learn about controlling a simple light or coffee maker from the most basic, POSSIBLE way using linux. This HOWTO link provided the way except i dont know of a laptop having a parallel port. If you were to use only a usb cable how many relays would you be able to control? The link claim to be able to control 8 relays i believe. A usb port having 4 lanes would be able to control how many relays? Am I atleast on the correct track?

My end goal is to start from control of one relay to entire home control. But i need to start from the most basic to be satisfied with my understanding. That why I have no interest in the X10 units or anything alike.
 

Thread Starter

hyper9

Joined Jul 13, 2014
10
Suppose this might turn into a journal. I hope that's ok with the admins.

I just took an extra usb extension cord out, cut the end to expose everything.. seems to be a shielded usb cable. underneath the plastic was a braided shield. i pulled the shield back carefully and underneath that was what looks like a stranded copper cable(ground?). the 4 usb wires (black green red white) where wrapped in foil.

pin out for usb:

pin 1 | red | +5v
pin 2 | white | DATA -
pin 3 | green | DATA +
pin 4 | black | GND

so immediately hooking up a usb cable to computer would send 5+ volts through the cable Im assuming. so i would need to connect the data + to the relay and choose a relay that could be turned on by +5 volts????

If i'm going about this the correct way would i also be able to power one more relay using the DATA - wire and sharing the ground wire?.. i suppose we will have to see. if no one replies :)
 

michael8

Joined Jan 11, 2015
472
No, USB doesn't work that way, the data lines are logic signals and bidirectional. Your pc is expecting to see inbound
signals and send outbound signals on those lines. see: https://en.wikipedia.org/wiki/USB and
https://en.wikipedia.org/wiki/USB_hardware

You at least need some sort of USB controller to put on the end of that cable. It can drive a transistor to beef up the
drive capability and that can drive a relay. I'd start with a simple USB to serial interface and use a serial control
line to drive the relay driver. Something like this:

https://www.ebay.com/itm/FT232RL-3-...ter-Module-for-Arduino-Mini-Port/183686553958

and for the relay, perhaps something like this:

https://www.ebay.com/itm/2PCS-1-Cha...for-Arduino-Raspberry-Pi-ARM-AVR/322465448278

There might need to be a transistor added to connect these and raise the output current from the serial control line or there
might be other "relay" boards which include the transistor driver circuit.
 

Thread Starter

hyper9

Joined Jul 13, 2014
10
No, USB doesn't work that way, the data lines are logic signals and bidirectional. Your pc is expecting to see inbound
signals and send outbound signals on those lines. see: https://en.wikipedia.org/wiki/USB and
https://en.wikipedia.org/wiki/USB_hardware

You at least need some sort of USB controller to put on the end of that cable. It can drive a transistor to beef up the
drive capability and that can drive a relay. I'd start with a simple USB to serial interface and use a serial control
line to drive the relay driver. Something like this:

https://www.ebay.com/itm/FT232RL-3-...ter-Module-for-Arduino-Mini-Port/183686553958

and for the relay, perhaps something like this:

https://www.ebay.com/itm/2PCS-1-Cha...for-Arduino-Raspberry-Pi-ARM-AVR/322465448278

There might need to be a transistor added to connect these and raise the output current from the serial control line or there
might be other "relay" boards which include the transistor driver circuit.

!!!!!!! Thank you so much for the reply, links and info !!! I'll get started reading and see what i come up with.
 

MrChips

Joined Oct 2, 2009
34,807
You can control as many devices as you wish with USB.
USB is like nothing you have seen before.
USB is not simply an electrical connection with four wires. It is a data communication protocol.

The best analogy I can think of, imagine you have a classroom of 300 students.
Then you want to call on one specific student by name and ask them to come to the blackboard and spell a certain word on the board. How would you do that?
 

pmd34

Joined Feb 22, 2014
529
Hi Hyper, the old Parallel port did give a very easy way to switch simple things off and on, but they are very rare these days. You could go for a USB paralell port that would allow you to do such things. But the more sophisticated way would be to use a USB to serial port IC or cable, and then a microcontroller to translate messages to switching signals.

Regarding linux, you should have a look at "gambas": http://gambas.sourceforge.net/en/main.html its a really cool visual basic type language that is really great for rapidly putting together graphics user interfaces, and is ideal for interfacing small projects to a linux computer.
 
Top