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

Re: PiHAT - Rasberry Pi Home Automation Transmitter

Sat Jan 19, 2013 12:20 am

Nice to actually see a proper photo of these cheap TX/RX boards from eBay so the round metal cap is indeed a 433MHz SAW filter. :)

Richard S.

alvinAvR
Posts: 5
Joined: Tue Jan 22, 2013 7:47 pm

Re: PiHAT - Rasberry Pi Home Automation Transmitter

Tue Jan 22, 2013 7:56 pm

I now have pihat working for the Conrad remote power switches. These are sold by Conrad in Germany. They cost about €12 for three switches and a remote.
I have attached the modified pihat files. Executable is included.

The remote uses an SC5262 controller chip.

Alvin
Attachments
pihat_conrad.tar.gz
(10.72 KiB) Downloaded 387 times

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

Re: PiHAT - Rasberry Pi Home Automation Transmitter

Thu Jan 24, 2013 1:00 pm

I opened up my Status remote switch unit today cos I was bored and also I wanted to locate the output pins for the signal.

Image
(WARNING - never operate this device with the back exposed because the risk of an electric shock.
Having 240 volts going through your body even for split second is not particularly nice and may kill you as well.)

By having access to analogue audio output of the radio module it had enabled me to find tune my antenna arrangement.
This was quite weird actually because the signal strength would vary depending on how the PSU cable was positioned and where I was standing in the room.
I've also done away with my filter circuit and have GPIO 4 connected to a 10pF capacitor going to ground and another wire connected to GPIO 4 of 16cm pointing upwards (this seems to be the best method for me).

Then I had an idea, why not turn the remote controlled switch into a remote controlled remote controller.
Since hacking the digital output is relatively easy all you would need is to connect an infrared LED driver circuit and the Pi to encode the signals.
This could mean having the ability to use your Pi to control the TV, Music Centre, VCR, DVD Player, Satellite etc. anywhere in the house while your Pi can stay put.
With cgi scripts you could provide web based access so an Android phone / tablet may be turned into the ultimate all-in-one remote control.
Having web based access also means you could control your devices when away from home via 2G/3G mobile broadband access.
Just imagine if you're down the pub or on holiday and forgot to record your favourite TV show then this would be made possible using the Pi.

Do you think such a project would be worth pursuing?? :)

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

Thu Jan 24, 2013 4:52 pm

I think it may have a lot of potential.

What are the levels of the digital & analogue signals respectively ?

Do you have some screenshots of those signals ?
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

Fri Jan 25, 2013 1:42 am

There is a dual opamp LM358 IC inside to amplify the signal from the radio module and to convert this into digital out (schmitt trigger).
There is sufficient current at the output to drive an Infrared LED with a 220ohm resistor it flashes a faint red to the naked eye and flashes white on my camera phone which is a good sign.
The analogue output should be sufficient to driver a pair of high impedance headphones although I used a Bluetooth audio transmitter when I calibrated the Pi antenna.

There are few things I need to figure out first this is mainly how to generate the 38kHz modulated pulses accurately as possible otherwise remote controlled equipment would simply ignore the pulses - http://www.brainlinksystem.com/all-about-ir-signals
Another problem I have to consider is the frequency response of the radio module may not be high enough for 38kHz since this isn't a requirement for digital switches.
The use of an LM358 opamp doesn't help either due to their poor audio response at high frequencies.
I'm still waiting on my eBay order for the cheap 433.92MHz TX/RX boards only when I can hook up a remote control to a TX board will I know where I stand.

Richard S.

woodside
Posts: 16
Joined: Mon Oct 22, 2012 7:42 am

Re: PiHAT - Rasberry Pi Home Automation Transmitter

Fri Jan 25, 2013 4:58 pm

alvinAvR wrote:I now have pihat working for the Conrad remote power switches. These are sold by Conrad in Germany. They cost about €12 for three switches and a remote.
I have attached the modified pihat files. Executable is included.

The remote uses an SC5262 controller chip.

Alvin
Just tried your version of pihat, but without success. The transmitter and receiver are both set to group:4, channel:2. I assume that I do not require to input an ID, so this is what I have been entering : pi@raspberrypi ~ $ sudo ./pihat --group=4 --channel=2 --state=0 --repeat=60 to turn the switch off - can you please confirm that this is correct and if so perhaps suggest what I am doing wrong?
Many thanks
Ken

alvinAvR
Posts: 5
Joined: Tue Jan 22, 2013 7:47 pm

Re: PiHAT - Rasberry Pi Home Automation Transmitter

Fri Jan 25, 2013 6:45 pm

woodside wrote:
alvinAvR wrote:I now have pihat working for the Conrad remote power switches. These are sold by Conrad in Germany. They cost about €12 for three switches and a remote.
I have attached the modified pihat files. Executable is included.

The remote uses an SC5262 controller chip.

Alvin
Just tried your version of pihat, but without success. The transmitter and receiver are both set to group:4, channel:2. I assume that I do not require to input an ID, so this is what I have been entering : pi@raspberrypi ~ $ sudo ./pihat --group=4 --channel=2 --state=0 --repeat=60 to turn the switch off - can you please confirm that this is correct and if so perhaps suggest what I am doing wrong?
Many thanks
Ken
Hi Ken

I should have given better documentation, sorry.
Try pi@raspberrypi ~ $ sudo ./pihat --group=4 --channel=2 --state=0 -b c

The software can control both Nexa and Conrad remotes, you have to specify which with the brand option. The --repeat it not necessary for me. It is either in range or not.

There is something wrong with the long version of the brand option, so use the short -b option for now.

Alvin

woodside
Posts: 16
Joined: Mon Oct 22, 2012 7:42 am

Re: PiHAT - Rasberry Pi Home Automation Transmitter

Fri Jan 25, 2013 6:57 pm

Hi Alvin
Thank you.
I might now look out a SAW filter now that I know it's working

Ken

Darra
Posts: 4
Joined: Sun Feb 03, 2013 8:52 pm

Re: PiHAT - Rasberry Pi Home Automation Transmitter

Sun Feb 03, 2013 9:17 pm

photo2.JPG
photo2.JPG (49.79 KiB) Viewed 11199 times
photo1.JPG
photo1.JPG (50.69 KiB) Viewed 11199 times
Hi!
Thanks for this innovative way to control NEXA switches.
Today i made modification of one NEXA NEYCT-705 remote control. I cut PCB line between code chip and RF part. Connected this line directly to raspberry IO port , connected minus to GND IO and get raspberry to modulate ASK directly to transmitter of remote control. This works nice.On pictures i send there is 2 resistors (820 ohm and 3.3K) that i made some experiments. I will put diodes instead. That iam trying is to still have remote control in function and mix raspberry code. Resistance on point i connected raspberry is app 600 ohm and remote control operates on internal battery 3V so there is not any problem with damage of IO port.
Is it possible to get RAW code out on raspberry output (without RF 144Mhz modulation) ????
Modify code???
Is there any way to make web based server to control this ???
Iam bad in linux software but i think this will be nice way to control NEXA.
My dream is to have also RX433 Mhz module connected to receive temperature sensors and IR transmitter to control airconditioning unit (in my case Mitsubishi).
For test of radio iam using SDR (DVB-T receiver ) connected to my PC to check signal level. SDRSHARP and Trekstore DVB-T (RTL2832 E4000 tuner) from kjell.com.
Thanks for this nice project .
Regards Dario

Moonie
Posts: 18
Joined: Wed May 30, 2012 5:31 pm

Re: PiHAT - Rasberry Pi Home Automation Transmitter

Mon Feb 11, 2013 10:34 pm

Help!

I can not get pihat to pair with my Status remotes

What am I doing wrong?

I have the antenna on gpio4, I have installed and run pihat however when running....

./pihat --brand=5 --repeats=50 --id=0 --channel=7 --state=1

It will not pair to the remote socket :evil:

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

Re: PiHAT - Rasberry Pi Home Automation Transmitter

Mon Feb 11, 2013 10:38 pm

How far away are the remote switches to your Pi??

Richard S.

Moonie
Posts: 18
Joined: Wed May 30, 2012 5:31 pm

Re: PiHAT - Rasberry Pi Home Automation Transmitter

Mon Feb 11, 2013 11:01 pm

About 2 meters

I have just tried it with the pi sat next to the remote socket, still will not pair

I get the following....................


pi@raspberrypi ~ $ cd pihat
pi@raspberrypi ~/pihat $ chmod +x pihat
pi@raspberrypi ~/pihat $ ./pihat --brand=5 --repeats=50 --id=0 --channel=7 --state=1
Usage: pihat [OPTION...]
Try `pihat --help' or `pihat --usage' for more information.

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

Re: PiHAT - Rasberry Pi Home Automation Transmitter

Mon Feb 11, 2013 11:20 pm

It's not working because it's not transmitting: - "Try `pihat --help' or `pihat --usage' for more information." would indicate a problem with the provided arguments.

The correct response should look something like:
root@raspberrypi:~/pihat# ./pihat --brand=5 --repeats=50 --id=0 --channel=7 --state=1
Tune to 144.64 MHz
0000000000000000000011110

Make sure you're running the latest version of pihat, earlier versions had a bug with the --brand option which caused it to fail.

Richard S.

Moonie
Posts: 18
Joined: Wed May 30, 2012 5:31 pm

Re: PiHAT - Rasberry Pi Home Automation Transmitter

Mon Feb 11, 2013 11:33 pm

Thanks for the information Richard

As you may be able to tell im quite new to all this!

I have PiHAT 0.1

Is there a newer version available?

Thanks

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

Re: PiHAT - Rasberry Pi Home Automation Transmitter

Mon Feb 11, 2013 11:38 pm

Yes pihat is now version 0.2 :)

To get the latest pihat use the "git" tool or sudo apt-get install git to install it and then...
git clone https://github.com/s7mx1/pihat
cd pihat
./pihat --brand=5 --repeats=50 --id=0 --channel=7 --state=1


Richard S.

Moonie
Posts: 18
Joined: Wed May 30, 2012 5:31 pm

Re: PiHAT - Rasberry Pi Home Automation Transmitter

Tue Feb 12, 2013 12:17 am

All working :D

Thank you very much for your help

ant_thomas
Posts: 115
Joined: Fri May 04, 2012 4:33 pm

Re: PiHAT - Rasberry Pi Home Automation Transmitter

Wed Feb 13, 2013 10:54 am

Using pihat 0.2 which is working well.

I'm running a script to loop through 196608 - 262143 to finally find my remote ID (currently upto 225450) but I've just had a thought. Mine are Status branded but I think they were bought from Morrisons, no Morrisons branding though. Am I looping through the wrong range? I hope not!

ant_thomas
Posts: 115
Joined: Fri May 04, 2012 4:33 pm

Re: PiHAT - Rasberry Pi Home Automation Transmitter

Wed Feb 13, 2013 11:47 am

Not to worry. I was looking in the correct range. ID found! Very happy.

If anyone wants to use my script they're welcome to....

Code: Select all

#!/bin/bash

for i in $(seq 196608 1 262143)
do
   pihat --brand=5 --channel=0 --state=0 --id=$i
   echo "$i"
done
Saved as remotefinder.sh and just run "sudo sh remotefinder.sh"

I had already copied the pihat binary to /usr/bin/

In my case I had a light plugged into the adapter and turned on and waited for the light to turn off.

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

Re: PiHAT - Rasberry Pi Home Automation Transmitter

Fri Feb 15, 2013 12:00 am

A looping script would work but it's time consuming which is why I wrote a simple Pascal program to decode the remote ID and commands myself (only takes a matter of seconds).
All you need is a WAV recording of the pulses sourced from either a non-AFC FM radio, telephone pickup coil or some funky hack on the remote control - anything to get audio into your computer.

As for pihat categorising the Status being Morrisons or Asda I'm not sure that's a good idea because there isn't enough statistical data to prove remote IDs are unique to each supermarket distro.
This all kicked off because pihat originally generated 16bit remote ID codes but my Asda Status remote control ID wasn't working with any 16bit number (0 to 65535).
After some signal analysis the pihat program was amended to provide the correct and longer 18bit remote ID code hence the really large messy numbers.

Richard S.

ant_thomas
Posts: 115
Joined: Fri May 04, 2012 4:33 pm

Re: PiHAT - Rasberry Pi Home Automation Transmitter

Sun Feb 17, 2013 11:18 am

redhawk wrote:A looping script would work but it's time consuming which is why I wrote a simple Pascal program to decode the remote ID and commands myself (only takes a matter of seconds).
All you need is a WAV recording of the pulses sourced from either a non-AFC FM radio, telephone pickup coil or some funky hack on the remote control - anything to get audio into your computer.
In my case I certainly found the looping script easier to do. Just a case of letting it run whilst I was doing other things in the same room. But yeah, I agree, it is very time consuming!
redhawk wrote:As for pihat categorising the Status being Morrisons or Asda I'm not sure that's a good idea because there isn't enough statistical data to prove remote IDs are unique to each supermarket distro.
This all kicked off because pihat originally generated 16bit remote ID codes but my Asda Status remote control ID wasn't working with any 16bit number (0 to 65535).
After some signal analysis the pihat program was amended to provide the correct and longer 18bit remote ID code hence the really large messy numbers.
I don't think categorising them is a good idea either. I was just wondering whether I was looping through the correct range, it turns out I was.

This isn't something I will be looking to doing for a good while, but what would need to be done to make PiHAT work with an RF wall/light switch? Is it simply a case of the switch/socket learning the signal you choose to transmit from PiHAT or will there need to be some sort of signal analysis required so PiHAT can be coded to support these devices? (I'm guessing the latter)

hekkenberg
Posts: 1
Joined: Mon Mar 25, 2013 8:28 pm

Re: PiHAT - Rasberry Pi Home Automation Transmitter

Mon Mar 25, 2013 9:19 pm

@alvinAvR

I bought a remote controlled socket from Maplins http://www.maplin.co.uk/remote-controll ... set-531547 Product Code: N78KA to achieve pretty much the same what everyone else is trying to achieve. Not knowing exactly how these remotes/sockets exactly work I spent ages trying various things that people have suggested. I had no clue about how these things work but having read this thread I know a hell of a lot more then I did before!

I opened up the remote (not socket) and noticed that the chip on the circuit board was also an SC5262S. Loaded with that I downloaded your coding and put the FM radio on and listened to the Raspberry PI transmit as well as the remote control. They both sounded identical (using your Conrad code).

I couldn't get it working initially but I had to put the raspberry PI near the remote socket (5cm) to make it work as I didn't had a wire attached. I can confirm that your coding for the Conrad works brilliantly with the Maplin remote controlled sockets.

For anyone trying to achieve the same thing, I misunderstood the pihat documentation with the groups. On the back of the remote socket there are two dials you can adjust. The top dial relates to the GROUP and the bottom relates to the CHANNEL that pihat refer to.

For example if you have the top dial set to 3 and the bottom to 1 then you pihat command/parameter would be:

Turn it on:
pihat -b c --channel=1 --state=1 --group=3

Turn it off:
pihat -b c --channel=1 --state=0 --group=3

I bought a remote and 1x socket for testing but you can buy a single for £7.99 (product code N77KA).

I am interested in getting a SAW filter and if there are a number of other people wanting the same SAW filter from UK Farnell (http://uk.farnell.com/epcos/b39431b3710 ... 1B3710U410) to achieve the same or similar thing why don't we all chip in together, good economies of scale.

Rick

SirAvalon
Posts: 4
Joined: Mon Sep 24, 2012 6:49 am

Re: PiHAT - Rasberry Pi Home Automation Transmitter

Wed Apr 03, 2013 11:58 am

Hi Guys,

I have just discovered this topic.
I have the Conrad plugs and everything works fine (btw, thanks a lot for adding Conrad plugs too!).
I was using a python script to control them, along with similar transmitter with the one here (http://www.hoagieshouse.com/RaspberryPi ... CPlug.html), the problem was that the PI needed to be on idle, any kind of load would have prevented the script to work.
Now I have tried this solution, with just the wire hooked up, and it worked, but only in the same room as the PI. I have tried different sizes for antenna and still the same. Also as I see it is recommended to use that specified filter, but I also checked the price, very cheap, but transportation cost was very high.
So I said let me give it a try with the 433Mhz transmitter and see what happens. And it's working, of course, and the range is quite better too.
I wanted to share with you because of course in this case you don't need the filter (cheap but hard to find), and the transmitter is quite cheap too and usually available everywhere since it's common accessory for arduino.

The connection is as follows: GND to Pi GND, V to 5V on the PI, Antenna ( I am using 10 cm wire), data pin to GPIO 4.

ant_thomas
Posts: 115
Joined: Fri May 04, 2012 4:33 pm

Re: PiHAT - Rasberry Pi Home Automation Transmitter

Wed Apr 03, 2013 1:14 pm

SirAvalon wrote:Hi Guys,

I have just discovered this topic.
I have the Conrad plugs and everything works fine (btw, thanks a lot for adding Conrad plugs too!).
I was using a python script to control them, along with similar transmitter with the one here (http://www.hoagieshouse.com/RaspberryPi ... CPlug.html), the problem was that the PI needed to be on idle, any kind of load would have prevented the script to work.
Now I have tried this solution, with just the wire hooked up, and it worked, but only in the same room as the PI. I have tried different sizes for antenna and still the same. Also as I see it is recommended to use that specified filter, but I also checked the price, very cheap, but transportation cost was very high.
So I said let me give it a try with the 433Mhz transmitter and see what happens. And it's working, of course, and the range is quite better too.
I wanted to share with you because of course in this case you don't need the filter (cheap but hard to find), and the transmitter is quite cheap too and usually available everywhere since it's common accessory for arduino.

The connection is as follows: GND to Pi GND, V to 5V on the PI, Antenna ( I am using 10 cm wire), data pin to GPIO 4.
Are you using PiHAT with the 433 MHz transmitter?


ant_thomas
Posts: 115
Joined: Fri May 04, 2012 4:33 pm

Re: PiHAT - Rasberry Pi Home Automation Transmitter

Wed Apr 03, 2013 3:59 pm

SirAvalon wrote:Yes!
Thanks, I didn't think of using my 433 MHz transmitter with PiHAT. The signal range has increased a lot by doing that!

Return to “Automation, sensing and robotics”