User avatar
redhawk
Posts: 3465
Joined: Sun Mar 04, 2012 2:13 pm
Location: ::1

Re: PiHAT - Rasberry Pi Home Automation Transmitter

Fri Jan 11, 2013 11:01 pm

As a work around for the slight variations in the remote control IDs perhaps you could define a subsection of --brand=5 like --brand=5a for "0011" start sequence and --brand=5b for "0010" start sequence??

Richard S.

s7mx1
Posts: 78
Joined: Fri Sep 30, 2011 9:28 am

Re: PiHAT - Rasberry Pi Home Automation Transmitter

Fri Jan 11, 2013 11:10 pm

redhawk wrote:As a work around for the slight variations in the remote control IDs perhaps you could define a subsection of --brand=5 like --brand=5a for "0011" start sequence and --brand=5b for "0010" start sequence??

Richard S.
That will be 5, 6, 7, 8.

s7mx1
Posts: 78
Joined: Fri Sep 30, 2011 9:28 am

Re: PiHAT - Rasberry Pi Home Automation Transmitter

Sat Jan 12, 2013 1:21 am

Updated binary to extend id to 18 bits. For morrison's remote the id will starts from 65536 - 131071 and 196608 - 262143 for Status remote.

Use channel 0 to turn off all sockets registered with the same id.

I found my remote id in the end.

You can have up to 7 sockets/switches registered with the same remote id

User avatar
redhawk
Posts: 3465
Joined: Sun Mar 04, 2012 2:13 pm
Location: ::1

Re: PiHAT - Rasberry Pi Home Automation Transmitter

Sat Jan 12, 2013 9:48 pm

redhawk wrote:I think people who are going to work out their remote IDs by trial and error are in for a long wait: :lol:
As it happens I knocked up a quick and dirty program to take a WAV file and to turn the data into binary sequences.
I've only tested this with my Status remote control / Pi but it may work with other similar devices.
The source code is written in Pascal and compiles using Turbo Pascal 6.0, 7.0 and Free Pascal win32 it should compile with Free Pascal ARM but I haven't got around to installing it yet.

http://pastebin.com/CgacpqMj

Richard S.

User avatar
greatdane
Posts: 34
Joined: Mon Apr 30, 2012 7:58 pm
Location: Søndersø, Denmark
Contact: Website

Re: PiHAT - Rasberry Pi Home Automation Transmitter

Sun Jan 13, 2013 11:54 am

What kind of range do you get with this ? With a 16cm piece of wire hanging off pin 7 (GPIO4) I get no more than ~10cm with the Status units from Asda.
Sand Bay, North Somerset, UK

s7mx1
Posts: 78
Joined: Fri Sep 30, 2011 9:28 am

Re: PiHAT - Rasberry Pi Home Automation Transmitter

Sun Jan 13, 2013 12:13 pm

greatdane wrote:What kind of range do you get with this ? With a 16cm piece of wire hanging off pin 7 (GPIO4) I get no more than ~10cm with the Status units from Asda.

I got really good range. Far better than the original remote. My pi is located downstairs and it can control sockets upstairs.

I guess you attached the wire to the wrong pin. On my board ( version 1) its pin 7. My wire is about 40cm and I placed in L shape to have better coverage.

User avatar
greatdane
Posts: 34
Joined: Mon Apr 30, 2012 7:58 pm
Location: Søndersø, Denmark
Contact: Website

Re: PiHAT - Rasberry Pi Home Automation Transmitter

Sun Jan 13, 2013 12:43 pm

Thanks for your quick reply.

I definitely have the correct pin, but I just doubled the length of my wire and that did the trick. It now works over several meters. Will experiment with the optimal length later in the week.

Cheers
Sand Bay, North Somerset, UK

User avatar
redhawk
Posts: 3465
Joined: Sun Mar 04, 2012 2:13 pm
Location: ::1

Re: PiHAT - Rasberry Pi Home Automation Transmitter

Sun Jan 13, 2013 12:59 pm

