Hardware Serial to Serial Communication using Arduino Uno & Mega

แชร์
ฝัง
  • เผยแพร่เมื่อ 9 พ.ย. 2015
  • 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/user/fish
    or here:
    www.mediafire.com/file/t4cw5me...
    and
    www.mediafire.com/file/18tbqu0...
    To view more of my videos please search for "Scott Mon" on TH-cam.
  • วิทยาศาสตร์และเทคโนโลยี

ความคิดเห็น • 27

  • @shawnmkandla7892
    @shawnmkandla7892 8 ปีที่แล้ว +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 5 ปีที่แล้ว

    This is awesome and super thorough, thanks!

  • @marcotinari2017
    @marcotinari2017 7 ปีที่แล้ว

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

  • @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?

  • @alvaromartin6301
    @alvaromartin6301 6 ปีที่แล้ว

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

  • @nghnino
    @nghnino 6 ปีที่แล้ว

    Very Informative well done sir!

  • @chandararanget7879
    @chandararanget7879 7 ปีที่แล้ว

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

  • @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

  • @danielaquino4442
    @danielaquino4442 5 ปีที่แล้ว

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

  • @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

  • @Splatschi
    @Splatschi 5 ปีที่แล้ว

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

  • @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?

  • @francescolaporta9704
    @francescolaporta9704 7 ปีที่แล้ว

    very nice, compliment! :)

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

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

  • @zhyrokidd7289
    @zhyrokidd7289 5 ปีที่แล้ว

    Thank you!

  • @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?

  • @adellafi1979
    @adellafi1979 5 ปีที่แล้ว

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

  • @mbd6551
    @mbd6551 7 ปีที่แล้ว

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

  • @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?

  • @dahlendo7513
    @dahlendo7513 5 ปีที่แล้ว

    Thanks

  • @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

  • @budpatterson8357
    @budpatterson8357 5 ปีที่แล้ว +1

    The LEDs have no resisters