Hi guys,
I was thinking about making the lights in my apartment work on either wireless or
wired but controllable from a raspberry pi.
From what I can gather, my lights are all on a single circuit, so I can't just place one switch
and make it do the work.
I don't want to do for a full make-over as the apartment is only two years old, and
I'd like to keep the budget relatively low if possible.
I was thinking of using something like this :
But I have no idea if it would be doable to open the controllers, change the manual switch to an electronic one and
place them all somewhere in a box.
Or maybe it would be better to switch the wall switches to electronic ones.
I'm looking for general ideas, afterwards I'll work out a project and post it as well.
Any ideas or suggestions ?
Hi
You ideally want to decide where you are going to switch this from If you want all the lights on then you are looking at doing this from the consumer unit in which case you use Rs485 protocol
I'm assuming you want to still use the RPI although you can also do this via ESP8266 , ordinary arduino although Im not 100% sure of how stable this is
How ever taking the above points into account you then need to decide on the following
Network connection type , wireless , power line , hardwired via cat5 , Zigbee or other
Conversion from one protocol to another TCP-IP To Rs232 to RS485 I would think in your case
Type of hardware required for interfacing
Safety systems , battery back up what do you do in event of power going down start up sequence etc etc
Back up systems , UPS battery , etc
Controller interface
This might be mobile phone , web interface , Infra red remote , LCD touch screen , desktop / tablet application
1:
Software your going to use
Android
Java
C++/C
QT
Python
Encryption if any although that could be entirely your own
Here is one such example you can view on face book that I've been experimenting with for demonstration purposes using UDP , Serial ports , Arduino Uno simply to drive leds I could change this to independent relays , Triacs if you prefer solid state
I could also add to this or change this to PWM for lighting dimming sequences similar to DALI Lighting protocol
Or You could implement that yourself on RPI
You can watch the video from this address below
Unfortunately for some unknown reason there does not seem to be facility to upload videos directly for you or I could make this very interesting and write a full blown article this too
Alas I am awaiting on one of your site managers eedam or similar to contact me with reference to writing such articles with suitable mutually agreeable arrangements although I have left a few message so far
Never the less here is the outline of what ive been experimenting with myself
I have done similar with Bluetooth modules , Android , Java with Arduino as well which really does work well and is reliable
https://www.facebook.com/mark.harrington.142892/videos/2374239349488740/
From RS232 and then you only need add RS485 conversion module
Here is the rest of the code you can play with
**** Here is this code at git hub ******
https://github.com/markh2016/QTBinaryCounter.git
This is the code for the Arduino
Right at the bottom of this comment is address for code at github for the UDP Receiver
There are also two photo's for those who would like to try this out showing connections connections to Arduino
byte byteRead;
void setup()
{
DDRD = B11110000 ; // make all upper nibble port d Outputs
DDRC= B00001111 ;
Serial.begin(9600);
}
void outPorts(byte val)
{
byte lowNibble = 0x00 ;
byte hiNibble = 0x00 ;
lowNibble = val & 0x0F ;
hiNibble = val & 0XF0 ;
PORTD = hiNibble ;
PORTC = lowNibble ;
}
void loop()
{
if (Serial.available() > 0) {
// read the incoming byte:
byteRead = Serial.parseInt();
outPorts(byteRead) ;
}
}
The address for the code at github for the udp client as below
https://github.com/markh2016/udpclient.git
I've included layouts for this simple project plus schematic for you to experiment with