Go Down

Topic: Arduino Powered X10+RFID Controlled Curtain Opener (Read 7 times) previous topic - next topic


Thomas & wennjo - thanks much for all that info. Especially the BobLight link which shows that a 315MHZ receiver can be detuned! This was the only missing piece for me, and unfortunately for my wife, it will probably get me back to working with the Arduino again.

After the RF receiver, I'll see if a 315MHZ transmitter can be modified to replace the CM17A. I'll definitely check out your libs as a substitute for the current Playground set. (I know the stuff I wrote wasn't the best implementation.) I like that fact that it has a buffer too.

Phil, since the BobLight link that Thomas posted used the 2400bps receiver that has a tuning slug, I'd probably go with that rather than the crystal controlled 4800bps model - just my opinion.

Thanks a lot

"Data is not information, information is not knowledge, knowledge is not understanding, understanding is not wisdom."
~ Clifford Stoll


Wow, thanks so much for your help!! :o
I've ordered a 315mhz receiver and will let you guys know how it works!
I wish I had a scope to use but they're just damn expensive, so I'll be doing the arduino guess and check method :)

Do any of you know where I could get a 310mhz crystal in the same packaging? Digikey wasn't helpful for me.

@ThomasM thanks! I had a completely web-based version beforehand, but used this as an excuse to learn obj-c, poorly ha



The 2400bps receiver doesn't use a crystal. You should buy the 2400bps receiver (http://www.arduino.cc/cgi-bin/yabb2/YaBB.pl?action=post;num=1282815280;title=PostReply) NOT the 4800bps since the 2400bps has a tuning slug on the back of the board.

And if you were to change the crystal of a receiver, remember that the crystal will not necessarily be 310MHz for a 310MHz receiver. A typical 433MHz receiver crystal is 13.2256MHz and a typical 315MHz receiver uses a 9.5094MHz crystal. So you would need to carefully select a crystal that would give you a 310MHz output. But I'm not sure it's this simple, and the right crystal might be hard or impossible to find.


Thanks Thomas. I did order the 2400bps one, I didn't specify that I was seeing if this could be done for the transmitter http://www.sparkfun.com/commerce/product_info.php?products_id=8945
Since the crystal on that has 315 on the packaging I was hoping to get one just like it only @ 310mhz. I was hoping it'd be as easy as swapping them :)

Thanks again!


Ok, just wanted to make sure.

Let me know if you guys have any success re-tuning these modules at all. I suspect it might a challenge :) By the way, I have a feeling it's a bad idea to use a metal screwdriver when adjusting the tuning slug, so try to find something made of plastic or another material that doesn't work as an antenna.



Oct 14, 2010, 05:00 pm Last Edit: Oct 14, 2010, 06:00 pm by BroHogan Reason: 1
Glad to hear you were talking about the crystal in the transmitter.
I hope you get the transmitter working, but again, an alternative is a CM17A (about $6 on ebay). I've used them to send garage door status and even to send temperature.

As for a scope, you can try a soundcard scope. One I like is at http://www.zeitnitz.de/Christian/scope_en. It should be fast enough to see the output of the receiver.

I'll be trying the same thing you are, with the 1st goal being a "whole house" RF receiver.
(I guess I'll be learning about antennas  ::))
"Data is not information, information is not knowledge, knowledge is not understanding, understanding is not wisdom."
~ Clifford Stoll


Oct 17, 2010, 06:30 am Last Edit: Oct 17, 2010, 08:59 am by BroHogan Reason: 1
It works!
The 315MHz receiver with the RF lib from Thomas works at close range right out of the box.

I did a rough tuning to 310MHz by connecting the data line to the line-in on my soundcard. There's lots of noise, but when you transmit an X10 signal, you can hear it clearly. Moving the transmitter further away while adjusting the slug (start CCW) gave me reception from most of the house and some motion sensors outside.

Nothing left to do but build something with it. Thanks Thomas - great code.

These are antenna lengths (in inches) for a vertical antenna at 310MHz . . .
1/4 wave - 9 1/16"
1/2 wave - 18 1/8"
full wave - 36 1/4"

I've posted a bit more detail on my blog and will post more when I'm further along.
"Data is not information, information is not knowledge, knowledge is not understanding, understanding is not wisdom."
~ Clifford Stoll


You guys are incredible! I just received my 315mhz receiver and want to dive in, especially knowing everything works great :)

