2

I want to make two or more boards to blink an LED at the same time (within 1 ms difference) The boards cannot be connected with wires to each other and will be located in different rooms. How can I do this? What components do I need?

  • What is the cycle time? Is it okay if they sync every second or so? Or do they have the have the same value returned for millis()? In the first situation you can just send a "pulse" every second. In the latter you'd need to send some actual data, which makes it slightly more complicated. Definitely go with RF. There are some very cheap 433Mhz transmitters and receivers on the market. One arduino will be the master and send. The other boards will have a receiver. – Gerben Aug 15 '14 at 18:50
  • @Gerben I want the LEDs to blink in a fixed time interval (say every minute interval). If the time difference between multiple boards blinking remains within 1ms, then the sync cycle can be every minute or more. – zud Aug 16 '14 at 8:38
  • 1
    <1ms difference in 60 seconds, means around 17ppm. The crystals on the arduinos have a much higher deviation. So syncing every minute would not be enough, or you have to take the time-difference between 2 syncs and adjust your delays accordingly. Alternatively you could use the internal 8mhz oscillator on the atmega, instead of the crystal. The internal oscillator can be adjusted relatively easy. That way all the boards run at around the same frequency, and every minute any accumulated deviation is reset. – Gerben Aug 16 '14 at 12:25
  • 1
    Could you tell us WHY you want them to blink simultaneously in different locations? If we know we can help you better. – Tom Nov 13 '14 at 12:33
  • @Tom It is for synchronization of multiple devices – zud Nov 13 '14 at 13:56
1

Have both sync to a master clock using GSM shields. These shields are getting very cheap (as low as $14 on ebay).

The shields receive the time wirelessly from the cellular network and this time base is extremely accurate. Here is some example code to read the current time from the shield...

http://forum.arduino.cc/index.php?topic=163155.msg2102141#msg2102141

Note that you will need a SIM card to get the time, but you should not need an active cellular account.

1

You can also use real time clock (RTC) modules to syncronize arduinos. These are cheaper than other solutions like GPS or WiFi.

0

You could certainly do it with multiple Arduinos, each with a WiFi shield, but that would cost a lot of money.

Instead I would suggest building a low power radio transmitter that sends simple morse code clicks, and then building amplifier boards that use the clicks to trigger LED blinks. You'd need to use a frequency that is open for low power use in your country, like the range for garage door openers.

I've seen circuits in old electronics kits for building morse code transmitters, but they might not meet current FCC regulations.

  • 1
    1ms synchronization with WIFI is by no means "certain". It may be possible, but having tried to do that, it's actually rather tricky - especially if there is a router in between, packet latency can vary widely. Nor is a simple on-off-keying demodulator likely to yield nice results, as it will be very subject to interference. However it could possible be used as input to a software phase locked loop - a local timer which would over time speed up or slow down if it found that the radio pulses it did detect tended on average to be a little earlier or later than expected. – Chris Stratton Aug 15 '14 at 15:30
  • 3
    Ultimately, some of the simple SPI-interfaced 2.4 GHz RF chips/modules probably could provide a solution - nrf24L01 type stuff - which is cheaper, easier, and less likely to false trigger in the presence of interference than a DIY RF link. Either a software PLL, or a series of "count down" messages could be used to bridge missed messages. – Chris Stratton Aug 15 '14 at 15:33
  • @ChrisStratton, those are cool, and cheap too! (voted). Point taken about the home brew radio transceiver. You'd need to make an FM transmitter and receiver using PLLs, and that would take quite a few components. Why not post you suggestion as an answer? Seems like the best solution. – Duncan C Aug 15 '14 at 19:15
  • Although I was suggesting building one Arduino-based transmitter and a bunch of analog radio receiver based LED flashers. The nrf24L01 solution would require an Arduino per flasher, so the total cost per receiver would be fairly high. Could you rig those up with an ARTiny? – Duncan C Aug 15 '14 at 19:18
  • With efficient programming, yes, it should be able to be done with an ATtiny85. And even an ATmega328p isn't that expensive, nor does it require more support components. Much of what you pay for in an "Arduino" is the USB interface, PCB, power circuitry, connectors, etc. – Chris Stratton Aug 15 '14 at 20:30

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.