Тёмный

Hardware Serial to Serial Communication using Arduino Uno & Mega 

Scott Mon
Подписаться 1,8 тыс.
Просмотров 79 тыс.
50% 1

This video clip shows how to connect an Arduino Uno and Arduino Mega using the HARDWARE tx and rx communication configuration. The Mega is the master sending commands to the Uno. After the Uno executes the command it will send an acknowledgement back to the Mega via a buzzer tone connected to pin 9 on the Mega. The Mega Serial Monitor will wait for input from the user and depending on the users menu selection, will process each command option.
Key items to note...
First, the Uno and Mega share power so when the Mega is plugged into the pc BOTH boards are powered up. Second, communication between each board does NOT require an end-of-transmission character. The numeric menu option is broken down into high and low bytes and then reassembled after transmission. Third, the Serial Monitor waits for the user to input a menu option before proceeding. Lastly, the receiver (Uno) sends an acknowledgment back by playing a tone using the buzzer connected to the Mega.
Side note...
I was able to connect 2 USB cables, one to the Uno (on COM5) and one to the Mega (on COM10) which allowed me to view the data being sent and being received after transmission.
Golden rule...
Don't forget to reverse the tx and rx wires when connecting to each board!!
You can download the code here...
codebender.cc/...
or here:
www.mediafire.c...
and
www.mediafire.c...
To view more of my videos please search for "Scott Mon" on RU-vid.

Опубликовано:

 

17 сен 2024

Поделиться:

Ссылка:

Скачать:

Готовим ссылку...

Добавить в:

Мой плейлист
Посмотреть позже
Комментарии : 27   
@shawnmkandla7892
@shawnmkandla7892 8 лет назад
Hey man, just a quick question. Do you have to run both sketches, or open both but run the Serial to Serial Mega, sketch. I'm having trouble sending and receving info from the uno, but input from the Mega is working fine.
@LoquaciousStar
@LoquaciousStar 5 лет назад
This is awesome and super thorough, thanks!
@Mrpepito1989
@Mrpepito1989 7 лет назад
Hey Scott, are you farmiliar with doing this with more then two Arduino's? I'm looking for a way to make a wires mesh-type network and don't have the pins available for i2C communications so this might be the trick, but will it work with more then two?
@marcotinari2017
@marcotinari2017 7 лет назад
Very instructive.... Great video! Thank you.
@elmacho5153
@elmacho5153 6 лет назад
Hey, I made an ultrasonic sensor with a pager motor for vibration to help with detection. However, the motor keeps running even if there is nothing in front of the sensor. And, the sensor doesn't detect any objects or distance. What should I do?
@paulwilkie5350
@paulwilkie5350 5 лет назад
Scott, here can i obtain your sketch for this board to board communication? I have successfully created a sketch using Software Serial; however I would like to use Hardware Serial to communicate with a GPS Rx and a TxRx LoRa Radio for faster processing. Thank you, Paul Wilkie
@andyt1313
@andyt1313 5 лет назад
Electronics Noob here. I just bought a Mega and want to do a very simple serial transmint (TX) to a media player (MedeaWiz Sprite) that is designed to receive this kind of simple serial communication, it has an adaptor to connect wires directly to it's TX/RX ports. My question is, what is the distance I can transmit the signal from the Arduino (TX) to the Media Player (RX). I want to transmit between 50-100 ft. If there are any other trick or tips you have I'd be glad to hear them. Thanks
@jaimestuardo4655
@jaimestuardo4655 4 года назад
Hello... I have connected the PC to monitor RX and TX pins and sent AABB from the sketch. And I received 0x5F 0x5F 0xAF 0x2F. I am powering Arduino using 12 VDC. The same data is received if I connect RX and TX pins to a TX and RX inputs of an IP Modem, which uses TTL levels. Both ends are working at 115,200bps and 8N1. What may be going on?
@Splatschi
@Splatschi 5 лет назад
What would be the C++ Code independend of the Arduino IDE? For example in Visual Studio
@chandararanget7879
@chandararanget7879 7 лет назад
Hi Scott Mon, what do serial.flush and serial1.flush work in here??
@nghnino
@nghnino 6 лет назад
Very Informative well done sir!
@alvaromartin6301
@alvaromartin6301 6 лет назад
Tome su like buen hombre. Muy ilustrativo el video :D
@pijushdutta7432
@pijushdutta7432 7 лет назад
hello sir..my both boards are uno..and i used #include to define (4,5)as rx tx in master uno..but didnot get any ackowledgement from slave uno..
@satchelfrost6531
@satchelfrost6531 6 лет назад
So I understand almost all of the code, and I definitely get the logic, I'm just not understanding why there has to be an upper and lower byte. For example, why not just send one byte and then on the receiving end if the byte matches a predetermined value execute further instructions? What's with the whole upper and lower byte thing, and why do you multiply the upper byte by 256 and add the lower. I'm familiar with binary but I'm still not following.
@danielaquino4442
@danielaquino4442 5 лет назад
Thank you so much sirr, i learn a lot. I appreciate this video
@Tabak4u
@Tabak4u 6 лет назад
pls I need to connect two Arduino Mega together with the intention to just use the second one to extend the number of digital port for my application. How do i go about the physical and code connection? Thanks sir
@allthingsengineering2951
@allthingsengineering2951 6 лет назад
If you just need more digital pins, have you considered using a shift register chip instead?
@budpatterson8357
@budpatterson8357 5 лет назад
The LEDs have no resisters
@francescolaporta9704
@francescolaporta9704 7 лет назад
very nice, compliment! :)
@mbd6551
@mbd6551 7 лет назад
can you help me? how about esp8266 and Arduino uno communicate together
@zhyrokidd7289
@zhyrokidd7289 5 лет назад
Thank you!
@adellafi1979
@adellafi1979 5 лет назад
Could you please send me the schematic of the circuit? I wanna use it in my project
@638hrifjeonf
@638hrifjeonf 8 лет назад
i am trying to turn on an LED on one UNO using another UNO. however when i connect the serial ports it wont accept any information into the serial monitor?? please help
@gladiscasanasacosta2138
@gladiscasanasacosta2138 8 лет назад
Q si09 a
@638hrifjeonf
@638hrifjeonf 8 лет назад
?
@AzimyPc
@AzimyPc 6 лет назад
Cool 😎
@dahlendo7513
@dahlendo7513 6 лет назад
Thanks
Далее
Bike Vs Tricycle Fast Challenge
00:43
Просмотров 7 млн
Serial Communication with Arduino - The details!
16:51
Using an Oscilloscope and an Arduino
46:17
Просмотров 22 тыс.
Looking at the Mega 2560 multiple serial ports
14:51
Просмотров 1,5 тыс.
The RS-232 protocol
26:10
Просмотров 838 тыс.
Arduino Serial Communication using UART
15:33
Просмотров 157 тыс.
Serial Communication between two Arduino Boards
5:35
Просмотров 178 тыс.
Bike Vs Tricycle Fast Challenge
00:43
Просмотров 7 млн