To get the 443.92MHz frequency the program is using the 3rd harmonics of 144.64MHz (144.64 x 3 = 433.92).
The problem with this technique is the transmission power gets less and less for every harmonic generated.
The only way to fix this is to apply an RF band pass filter so that you get most of energy is delivered at 433.92.
I believe the original author of this project is using a SAW filter for his antenna - http://www.ebay.co.uk/itm/EPCOS-B39431B ... 0963857438?

As for my Status remote switch I get about 1 meter range through walls not 10cm which admittedly isn't great.
The wire must also point straight up or at 90degrees from the direction of the receiver to send the best transmission signal.

I'm going to experiment with my Toko coils if I can filter out 144.64MHz at the antenna then hopefully I should be able to boost the transmission power at 443.92MHz.

Richard S.

s7mx1
Posts: 78
Joined: Fri Sep 30, 2011 9:28 am

Re: PiHAT - Rasberry Pi Home Automation Transmitter

Sun Jan 13, 2013 1:22 pm

You cannot use shielded or twisted wire. The range with standard plain wire is good for me and it does penetrate wooden floor well enough so I could control sockets upstairs. As suggested you should use filter to get the best range.
greatdane wrote:Thanks for your quick reply.

I definitely have the correct pin, but I just doubled the length of my wire and that did the trick. It now works over several meters. Will experiment with the optimal length later in the week.

Cheers

User avatar
redhawk
Posts: 3465
Joined: Sun Mar 04, 2012 2:13 pm
Location: ::1

Re: PiHAT - Rasberry Pi Home Automation Transmitter

Sun Jan 13, 2013 3:38 pm

I've increased the transmission range from 1 meters to about 4 meters using a homemade coil and 2 capacitors. :)
The circuit is crude but simple enough to build I'm sure I could go further but at 4 meters this is more than sufficient for me.
Image
Component values are not highly critical however they do need to be close together and the connection to the GIPO 4 output pin close as well.
When pihat is running in a loop performing pairing mode slowly adjust the trimmer capacitor with a ceramic screw driver.
Eventually you should find the correct position which delivers a better signal at 443.92MHz, at the same time you may notice the interference from your FM radio varying with intensity too.
Ideally you should use a 433.92MHz SAW filter but at 5 quid a piece I think this is a bit too much.

Richard S.

s7mx1
Posts: 78
Joined: Fri Sep 30, 2011 9:28 am

Re: PiHAT - Rasberry Pi Home Automation Transmitter

Sun Jan 13, 2013 4:02 pm

Farnell sells the filter for less than a pound. The problem is the delivery charge is about £5. You could try maplin.

User avatar
redhawk
Posts: 3465
Joined: Sun Mar 04, 2012 2:13 pm
Location: ::1

Re: PiHAT - Rasberry Pi Home Automation Transmitter

Mon Jan 14, 2013 3:06 pm

I've fixed a few minor bugs with my binary decoder program - http://pastebin.com/zQ4ki68Y
The normalisation function would sometimes fail if WAV audio suffered from a large DC offset (dodgy sound card).
It now supports 16bit and stereo audio files providing the sample rate is 44.1kHz or 48kHz.
I've also removed the need to invert the signal it's clever enough to detect an inverted signal and compensate.
If you own a Status remote control or similar device then use the -s option to display your handset id.

Richard S.

User avatar
redhawk
Posts: 3465
Joined: Sun Mar 04, 2012 2:13 pm
Location: ::1

Re: PiHAT - Rasberry Pi Home Automation Transmitter

Thu Jan 17, 2013 12:45 am

I've made another update and this will be my last - http://pastebin.com/uB584ZUP
The pulse detection was changed it should be more reliable now, I've also added 2 different audio filters which can in some cases help to improve detection. :)

Today I knocked up a simple 433.92MHz RF receiver with nothing more than a BF199, a homemade 1.5T coil and some extra bits as bits go.
I managed to tune the receiver to my Status remote control and funnily enough I could also pick up the signals from my car key fob I guess this too works at 433.92MHz.
Then I tried pihat and I found the signal was really weak despite having a long antenna wire and only 50cm away from my receiver.
After some checking it turns out pihat was actually transmitting at a much higher frequency than 433.92MHz.
This is probably one of the reasons why I found the range poor using pihat while other people seem to be able to go through several floors.

