Well, if you've got a wire... PIC16F87Xa. Builtin serial port, whether you need level translator depends on length and noise. Onechip, lots of i/o. Probably can find a cheaper more current part with enough capability. mike
Well, if you've got a wire... PIC16F87Xa. Builtin serial port, whether you need level translator depends on length and noise. Onechip, lots of i/o. Probably can find a cheaper more current part with enough capability. mike
-- Return address is VALID but some sites block emails with links. Delete this sig when replying. . Wanted, PCMCIA SCSI Card for HP m820 CDRW. FS 500MHz Tek DSOscilloscope TDS540 Make Offer Wanted, 12.1" LCD for Gateway Solo 5300. Samsung LT121SU-121 Bunch of stuff For Sale and Wanted at the link below. MAKE THE OBVIOUS CHANGES TO THE LINK http://www.geocities.com/SiliconValley/Monitor/4710/
I don't know about an "all-in-one" chip. It would have to handle 120V or 220V power input to synchronize with the zero crossing. The PL513, TW523, LM465 and CM17A units that X-10 sells are fairly cheap. But you'll need a TW723 (or is it TW7223?) for 220V, 50Hz systems, if that's what Spain uses.
There's an article in the current Circuit Cellar about using a CM17A with an RS232 UART.
- Brian
-- Somehow, I seem to be missing something here. What, specifically, do you want? Somewhere upstream I thought I heard you ask for a way to transmit the state of eight dipswitches to a remote location using the power line as a communications medium. Is that all you want, or is there more to it?
John, what I need is the following:
I need to find some IC, Chip, module, etc... which performs all the protocol/signal processing/... for transmitting control information over a line. At first I was proposing PLC, because I read something about X-10 and seemed OK. But now, I can assume using a dedicated line because I have an empty spare electrical tube along all the house.
I just want to have all the stuff X-10 does. I.e: Remote lamp/appliance switching, remote IR detection, automated house control from a computer, etc...
I will not make any commercial product. I just want to spend my time doing some useful installation at my own home.
I would like to find a small and cheap module/ic which I can fit in a reduced size PCB of my own with a microcontroller (programmed by me) to install in the wall switches and plugs. I can use SMD components.
What I said about using dipswitches an so on was: I would like to find a very simple to use IC, which, for example, would have some pins to select the station (ie 8 external dipswitches), 2 pins for the signal from the line, and some pins for the processed command, which I could feed to my microcontroller. I now I am asking for too much... but maybe someone knows something which seems to this.
I do not discard using the microcontroller itself to implement the whole protocol over a serial port, anyhow.
Regards and thanks to everyone for your replies!
Eduardo.
Brian, if I use TW-XXX I cannot embed it into the wall switch or plug, due to the huge size of the module. As I stated before, I can use a dedicated line, so I can avoid all the stuff about zero-crossing and so on. I have quite much experience on ATMega microcontrollers, also quite much on SGS-Thomson (ST-62XX) and some on PICs. I would need to find the simplest and smallest one having serial port and at least 12 IOs (8 for station ID dips), 2 for serial port, and 2 for command in/out...
Regards, Eduardo.
-- If you already know how to work with microcontrollers, why not roll your own? As far as getting the signal on the line goes, it's pretty simple; just capacitively couple a high-frequency tone burst signal onto the mains using a frequency far enough displaced from the mains frequency that the capacitor looks like a very large reactance to the mains frequency while being small enough to let your signalling frequency pass, like this: Here's a link to some X10 technical documents: http://www.x10.com/support/technology1.htm
I'd think this through some more.
Personally, I'd find another hobby or at least stick with X10/Leviton devices connected into the mains. I wouldn't be so worried about things that plug in, though even here I'd be using approved wall warts, if at all possible.
-- Keith
Yes: MAINS>--+-----+-------------/ /-----+-----+------------------ | | | | | [C] | [C] | | | | | +--+--+ | +--+--+ +--| TX | +--| RX |--[LOAD]--+ | | | | | +--| | +--| |----------+ | +-----+ | +-----+ | | | | MAINS>--+------------------/ /------+------------------------
Looking at the caps connected to the mains, if inside the TX box we have something like this,:
MAINS>----+----------+ | | +--+--+ [C1] |TONE | | |BURST+-------+ | GEN | | +--+--+ [R1] | | MAINS>----+----------+
what we'll want to do is keep the 170V peak AC from damaging the tone burst generator, while at the same time allowing the generator to couple bursts of a high frequency tone to the mains. Just for grins, let's say that we'd like to keep the 60Hz down to about +/- a volt at the R1C1 junction, and we'd like R1 to be about 100 ohms. That means that we'll have to limit the 60Hz current through R1 to
E 1V I = --- = ------ = 0.01A R 100R
With 170V on the mains, that means that the impedance of R1C1 has to look like:
170V Z = ------- = 17000 ohms 0.01ANow, since
Z = sqrt (R² + Xc²)
and we need to find the value of C1, we can rearrange to get the reactance of C1:
Xc = sqrt (Z² - R²) = sqrt (17000² - 100²) ~ 17000R
And the capacitance will be:
1 C = ---------- ~ 0.156µF 2pi f XcSo now we have this:
MAINS>----+----------+ | | +--+--+ [0.15µF] |TONE | | |BURST+-------+ | GEN | | +--+--+ [100R] | | MAINS>----+----------+ and we want to place a signal on the mains. First we'll choose a nice high frequency (say 100kHz) so that the reactance of C1 will be nice and low to it, allowing it to pass through and onto the mains without attenuating it too much.
At 100kHz the reactance of 0.15µF will be
1 Xc = --------- ~ 10 ohms 2pi f CSo that looks pretty good, and the last thing that needs to be done is to decide on the output amplitude of the tone burst generator.
If we say that our receiver has a sensitivity threshold of 100mV at
100kHz during the mains zero-crossings, and we want the receiver to work with a 10kW load on the mains, then our circuit starts to look like this:MAINS>----+----------+-------+ | | | +--+--+ [10R] | |TONE | | | |BURST+-------+ [1.44R] | GEN | | | +--+--+ [100R] | | | | MAINS>----+----------+-------+
Which is essentially this:
+-----+ |TONE | |BURST+-------+--------+---E1 | GEN | | | +--+--+ [100R] [10R]R1 | | | | | +---E2 | | | | | [1.44R]R2 | | | +----------+--------+In order to have E2 be 0.1V, we'll need E1 to be
(R1 + R2) E1 = E2 ----------- = 0.794V R2
and the generator will have to pump current into the impedance formed by everything across the mains, which reduces to:
+----------+ | | | [10R] [100R] | | [1.44R] | | +----------+and, finally, to:
| [10.26R] |
which is close enough to 10 ohms for our purpose, which is to determine how much current the tone burst generator has to supply into
10 ohms to get a drop of 0.794 across it, and sinceE 0.79V I = --- = ------- = 0.079A ~ 80mA R 10R
it'll be eminently doable, and as a matter of fact, upping it to 1V would get us better receiver operation and only require 100 mA out of the tone burst generator.
-- John Fields
Can you do this without a transformer? And if not, can you use a cheap off the shelf or surplus xfmr?
John, thanks for your calculation for the adapter part. Maybe I will have to use them in short (converted to 50Hz and 220 V...)
Some comments about the replies:
1.-Cabling all the house with Ethernet would be the most profitable solution, but would also involve making a really big project of the design, and filling the tubes up with lots of cables. Suppose I need to have control over ALL the lamps and from all the switches. My house (2 floors) would have several hubs/switches at given places, and some tubes would carry more cables than expected due to design of network (avoid more switches)2.-I don't know yet the legal problems I would have here in Spain if I modify the electrical installation, or from the assurance company in case of fire... I should ask about it before doing anything.
3.-I think I will consider two choices: a) Using a dedicated cable with a low level protocol, i.e. with RS485, and a top level protocol of my own in a PIC, for example. The cable would only have to go through all the switches one time, like a bus.b) Using a home-made X10-like protocol, with the indications from John Fields. Positive: I would avoid using the dedicated cable. Negative: I would have to train for a while until building the right "interface" module.
Once again, thanks to everyone for all the replies and help! Eduardo.
ElectronDepot website is not affiliated with any of the manufacturers or service providers discussed here. All logos and trade names are the property of their respective owners.