:::: MENU ::::

Delays could be very important: Making two Arduinos talk

Ardunio is an interesting easy-to-programme microcontroller platform which anyone can use it to bring their ideas into reality. I’ve been using them for more than 2 years now in my projects (both hobby and job related), and found them extremely handy for prototyping. Highly recommended for anyone trying to build things on his own.

Recently I was developing a prototype for a potential startup, and found myself using them. It turns out that I’ll have to use two Ardunio’s Uno boards (just google if you don’t know what they are) altogether, and let them share data among them. To start of with I followed this video, and went around building my application. Turns out that I cannot receive or send data!!!?

After two sleepless nights, I discovered that the problem is in ‘delays’ I am defining in my code to communicate over the Serial. And here is math explaining why-

In my case I started serial connection at baud rate of 115200, and I was transferring 8-bit characters which eventually make a string. So time required to transfer an 8-bit character at 115200 bit rate, you need at least delay of-

Delay_min= 115200/8

Thus, when I gave the delay of 14.4 ms and above, my ardunios started communicating well [in adruino code, delays are defined in milliseconds].

P.S. – The schematic do not show serial communication which was used in this project, but shows I2C protocol for connecting two Arduinos .


Leave a Reply

Your email address will not be published.