Go Down

Topic: synchronising multiple arduino's  (Read 222 times) previous topic - next topic

wddepooter

Hé everybody,

I have a question that is breaking my head at the moment, it's probaly easy, but I (a newbie) haven't found a solution yet.

I have two Arduinos running a small led program with a photocell switch.
Arduino 1: If it gets dark, the led starts blinking in a pattern. (2sec on, 2 sec off in a loop)
Arduino 2: If it gets dark, the led starts blinking in a pattern. (2sec on, 2 sec off in a loop)

The problem is that both arduino don't start at the same time, simply because there is (or will be in the future project) not the same light in both locations.

The catch: in the future project all arduino will be stand-alone: battery, arduino, solarpanel, led.
So I can't connect them together with a wire, or make one Arduino control mutiple lights.

My thoughts so far:
I allready have build and tested both arduino with the photocell with an blink program that is on a loop until the value of photocell gets above a certain level. I need to program the arduino in a way, that it will keep polling the photocell, but when a signal is given to a digital pin, the light restarts it's sequence. If mutiple arduino get the signal on the same time.... synchronised.

The other option. I use a timechip and couple the blinkpattern to time and send a signal to synchronise the clocks.

I don't need a code written for me, just where is should look. Or a sparring partner. If you have a better way to get this done, yes please!

In the final system there will be multiple (50 or more) stand-alone lights that need to blink synchronised.

Important: low consumption. the lesser, the better.

Grumpy_Mike

Quote
In the final system there will be multiple (50 or more) stand-alone lights that need to blink synchronised.
First off I would question the use of so many Arduinos it is rarely needed and is a common beginners error.

If you do have multiple Arduinos then they has to be some method of communication with them all, you can not depend on then keeping in synchronicity for long.

If they are in separate locations then why do they need to be synchronized anyway?

wddepooter

I'm trying to make a test for a marine bouyage system. All bouys have lights with the same character. example ISO (2s) -> 1 second on 1 second off. There is a long wish to synchronise them.
I'm still figuring out the means of communication because, allthough there is a clear line of sight to most of them, they will be more than 500m apart in real life.

CrossRoads

Put a battery backed RTC in them that has little drift (DS3231 for example).  Set all the clock times on shore in your lab before installing them in the bouys.
Designing & building electrical circuits for over 25 years.  Screw Shield for Mega/Due/Uno,  Bobuino with ATMega1284P, & other '328P & '1284P creations & offerings at  my website.

Grumpy_Mike

Put a battery backed RTC in them that has little drift (DS3231 for example).  Set all the clock times on shore in your lab before installing them in the bouys.
They will still drift out, it's one of those fundamental laws. You could use a GPS reciever on each one to synchronize each one.

wddepooter

That last option crossed my mind as well. Crossroads' option has been tested, but after a day or two you start slight difference in pattern. I was thinking if it would be a good idea to fire up the GPS chip hourly and after it has a accurate fix, it resets the clock on the light character. I think this system, if properly set, could be standalone without communication needed between the bouys.


./tis is futuretalk, might be offtopic, sorry for that
Also 'cause I want to work to a 2-way communication protocol. I was wondering if a tcp/ip network will be possible with every bouy as a node. So I can make a reportingsystem that gives information to a central station (i.e. my laptop) e.g. energystatus (powerdraw/battery/solar) collisonwarning (a G-sensor) a drift alarm (bouy is "x"meters away from "set" position) meaurements like depth/watertemp/watercurrent, etc.
But again, powerconsumption is a huge issue and I'm still wondering about communication between the bouys.

Grumpy_Mike

It sounds like you want a mesh network like Xbee or Zigbee.

Go Up
 


Please enter a valid email to subscribe

Confirm your email address

We need to confirm your email address.
To complete the subscription, please click the link in the email we just sent you.

Thank you for subscribing!

Arduino
via Egeo 16
Torino, 10131
Italy