Hardware Serial to Serial Communication using Arduino Uno & Mega

Sdílet
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.

Komentáře • 27

  • @marcotinari2017
    @marcotinari2017 Před 7 lety

    Very instructive.... Great video! Thank you.

  • @shawnmkandla7892
    @shawnmkandla7892 Před 8 lety +3

    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 Před 5 lety

    This is awesome and super thorough, thanks!

  • @danielaquino4442
    @danielaquino4442 Před 5 lety

    Thank you so much sirr, i learn a lot. I appreciate this video

  • @alvaromartin6301
    @alvaromartin6301 Před 6 lety

    Tome su like buen hombre. Muy ilustrativo el video :D

  • @nghnino
    @nghnino Před 6 lety

    Very Informative well done sir!

  • @Mrpepito1989
    @Mrpepito1989 Před 7 lety

    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?

  • @elmacho5153
    @elmacho5153 Před 6 lety

    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?

  • @jaimestuardo4655
    @jaimestuardo4655 Před 4 lety

    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?

  • @andyt1313
    @andyt1313 Před 5 lety

    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

  • @Splatschi
    @Splatschi Před 5 lety

    What would be the C++ Code independend of the Arduino IDE? For example in Visual Studio

  • @francescolaporta9704
    @francescolaporta9704 Před 7 lety

    very nice, compliment! :)

  • @paulwilkie5350
    @paulwilkie5350 Před 5 lety

    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

  • @zhyrokidd7289
    @zhyrokidd7289 Před 5 lety

    Thank you!

  • @pijushdutta7432
    @pijushdutta7432 Před 7 lety

    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..

  • @chandararanget7879
    @chandararanget7879 Před 7 lety

    Hi Scott Mon, what do serial.flush and serial1.flush work in here??

  • @satchelfrost6531
    @satchelfrost6531 Před 6 lety

    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.

  • @budpatterson8357
    @budpatterson8357 Před 5 lety +1

    The LEDs have no resisters

  • @Tabak4u
    @Tabak4u Před 6 lety

    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 Před 6 lety

      If you just need more digital pins, have you considered using a shift register chip instead?

  • @mbd6551
    @mbd6551 Před 7 lety

    can you help me? how about esp8266 and Arduino uno communicate together

  • @dahlendo7513
    @dahlendo7513 Před 6 lety

    Thanks

  • @adellafi1979
    @adellafi1979 Před 5 lety

    Could you please send me the schematic of the circuit? I wanna use it in my project

  • @638hrifjeonf
    @638hrifjeonf Před 8 lety

    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