@BroHogan Did you divide the voltage from the data pin before feeding into the mic input? The Soundscope page says most sound cards only handle +- 0.7V where I'd imagine the output from the receiver chip would be 5v? How much did you divide it if you did?

Also, when using the CM17A, how fast can you send commands? I wanted to use the transmitter to control the x10 camera ninja mounts around the house, but before when using the CM15a I could only send about 1msg/second which was waaaaayyy too slow to move the camera.



I used the AUX input (not MIC) to the soundcard - straight in. PC soundcard oscilloscopes also use that input. Hopefully your mileage won't vary, but I've never had a problem.

I can't say for sure how fast the CM17A will transmit. My guess is that it might be faster since it takes commands quickly. On the other hand, it may repeat commands 3X when it sends. But this is all just a guess.

Good luck on getting your stuff going. It should just work at close range without tuning - at least that was my experience.
"Data is not information, information is not knowledge, knowledge is not understanding, understanding is not wisdom."
~ Clifford Stoll


Thanks BroHogan! I appreciate the help! Another dumb question tho, so using a spliced headphone cable, I should run the data to one or the other tip pin, and then ground to the sleeve, correct?

Also, did you just do it by sound from the speakers vs using the soundscope app?

Thanks again!!


Oct 19, 2010, 03:22 am Last Edit: Oct 19, 2010, 03:46 am by BroHogan Reason: 1
Yes, to either right of left tip and ground to "barrel". Plug in AUX.
First I tried the scope but couldn't tell much. With the speakers on I could hear when the signal was weak. Later, I put a call to tone() Thomas's example:
Code: [Select]
// Process commands received from X10 compatible RF remote
void processRfCommand(char house, byte unit, byte command, bool isRepeat)
   tone1.play(2400,1000); // <---- ADDED THIS
   printX10Message(RADIO_FREQ_MSG, house, unit, command, 0, 0, 0);

Then I could walk around and do some fine tuning by seeing how far I could go and still hear the tone.
"Data is not information, information is not knowledge, knowledge is not understanding, understanding is not wisdom."
~ Clifford Stoll


Oct 19, 2010, 07:48 am Last Edit: Oct 19, 2010, 08:31 am by phil.harlow Reason: 1
@BroHogan did you have to modify the code at all to get it to work?
I was able to hear the x10 rf "sounds" over the steady beep beep beep coming from the 315 receiver and tuned that to double or triple the reception distance. (~160* CCW)
I've then got it wired into the arduino like so: http://load-8-1.blogspot.com/2010/06/x10-plc-rf-ir-and-computer-interface.html
and have loaded the X10_test sketch to the arduino.
Problem is, I'm seeing the "X10" startup message over serial, but nothing when firing an x10 rf controller. Adding some logging to the X10rf lib I can see the receive() function is firing 10+ times/sec but not sure what I should try next. @ThomasM any troubleshooting tips/things to check?


Edit: Nevermind :) I guess the signal was too weak. Adding an antenna it seems to work great!

Edit2: I found that some of my wireless remotes wouldn't work. The mini keychain one worked fine as its signal came out alot faster (I found this out via the audio technique) than the palm pad remote. I adjusted all of the max time values in X10rf.h to 25000, 2200, and 3300 respectively and now it works great! Sweet!!

Thanks for your great work Thomas!


@Phil.H & @BroHogan

Hi glad to hear that you got it working. Do any of you guys have an Arduino Ethernet shield? I just finished v1.0 of my X10_Ethernet sketch ( code published on Google Code). Basically, it lets you control everything through a RESTful webservice using JSON protocol. Web service is protected using HTTP Basic Authentication. I'm publishing an Article explaining how to use the REST & JSON stuff soon.

I also added support for storing module types and names of up to 16 characters in Arduino EEPROM.

I'll start working on an Android app next week, hopefully I'll have something done next weekend. REST & JSON is supported by both the iPhone, Android and .Net frameworks :)

If you download the X10_Ethernet sketch from Google Code, make sure you get the latest version of the X10ex library as well.


Could you check what the lowest values that work with your remotes are, when setting the max time values? I'll add comments in the code for people using the same remotes you do. BTW: If you set the bit0 max to 2200, you should set the bit1 min to a value higher than 2200. The code reads the bit1 values first, so the bit0 max you are actually using is probably 2099.


Go Up