Pages: [1] 2   Go Down
Author Topic: Automated Home Lighting System  (Read 2077 times)
0 Members and 1 Guest are viewing this topic.
0
Offline Offline
Newbie
*
Karma: 0
Posts: 14
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Well, this is the first the online community has really heard from me, and after falling prey to the Arduino v0017 'not saving when it should' bug, i finally have something that works, and is always improving.

What it is:
The complete package (Called CNM Lighting Studio, because that sounds flashy smiley ) is to..
  • Remotely control appliances,lights and other things through a computer.
  • Then add some VB.NET software to make is user friendly, and its done.
The Pictures:





How it works:
When you click on each 'lighting button' I.E the one for the TV, the program sends a number relating to which button was pressed to the Arduino. So pressing button 1 means the software will send a '1' to the Arduino.
The Arduino knows that whenever it receives a '1' to set Pin2 to high for a second.
This imitates pressing the first button on the remote control socket.
What this means is that I dont have to deal with the complicated and expensive RC bit, i just buy it for £20. smiley
In addition, because i could, i made it beep whenever a light was switched on.

Software:
If enough people want me to, I will upload the VB.NET code.
All the software does is make the Arduino user-friendly. So bu clicking the 'Outputs' tab, you can edit the names of each output. However this does not affect the operation of the Arduino. There are 5 flags, which keep track of whether the output is on or off, when an output is on, the red fade on the button that is linked to that output goes green. Thats all it does smiley

Channels
Channels, are groups of lights.
Channel 1, named 'At the computer' will turn on the Air Conditioning and the reading lamp when activated. This means the user can just click the situation they want, and the lights and appliances will adjust themselves.

Alarms
Alarms are an idea i had, which meant that the internal buzzer will beep at a time set by the software. Nothing other to say really, but that its a nice feature. Intotal, there are 7 alarms,one for each day of the week.




Overall processes:
'User clicks on a button on the program'
'Software sends down a value (1-5)depending on what button they pressed'
'Arduino gets the number, and turns the allocated pin (2-6) on for a second'
'This high pin is conected to the remote, which immitates the user physically pressing the button'
'Light pops on or off'
smiley

Over All:
For £20 and an Arduino, its really great! I love this, and because i havent messed around with the mains parts, i feel confident to leave the system working.
The only drawbacks are that theres no feedback from the socket to say whether it has received the signal or not, so if for some reason the light doesnt come on, the software will think it is on (hence the 'Calibrate' button, which lets the user manually correct things).

I hope you like it!
i look forward to your feedback, suggestions and improvements for it!

Conor xxx

================================
Here are some links that were really vital for me on the way!
================================

http://www.codeworks.it/net/VBNetRs232.htm
http://arduino.cc/en/Reference/HomePage
and of course, this forum!
« Last Edit: April 13, 2010, 05:54:26 am by conanim » Logged

North Yorkshire, UK
Offline Offline
Faraday Member
**
Karma: 104
Posts: 5531
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Well this does encourage me to go and buy a load of those remote controlled sockets smiley

Looks like a good little program. Unfortunate about the lack of feedback but unless you wanted to implement your own rf link back to the arduino from each socket, there's not a lot you can so about that I suppose.

I am currently looking into integrating a wireless arduino into a light switch wall socket for controlling lights. Obviously this is more dangerous as it is using the mains lighting circuit but unfortunately, there's not an easy way to do it for main lights.

Mowcius
Logged

0
Offline Offline
Newbie
*
Karma: 0
Posts: 14
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Yes i see what you mean. To overcome this problem, i made sure that when an output was triggered, it was triggered for a whole second, so there is a good chance that the socket got the signal. Then the Arduino delays for a bit to stop repeated signals which could get lost smiley
But yes, that is a good way of overcoming it... I guess i could try that sometime soon smiley-grin

And good luck!
If you used these sockets, you could then use the relay in them for the switch. On top of that, the ones pictured have buttons on them, which turn the socket on and off, so that could be useful maybe?

Best,
Conor
Logged

0
Offline Offline
Newbie
*
Karma: 0
Posts: 40
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

