Hardware Serial to Serial Communication using Arduino Uno & Mega
Vložit
- čas přidán 8. 09. 2024
- 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 CZcams.
Very instructive.... Great video! Thank you.
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.
This is awesome and super thorough, thanks!
Thank you so much sirr, i learn a lot. I appreciate this video
Tome su like buen hombre. Muy ilustrativo el video :D
Very Informative well done sir!
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?
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?
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?
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
What would be the C++ Code independend of the Arduino IDE? For example in Visual Studio
very nice, compliment! :)
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
Thank you!
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..
Hi Scott Mon, what do serial.flush and serial1.flush work in here??
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.
The LEDs have no resisters
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
If you just need more digital pins, have you considered using a shift register chip instead?
can you help me? how about esp8266 and Arduino uno communicate together
Thanks
Could you please send me the schematic of the circuit? I wanna use it in my project
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
Q
si09 a
?
Cool 😎