Is there any way to tweak the code to lower the transmitter frequency down by a fraction??

Richard S.

engeeaitch
Posts: 4
Joined: Thu Jan 17, 2013 7:58 pm

Re: PiHAT - Rasberry Pi Home Automation Transmitter

Thu Jan 17, 2013 8:58 pm

I have successfully got the pihat program working with a Status controller bought from Morrisons (in the UK).

However, the signal does not seem to be that reliable or carry far enough for my needs (I want to operate the switch over a couple of meters with the pi and switch in separate cupboards), so have been looking at filters.

The filter in the original article was a B39431B3710U410, but the only place I can find this is Farnell, with a £15.95 shipping charge from the US (too expensive at £20.27 all in and too slow).

There was a link to an ebay filter B39431B3750U310. The spec. is different, but I can’t decide if the differences are important or not. Can anyone advise please?

The spec for the original is here: http://www.epcos.com/inf/40/ds/ae/B3710.pdf

And the ebay one is here: http://docs-europe.electrocomponents.co ... 4eeb25.pdf

Alternatively, is there anything else that would do the job?

Any help much appreciated.

User avatar
redhawk
Posts: 3465
Joined: Sun Mar 04, 2012 2:13 pm
Location: ::1

Re: PiHAT - Rasberry Pi Home Automation Transmitter

Fri Jan 18, 2013 12:03 am

Alternatively, is there anything else that would do the job?
Some people have reported using a longer wire to boost range, not sure why this should work since a 1/4 wave dipole length of 433MHz is around 16cm perhaps having harmonics can mess up equations.
You could try constructing a filter circuit (scroll up) I made one out of a capacitor, a coil and variable capacitor it has increased my range from the original 1 meters to 4 meters.
It's a bit tricky having to adjust the variable capacitor (with a non metallic screw driver) to the optimum position pihat must run in a loop to verify the boost is working correctly.
When I have the time I'm going to experiment getting pihat to transmit on different frequencies I'm not entirely convinced it's bang on 433.92MHz.

Richard S.

s7mx1
Posts: 78
Joined: Fri Sep 30, 2011 9:28 am

Re: PiHAT - Rasberry Pi Home Automation Transmitter

Fri Jan 18, 2013 11:57 am

The frequency it tunes to is 144.64 MHz therefore the antenna length should be around 49cm without filter. I could be wrong. I will upload some pictures later on to show my setup.

s7mx1
Posts: 78
Joined: Fri Sep 30, 2011 9:28 am

Re: PiHAT - Rasberry Pi Home Automation Transmitter

Fri Jan 18, 2013 12:01 pm

@engeeaitch

You can try this one and should not cost you more than £6 including delivery
http://uk.farnell.com/epcos/b39431b3710 ... dp/1791906

canyon
Posts: 38
Joined: Sun Jan 29, 2012 9:47 am
Location: London UK

Re: PiHAT - Rasberry Pi Home Automation Transmitter

Fri Jan 18, 2013 3:12 pm

@ s7mx1
I think you are mistaken, although I wish you were right :cry: :
Following your link to Farnell, if I try to buy one I get this at the checkout:
Goods Subtotal: £0.94
Basic Shipping: Unknown
Direct Ship Charge: £15.95
VAT: £3.38
Total: £20.27
I googled the part number (looking for UK sites) and found several I'd heard of including Digikey and Mouser. All of them seemed to have a shipping charge of over £12, or a minimum order of something like £50.
If you or anyone else knows where I can get one in the UK for a sensible price I'd be most grateful for the information.

User avatar
redhawk
Posts: 3465
Joined: Sun Mar 04, 2012 2:13 pm
Location: ::1

Re: PiHAT - Rasberry Pi Home Automation Transmitter

Fri Jan 18, 2013 4:44 pm

You can buy the same filters from eBay for about 6 quid I'm sure there're no different than the ones sold by Farnell.
As for 144.64MHz the correct length is around 19.4cm according to - http://wb5mrn.com/ham/antenna.htm
I would have expected having an antenna wire length set for 433.92MHz to work better than a different frequency even though it was the 3rd harmonic but that doesn't appear to be the case. :)

Richard S.

User avatar
greatdane
Posts: 34
Joined: Mon Apr 30, 2012 7:58 pm
Location: Søndersø, Denmark
Contact: Website

Re: PiHAT - Rasberry Pi Home Automation Transmitter

Fri Jan 18, 2013 4:55 pm

While looking into the pricing of the filters I came across a complete 433.92Mhz TX/RX set on eBay for just 99p + 50p delivery !

http://cgi.ebay.co.uk/ws/eBayISAPI.dll? ... 1046773860

Much cheaper than a filter for the Pihat and already the correct frequency. I assume it will be easier to get better range with these so ordered 3. Will update when I have had time to play with them.
Sand Bay, North Somerset, UK

s7mx1
Posts: 78
Joined: Fri Sep 30, 2011 9:28 am

Re: PiHAT - Rasberry Pi Home Automation Transmitter

Fri Jan 18, 2013 5:24 pm

I went through these options as well and I have concluded its not worth it.

The quality is really poor and the frequency needs to be turned from time to time as it will suffer from frequency shift over time. The range is unlikely to be good.

You cannot use it straight and you will need either arduino or some kind of pi shield.

Other thing you could consider will be rfm12b or rfm12b pi shield.
greatdane wrote:While looking into the pricing of the filters I came across a complete 433.92Mhz TX/RX set on eBay for just 99p + 50p delivery !

http://cgi.ebay.co.uk/ws/eBayISAPI.dll? ... 1046773860

Much cheaper than a filter for the Pihat and already the correct frequency. I assume it will be easier to get better range with these so ordered 3. Will update when I have had time to play with them.

s7mx1
Posts: 78
Joined: Fri Sep 30, 2011 9:28 am

Re: PiHAT - Rasberry Pi Home Automation Transmitter

Fri Jan 18, 2013 5:34 pm

@redhawk

The unit of 19.4 is inch so you need to convert to cm first which is 49cm.
redhawk wrote:You can buy the same filters from eBay for about 6 quid I'm sure there're no different than the ones sold by Farnell.
As for 144.64MHz the correct length is around 19.4cm according to - http://wb5mrn.com/ham/antenna.htm
I would have expected having an antenna wire length set for 433.92MHz to work better than a different frequency even though it was the 3rd harmonic but that doesn't appear to be the case. :)

Richard S.

s7mx1
Posts: 78
Joined: Fri Sep 30, 2011 9:28 am

Re: PiHAT - Rasberry Pi Home Automation Transmitter

Fri Jan 18, 2013 5:37 pm

@engeeaitch @canyon

Just searched "saw filter 433" on ebay and found two links both below 6 pounds. Keep your progress updated if you want to go with the filter route.

User avatar
redhawk
Posts: 3465
Joined: Sun Mar 04, 2012 2:13 pm
Location: ::1

Re: PiHAT - Rasberry Pi Home Automation Transmitter

Fri Jan 18, 2013 5:52 pm

yeah, my mistake I was looking at the wrong units. :)

I've also been thinking about buying a few of those cheap RX/TX boards from Hong Kong too not specifically to use as digital switches but to hack the radio receiver circuit.
Anyway on the TX board there is a circular metal component it looks like a crystal although most I've seen come as oval shaped or a can with legs.
Then I was looking for SAW filters and noticed something similar - http://www.ebay.co.uk/itm/5-PCS-433-92M ... 0723017749
Is the part on the transmitter board a crystal or a SAW filter like the one in the link above??

Richard S.

User avatar
greatdane
Posts: 34
Joined: Mon Apr 30, 2012 7:58 pm
Location: Søndersø, Denmark
Contact: Website

Re: PiHAT - Rasberry Pi Home Automation Transmitter

Fri Jan 18, 2013 10:20 pm

Sand Bay, North Somerset, UK

Return to “Automation, sensing and robotics”