conanim, one suggestion i have to work around the 'calibrate' issue is since you're talking over serial anyway is to send all the values back and forth over serial repeatedly between Arduino and the program. Something like 0:1:1:1:0:0:0, etc where each position corresponds to pin, the entire thing is a state then.
The Arduino should associate each one of those positions with a variable, then alter its digital out pins from those variables. It listens for the state string from the program, sets each pin var accordingly, and uses those pin variables as digitalWrite() values. Does this make sense?

It also sends that state back to the program (every second or so) and the program then also knows which state the Arduino is in. So if some button didn't register on the Arduino, it won't register on the program either and the user can just re-issue the command.

I hope I'm making sense. If you do this every second, it also has the added benefit of acting sort of like a heart-beat between the 2 systems. So if one of them doesn't get responses, it can alert you that there is something wrong, with a red LED or whatever on the circuit and some alert on the program.
« Last Edit: April 14, 2010, 01:02:40 pm by nemik » Logged

0
Offline Offline
Newbie
*
Karma: 0
Posts: 14
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

hi there smiley
 I see what you mean, and aggree that the 'heartbeat' idea would be really great for detecting errors smiley Thanks for that smiley

Where the calibration problems lie, is not in the communication between the program and the Arduino, but in the sockets themselves: the remote for the sockets doesnt have an 'off' and an 'on' button for each socket, it just has one button that reverses the state of the socket.

So, if the socket was unplugged, the program would register a signal had been sent, and the Arduino would have sent it, but the socket would still be off, when both programs think it should. Maybe I have better explained the calibration issue?

Thanks nemik for your feedback though, it is greatly appreciated smiley-grin
Conor xx
Logged

0
Offline Offline
Newbie
*
Karma: 0
Posts: 40
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

conanim, ahhh i see what you mean now, sorry i must have misunderstood. yea not sure if there is a good solution for that aside from the RF link already mentioned.

Good luck though, it's a cool project.
Logged

Phoenix, Arizona USA
Offline Offline
Faraday Member
**
Karma: 39
Posts: 5557
Where's the beer?
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

conanim:

Your project is interesting and simplifies many things that scare people off about interfacing with AC (which isn't as difficult as you think, you just have to understand what you are doing, and follow some safety precautions and some common sense).

As far as your "calibration" issue is concerned, there's not much you can do about that unless you want to hack the plug-in modules; I don't even think X10 has the ability to know when/if a module is truely on/off; its mostly a one-way protocol (at least in common use).

Like I said, though, you might think about hacking the modules; if you added addressable transceivers to each module, and a single transceiver to the Arduino (which you could alter its address with), you could communicate the status and such and have true control. Might be an interesting future project.

I suspect that those modules and the controller are using simple one-way RF transmitters/receivers; so on the receiver end, the plug is obviously (in some manner) powering them with a small bit of voltage stepped-down and rectified from the AC mains. You could power the transceiver for the plug off of this (most likely), and most of those transceivers tend to have a GPIO pin or two you can toggle with simple commands - that could be hooked into whatever is turning the plug on/off right now. Then, what you could do is wire a loopback from the RX to the TX on the transceiver, so that when you send a command to it (to turn off/on the GPIO), that command is immediately echoed back. If you don't receive that back from the transceiver (by sending the command from the Arduino then checking the receive buffer immediately thereafter), you know it is unplugged or somehow became unpowered. Simple plug monitoring. If you have two GPIO pins available, you could loopback those, too - and check the state of the second pin; if set, then you know that far up the chain that everything is working OK.

As far as implementing the interface - you may want to invest in a VARIAC; this is a special transformer which you plug into the wall, and it has a dial to adjust the voltage from 0 volts to full voltage (it is -not- typically isolated, though - so keep that in mind) - you could plug that in, then plug the module into that, dial up to 12 VAC or whatever that gets the current receiver module in the plug module to turn on, but not enough to power the plug (although it may still do so, depending on what it is using to switch and such - you could hook a small bulb up with alligator clips to do testing) - this way, you could play with the circuit and be relatively safe (rather than attempting to test using wall voltage). The only downside to a VARIAC is its cost; a simple and cheap one will cost around $75-100.00 US.

 smiley-sad

Hope this gives you some ideas and encouragement!

 smiley
Logged

I will not respond to Arduino help PM's from random forum users; if you have such a question, start a new topic thread.

0
Offline Offline
Newbie
*
Karma: 0
Posts: 14
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

hey cr0sh. 8-)
 I agree, it makes simple work of something that sounds very complicated, that is controlling appliances remotely and through a computer with user-friendly software.

