Complete Beginner with an ambitious idea

The idea that I've got is being able to have the lights in my house controllable by an Arduino system.

I'm completely new to Arduino and have minimal experience in systems like this but from what I understand of what I've read so far I think it's possible to do what I want with Arduino.

In the image the [HUB] is the main Arduino board which will be connected to either a single wireless transmitter/receiver or a series of them aswell as an old netbook I've got lying about which will act as a control point and internet connection.

[HUB]
Main Arduino Board running [HUB] codes, which consist of the startup code which on first run and resets will ping all devices for their current state then run the live code which is what allows control of the devices aswell as data output to the UI and runs the listen/broadcast functions to the wireless devices: {pingAll} {pingID} {changeStateID} {check} {lightLevel#:#}

[Control]
Minor Arduino Boards running [Control] code, this will be a basic code that will track state and will be listening constantly for {pingID}/{pingAll} and {changeStateID} inputs wirelessly from the [HUB].

[Detector]
Minor Arduino Board running [Detector] code, this will be listening for a {check} command from the [HUB] and when it receives the command will run a series of 5 tests of outside light level at 2 seconds apart and broadcast back with the results {lightLevel#:#} (first value will be test number second value is light level)

[Computer]
Old Netbook that isn't much use for anything anymore but is good enough to run a simple UI in a cupboard somewhere while connected to the [HUB] to provide power and share it's internet connection. Also is the access point that will receive any commands from the web UI and output them as commands to the [HUB]. As part of the UI on the Netbook will also generate logs of when and how states are changed etc and output to a .txt file every 24hours and will overwrite every 14 days so that if an unintended person gains access to the web UI and is messing about with the lights it can be tracked when it's being done aswell as what type of device is being used to access the UI (computer, iPhone, andriod, etc) using a check from HTML5 for which CSS is being accessed as there will be a CSS for every common PC screen resolution and smart device resolution.

CrafDee1:
I'm completely new to Arduino and have minimal experience in systems like this but from what I understand of what I've read so far I think it's possible to do what I want with Arduino.

It should be possible, but the first requirement is to become familiar with Arduino programming and capabilities. There are many example programs with the Arduino IDE and many online tutorials.

I suspect, when you have learned a bit more, that the details of how you plan to implement the project may change and you need to allow for that.

The Thread Planning and Implementing a Program may give you some general ideas about how to approach a complex project as well as, more specifically, about how to plan an Arduino program.

I suggest, since you plan to have a PC as part of the project, that you use it to do as much as possible of the work because it is very much easier to program and debug a PC than an Arduino. Use the Arduinos only for what they are good at - interfacing with sensors and controlling things.

The distances over which wireless comms must work can be critical to the choice of wireless system.

...R

so... basically, your entire project is based on this line :

....run the live code......

I would like to get this printed on a coffee mug for you

http://tinyurl.com/hp836jn

I would have to jump to a lot of assumptions to get on the same page.

if you want to dim the lights, you need a local device to power the lights, some logic to know when to dim the lights and to what degree.

in your case, you want to have a remote master that you call a hub. to tell the remote (slave) when to dim.

it is assumed you are also sending back values from the slave.

all this is very mainstream for the Arduino.

dave-in-nj:
so... basically, your entire project is based on this line :

....run the live code......

I would like to get this printed on a coffee mug for you

Then a Miracle Occurs . . .: Image

My original post was already getting a bit long so I dropped some details that didn't seem essential for what the project as a whole is going to be intended to do but if you want me to elaborate that's fine too.

My understanding of coding primarily comes from the parts of HTML5 that I've been able to learn from youtube video's and self teaching through trial and error on a mod for minecraft called ComputerCraft which if memory serves runs using LUA and Forth, bare basics of javascript, limited C# from microsoft visual basic and the tutorials it ships with and are available officially on microsoft via the links at the end of the tutorials.

So my personal coding background out of the way onto what I'm planning to do. The slaves will most likely be Arduino Yún's connected to a relay that is capable of handling the mains electric that runs to the ceiling lights in my home, there will also be a push switch that will act as the manual input on the face of the light switch in place of the traditional switch. The way the Yún will be required to operate will be something along the lines of this:

void setup() {
  // put your setup code here, to run once:
case
	{when int 'lightState' == 0
		then run.transmit "state01:0"
		else run.transmit "state01:1"
	}
}

void loop() {
  // put your main code here, to run repeatedly:
while(digitalRead(pin) !=LOW){}

while(digitalRead(pin) !=HIGH){
	case
		{when int 'lightState' == 0
			then run.relayTriggerOn
				int 'lightState' + 1
				run.transmit "state01:1"
			else run.relayTriggerOff
				int 'lightState' - 1
				run.transmit "state01:0"
		}
	}
}

I know that isn't a properly functioning piece of code but I learn mostly through trial and error and as I haven't ordered an Arduino yet I can't do that yet I'm cobbling together coding etiquette and knowledge from several languages in the hopes that I get it right in a mostly unfamiliar language but I think it gives a pretty decent idea of what is intended for the final version once I research and trial it on a board after ordering some.

The master will be running corresponding code that will transmit to the slaves to trigger the relay when the UI is interacted with via the netbook or the web. It will also be running a clock process that can be set to output signals at set times. The third process will be listening for the signal from the light detector to say that the light is above or below the predetermined level outside. This code I don't even know how to begin and I don't know what I should try and run in parallel in the same code or in separate codes.

I'm not expecting miracles to just happen by plugging it in and hoping for it to instantly know what I want it to do, I said from the get go that I'm a beginner to these systems and was just wanting to know from people who know what they're talking about if it's something that's possible within the range of what the Arduino is capable of. I think I know enough little tidbits from other languages and their etiquette's to give me a decent start on this project and I know it's going to take a lot of trial and error and research/learning to accomplish it but isn't that part of the fun of the Arduino systems? Provide a fun platform for self teaching coding and getting a real result from it that's functional in real life applications?

dave-in-nj:
I would have to jump to a lot of assumptions to get on the same page.

if you want to dim the lights, you need a local device to power the lights, some logic to know when to dim the lights and to what degree.

in your case, you want to have a remote master that you call a hub. to tell the remote (slave) when to dim.

it is assumed you are also sending back values from the slave.

all this is very mainstream for the Arduino.

I'm not wanting to dim the lights just a simple on/off functionality and have their current state monitored, the part about light levels is just outside in the garden there's going to be a light detector connected to a slave that will transmit to the master when the outside light levels pass a certain point to turn the lights in the lounge, hallway and kitchen on/off.

Thanks for the input.

If you want to insert the image attached to your top post you can follow these instructions to do so.

Good luck with your project.

I trust you have a sense of humor : )

the way you described your project, you were over elaborating about the very first handshaking and not so much about the routine tasks.

I am happy to see you have very deep pockets and don't mind overspending on boards. Some times it makes your life easier that way. I think many of us would spend half of one YUN price for all the boards.

I would offer that if you wanted to tell us what you wanted and have us recommend how to do it, the components would be much different...

how many lights do you want to connect to each YUN ?

what sort of sensors do you want to use ?