Home | Job | Pinball | Photo Album | Automotive | Press/Awards | Contact |
Inspection of several wall switches showed that the chip bore markings from the Microchip corporation, fueling the suspicion that it is possible to replace it with a PIC micro (from Microchip). A unit with an A/D converter is needed since the X-10 carrier is fed unamplified to the stock chip, and can have amplitudes in the tens of millivolts.
My initial attempts were successful, I was able to port my X-10 receiver from my home automation library and was able to receive X-10 commands. These commands were succesfully used to control the attached light bulb. The only modifications needed to the circuit board were the replacement of a zener diode and of course the microchip.
I then attempted to send X-10 commands from the wall switch, but the low operating voltage of the PIC and the inadequate signal coupling transformer made this not possible. Specifically, I directly connected both sides of the signal transformer's secondary to the PIC, and drove them in a complementary 'bridged' fashion. This applied 10 Volts peak-peak to the secondary. Due to the 10::1 ratio, this voltage appears as 1 Volt peak-peak on the primary and the power line. As a comparison, a mini controller plugged into the same outlet as the wall switch, produced 5 Volts peak-peak at the signal transformer's primary. Thus we need about a five fold increase in transmit amplitude.
Another issue is the fact that the PIC can sample no faster than 50kHz, while the X-10 carrier is at 120kHz. Since we will thus be subsampling, the apparent frequency of the X-10 carrier in the sampled data will be aliased down to the frequency Tr:
Tr = Tx - nTs, where n is an integer such that: 0 < Tr <= Ts
Thus if Tx is an exact multiple of Ts, the apparent frequency will be zero, and the carrier will not be detected. Since the sampling rate is 12.6khz, the carrier needs to shift by +/- 6.3kHz to cause this.
Finally, since the PIC is not frequency selective, burst of noise by nearby TRIACs can cause the carrier to be distorted compeletely. A better detection algorithm can address this, or analog hardware needs to be added to provide frequency selectivity.
Source code
Include file from Microchip
(rename to *.inc)