Basic logic of transfering data.

Hi Arduino guys.First of all sorry for my English grammar.Iam working on project like ,,inteligent house,,.I am trying to make termostats for every room separetally out of Atmega 328P(UNO) + GLCD128x64(with touch panel).Centre of any inputs and outputs should be MEGA2560 .I want update data from MEGA to UNOs every 2min.1st minute MEGA to UNO.2nd UNO to MEGA.That 1min will be my timer for a clocks too.I2C communication between them is impossible,casued by long cable(I thing) up to 14 meters.I would like to send basic data to UNO like:outside temperature,outside humidity.UNO should send : actual room temperature,set room temperature.All these should be works with two wire ,,technology,,.I need help how to mannage it.For now Iam thinking to use very similar to I2C,but very slow based on my logic.There is 11 Termostats that means 22 I/O pins.Basically I have ideas how to run it right,but the skecth will be a lot of writing.Can somebody give a push to get it done.Thank YOU.

Can somebody give a push to get it done.

Come here. Stand right on the edge. I'll give you a push. 8) You must have some code that collects sensor data now. We need to see that code.

If the Mega is the central collection point, what is it sending to the Unos? What does it need from them?

How will you know that exactly one minute, or two minutes, has gone by? Why do the Mega and Uno need to be in sync?

Why 22 pins? Can't you do a broadcast from the central unit to update the thermostats, and then call off the results from the individual thermostats sequentially?

AWOL: Why 22 pins?

22 pins are needed with my very basic logic.

Can't you do a broadcast from the central unit to update the thermostats, and then call off the results from the individual thermostats sequentially?

How I can do that?

By giving each one a unique address, so looking like a slow I2C

How many thermostats are connected to each Uno?

If you only have one Uno why bother having the Mega as well.

If you need more pins why not use the Mega for that role?

...R

Each UNO will be together with GLCD one thermostat.MEGA should sending data like outside temperature and recieving data like set room temperature.I have enough pins,but I am asking for any other option(easier).One minute update is only my actual thinking.

Does it really matter, in the context of environmental controls, if all the sensors don't all update the master at the same time?

AWOL:
By giving each one a unique address, so looking like a slow I2C

Slow I2C? How?

Like real I2C (open drain, pull-up resistors), but at a slower clock rate.
Maybe even sample the data line several times in each clock period.

How much data do you envisage per station, per frame?

I dont know how to count them.For now only temperature and humidity.

AWOL: Does it really matter, in the context of environmental controls, if all the sensors don't all update the master at the same time?

No,it doesnt.I have only one way how to make it,but is a lot of lines ofsketch.

I'm not sure how you plan to send the data between the various Unos and the Mega, but for what I am going to say it doesn't really matter.

I suggest you arrange for the Mega to send a message to each Uno in turn and then listen for a reply. That way there is an organized system that is easy to control. Each Uno can have some unique "address" so even if they all hear the message only the correct one will reply.

By the way there are cheaper options than a Uno if you need a lot of them.

...R

It is not gonna be UNO,only Atmega328 used as a display controller,ADC,and sender of data.I will burn them only with UNO.I want to use two digital pins.One as a ,,clock,,(if will be HIGH UNO will write a blinks powered by another pin as a number like 0111000).If one of the pins will be LOW,MEGA will write a blinks as a number like 0111001.That is it .A lot of skecht of ,,ifs,, can do what I want.Is there in programming any other options????Thanks.

If you are talking about a wired connection between the devices then I suggest you look at the existing wired comms systems such as I2C. Much easier than reinventing the wheel.

I'm not sure if you could get effective electrical signals if you wire several serial connections together and ensure that only one transmits at any one time. If so that would be simple.

...R

Thanks for a reply.I think you havent read my posts.14 meters long cables are problem connect them via I2C.

14 meters long cables are problem connect them via I2C.

That’s a problem if you run I2C at 100kHz.
What if you run it at, ooo, I don’t know, say, 1kHz?

So I2C can easily runs at low frekvention throught long distances?

I have no idea, but won't it be fun finding out?