I appreciate your wisdom on how i could incorporate feedback smiley .

This project originated from being simple and effective that you could do with confidence, and with the UK's voltage being 240v, not 110v its more dangerous to get a shock!
I will be re-MAKEing this project soon, and think i will keep the sockets untouched for now, and perhaps make each output trigger for 2 seconds rather than one to reduce the risk on lost signals smiley

What do you guys think of the software image?
Logged

Phoenix, Arizona USA
Offline Offline
Faraday Member
**
Karma: 39
Posts: 5557
Where's the beer?
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
This project originated from being simple and effective that you could do with confidence, and with the UK's voltage being 240v, not 110v its more dangerous to get a shock!

I understand that - certainly much simpler to do than attempting something with solid state relays or the like, and less likely to have something go wrong.

Here in the States as you noted our mains AC is at 110-120 volts; but our large appliance (air conditioning, dryers, ovens, water heaters) voltage is at 220-250 volts (with a much different plug); do you guys on the other side of the pond have a separate AC voltage for large appliances? Just curious...

Quote
I will be re-MAKEing this project soon, and think i will keep the sockets untouched for now, and perhaps make each output trigger for 2 seconds rather than one to reduce the risk on lost signals

That's probably a good direction to go; I think you (or anyone else) should hold off messing with the AC side of things until you have the experience, knowledge (both of when to do things and when NOT to do things), and understanding of safety methods to work with it. It isn't something to play with, as you know.

Quote
What do you guys think of the software image?

Personally, I think it looks pretty nice; I like the color scheme and your matching it to the plugs/controller. I think if you gave it a way to change the labels of the buttons, that would be a nice addition!

 smiley
Logged

I will not respond to Arduino help PM's from random forum users; if you have such a question, start a new topic thread.

North Yorkshire, UK
Offline Offline
Faraday Member
**
Karma: 104
Posts: 5531
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
do you guys on the other side of the pond have a separate AC voltage for large appliances? Just curious...
Nope but for workshop tools you will often find people have a seperate high current circuit. Everything normally runs on the 230v mains though.

Mowcius
Logged

0
Offline Offline
Newbie
*
Karma: 0
Posts: 14
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

ahh,the genius of quotes! I likes:D
Quote
That's probably a good direction to go; I think you (or anyone else) should hold off messing with the AC side of things until you have the experience, knowledge (both of when to do things and when NOT to do things), and understanding of safety methods to work with it. It isn't something to play with, as you know.
yes, this is true its not a good idea to mess with mains until you have experiance.For me though, im a bit scared actually. not scared, more VERY cautious,and Id rather mess with 5v arduino than mains smiley and yes, agreed smiley-grin
Quote
I think if you gave it a way to change the labels of the buttons, that would be a nice addition!
Thats possible on the 'Outputs' tab. When i redo it, the code will be here, promise. Just that it is quite scruffy at the moment. :-[
Logged

Phoenix, Arizona USA
Offline Offline
Faraday Member
**
Karma: 39
Posts: 5557
Where's the beer?
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
not scared, more VERY cautious

This is the right attitude to take in regards to all electricity; even that which you think or believe is "safe". Doing so will become habit, whether you are working with 1 volt peak-to-peak signals, or three-phase 480 volt @ 100 or more amp industrial-level voltages that would easily snake out and smoke your butt before you can holler.

 smiley-grin

Quote
Just that it is quite scruffy at the moment.

All software has a 0.1 beta version phase!

 ;D
Logged

I will not respond to Arduino help PM's from random forum users; if you have such a question, start a new topic thread.

0
Offline Offline
Newbie
*
Karma: 0
Posts: 14
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I will order a new enclosure, and some LED's and take some better photos soon.
And yes, its now out of Beta smiley-grin
Logged

0
Offline Offline
Newbie
*
Karma: 0
Posts: 9
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I alway want this but using the ethernet shield to control over the network smiley-wink
Logged

0
Offline Offline
Newbie
*
Karma: 0
Posts: 24
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

where did you get the socket adaptors from? 5 for £20 is a lot cheaper than i have found!
Logged

Pages: [1] 2   Go Up
Jump to: