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.

urgent - help please!!!! X-10 and home automation

Not open for further replies.


New Member
hi there guys . I really need some help urgently...i am trying to make a pic 16f877 based home automation system. I came across two good guides for this. One is the Microchip application note called AN236 and another one. I have attached both documents to this thread. I dont have any experience with circuity and need to post a few questions. Firstly how do i modify this circuit to work for a 220V,50Hz supply? I have loads of questions regarding the second document.if you could please take a look at thses and tell me if you could help me then i can start bombarding you with more questions. thank you all soooooooo much. you have no idea how important this are the attachments:

View attachment 00236a[1].pdf

View attachment powerline-communication-using-.doc


New Member
Hi there...its not something i have to hand in....its a project i am doing for myself....but the thing is i have no basis whatsoever in electrical engineering...i am more a program...its more urgent time wise because i only have a week off from work to actually work on this. Here are the questions that have been really bothering me...i appreciate your help.

So here are my questions:

Regarding both documents:

1. Zero crossing detector section:
a.It says that the RBO pin of the pic will be changed from Vss-0.6V. Is this a set value due to the diodes or is there a way of calculating this value?
b.Input threshold will be 0.8Vdd or o.2Vdd. Why? Where do you get the values 0.8 and 0.2 from?

2.What modifications would you make on all these circuits for an Ac of 230v at 50Hz. Especially diagrams 3 of 5 and 5 of 5 from the AN236 document.

3.Please explain how diagram 4 of 5 functions.

4.Diagram 5 of 5: How would you modify it for 230V @50Hz. Please explain this circuit to me. Also power in refers to the the AC input to the the transmitter and receiver respectively. But what is the POWER OUT point?? What is it used for?

5.You would obviously require two different power supplies, right? Because both the transmitter and receiver need to be connected over the AC lines for communication.

Regarding the second document –not AN236!!!!!

1. Can you make out what type of LCD display is used here?

2. Look at figure 1 under the receiver section:
a. The Ac mains are connected directly to the voltage limiter. How?
b. There are pins on the PIC microcontroller that are connected to relays. Why???

a. Algorithm for transmitter: STEP 3 says to configure RB1-RB4 as input ports – this would be for the switches, right?
The Algorith for the receiver: STEP 1: sets RBO-RB4 as output-why???
Are they using two separate PICS for this project??

b. LOOK at the Flow Charts: On all the flow charts there is a circle with an R in it.
What is this????

Thanks a lot for all the help....really really appreciate it:)


New Member
1a) It's set by the clamp diodes internal to the PIC.
1b) Input thresholds are specified parameters of the PIC.

2) On Sheet 3, I would remove C14, and replace C15 with a 2.5 uF 400V X2-rated capacitor.
Replace R14 with 2.2M flameproof resistor.
Replace VDR1 with a 260V unit.
Make sure Q1 is rated for 400V or higher.
Make sure C13 is 400V X2-rated, or remove it.

Sheet 4, Change R17 to two 4.7M flameproof resistors in series.
Change R18 to 2.2M flameproof resistor.
Change C17 to 0.1µF 400V X2 rated.

Power Out refers to the controlled load. This is apparently an evaluation circuit for a transmitter and/or receiver depending on what firmware is loaded.

I haven't printed and double checked my suggestions; please do so and ask questions if it appears I've missed anything. The general sense is to double the voltage ratings and maintain the same or similar current flow. I've mostly ignored the difference of 50/60 Hz.


New Member
LCD is probably the "standard" HD44780 based LCD. The commands look familiar.

The AC mains are connected directly to the voltage limiter through resistors and capacitors. For zero crossing it's R17, and for signal it's C17.

He could connect them to relays, if he wanted to control something. Just an application example.

The documentation seems to swap 50 and 60 Hz at will, so the actual timing is left to the interested reader.

I don't have Microsoft Word on this machine so I can't see some of the diagrams or flowcharts. Nonetheless, I hope I was helpful.


New Member
Hey there...thank you so definetly were very helpful. But now i have a few more doubts. Its regarding the AN236 document.

here are a few more questions bothering me. The thing is i dont have a background in electronics so the explanations in the document are too brief for me.

Refering to schematic 5 in appendix C, i have the following questions?

1. How does one go about designing this circuit ie what are the formulaes that are used, how do you know where to place each component, how do you determine the values of the various components.

2. I know what the basic purpose of the amplifiers are for but how do they actually function?

3. what does the envelope detector do?

4. What is the purpose of the 5 not gates in this circuit?

5. What are the functions of the following components: C19,R21,C27,D9?

6. what would the signal waves look at at these various points of this circuit: at the input or carrierdata, after the high pass filter, after the tuned amp, after C27, after the untuned amp, after D9, after the envelope detector but before U2:E and after U2:E

I really really appreciate all your help
thank you


New Member
Thanks for the heads up...i am looking at using powerline communication though...the other two use radio right?


Well-Known Member
Just a heads up, X10 is a really unreliable way to control stuff. There are Xbee & Zigbee modules that work far better.

X10 can be reliable but you have to understand the wiring configuration in the target building and add supplementary links and repeaters in some cases. Not complicated, but requires a bit more tech expertise than the advertising usually admits. The major advantage over RF methods is that you are not sharing spectrum so no interference, you just have to deal with some noise which isn't so bad. I would recommend to anyone doing a lot of X10 to get one of those system analyzer gadgets. These give you a good window into whats happening and where there is weakness in signals.
Last edited:


Well-Known Member
I've got a handful of old X10 crap sitting in a box somewhere. I even tried new firmware from Maniac Marks site for the old CM11A (16F84)
Just awful stuff from good old 1973 , for the price of the analyzer you can buy better technology. I also wouldn't recommend the 1973 Ford Pinto either some could fly, most caught fire.
**broken link removed**


New Member
x10 source code issue!

iam trying to develop an adressable smoke and fire transmitter thru powerlin,i reffered the documents posted here,in this, the code is not compleated one,where can i get the full source code in c luanguuage?
the functions mentioned here in this transmitter codes are:

functions used to send code
void startcode(int x);
void housecode(int x);
void devicecode(int x);
void functioncode(int x);
void sendaddressonce();
void sendaddresstwice();
void sendfunctiononce();
void sendfunctiontwice();
void delay1ms();
void delay1();
void delay();
and so....
urgently pls help me to find these functions...



New Member
x10 source code

hi..pls help me to find the rest of code including the full functions...


  • powerline-communication-using-.doc
    1.5 MB · Views: 245


Well-Known Member
Most Helpful Member
This thread is like 3 years old.
Please use proper sintax so we can read your posts.
iam trying to develop an adressable smoke and fire transmitter thru powerlin
X-10 is not reliable enough for critical applications.
Not open for further replies.

Latest threads

New Articles From Microcontroller Tips