Serial Communication between two Arduino Boards

Поділитися
Вставка
  • Опубліковано 9 січ 2025

КОМЕНТАРІ • 63

  • @alireza0994
    @alireza0994 Рік тому

    Bro you don't know how many hours I'm attending to do this and it doesn't worked. With your video I fixed it and now I can send a huge json fron node mcu to arduino uno . Big thanks brother❤❤❤❤❤

  • @oleksandr_ivankiv
    @oleksandr_ivankiv 3 роки тому +4

    For Arduino Leonardo must use "Serial1" port for TX/RT, and "Serial" port for println() function.

  • @skylerjohnson9089
    @skylerjohnson9089 5 років тому +2

    exactly what i was looking for!

  • @baseladams280
    @baseladams280 5 років тому +3

    This my solution to send strings from Arduino to the next one:
    Sender code:
    String str = "This is my string and Basel is Cool :)";
    int str_len = str.length() + 1;
    void setup() {
    // Begin the Serial at 9600 Baud
    Serial.begin(115200);
    // Prepare the character array (the buffer)
    char char_array[str_len];
    str.toCharArray(char_array, str_len);
    Serial.write(char_array, str_len); //Write the serial data
    }
    void loop() {
    }
    Receiver code:
    char mystr[50]; //Initialized variable to store recieved data
    void setup() {
    // Begin the Serial at 9600 Baud
    Serial1.begin(115200);
    Serial.begin(115200);
    }
    void loop() {
    //String msg = "";

    if(Serial1.available() > 0){
    while(Serial1.available() > 0){

    Serial1.readBytes(mystr,50); //Read the serial data and store in var
    }
    String rec;
    rec = String(mystr);
    Serial.println(rec); //Print data on Serial Monitor

    }
    }

  • @nahomghebremichael1956
    @nahomghebremichael1956 6 років тому +6

    Sir can you show as how to transmit an analog signal serially between two Arduino using xbee s2c.
    Thank you

  • @alejo3157
    @alejo3157 5 років тому +1

    ¡muchas gracias saludos desde Colombia!

  • @jenishj8136
    @jenishj8136 3 роки тому

    Tq for u r information bro keep it up

  • @troyyanda6896
    @troyyanda6896 2 роки тому +2

    Can this be used to send analog information from one arduino to another, for instance, an analog read of a joystick?

  • @ebk_72
    @ebk_72 4 роки тому +2

    Can I send more than one value from the sender to the receiver?
    Let's say I want the receiver to send the value of the water level and the temperature to the slave arduino so it can control the heating and motor.
    It would be simple for the master to just send a "confirmation text" using an if else statement and if the conditions match send a single value to "give order" to the slave arduino. But out of curiosity is there a way that I can send the two values from the master to the slave and let it operate the conditions?

  • @reincwan
    @reincwan 2 роки тому

    Why you use pin GND if the serial communication just need the TX pin and RX pin.. I'm curious about the use of the GND pin there

  • @kyro6564
    @kyro6564 Рік тому

    will it work without the common ground as well?

  • @navneetbrar1605
    @navneetbrar1605 3 роки тому

    Sir can send and receive simultaneously at same time with Arduino.

  • @Shakespeare1612
    @Shakespeare1612 6 років тому +1

    I am trying to do this with an arduino Nano, as the sender and a pro micro as the receiver. It seems that everything is working except for the inter-arduino communication. I can see the "hellos" coming out of the nano on the serial monitor, I can also see the TX light flashing. I can see the pro-mico able to send data to the serial monitor, if I switch to that com port, for a moment, I put in a test message. But I am still not getting any data coming all of the way through.

    • @wilksajs
      @wilksajs 5 років тому

      do you know the answer now? i have the same problem. i can't communicate arduino uno and pro micro by TX, RX

  • @glydrfreak
    @glydrfreak 5 років тому +1

    Would this not work between an adafruit feather m0 and an adafruit feather 32u4 for some reason? I copied the code directly, and can not get it to work.

    • @wilksajs
      @wilksajs 5 років тому

      do you know the answer now? i have the same problem. i can't communicate arduino uno and pro micro by TX, RX

  • @hendihart5195
    @hendihart5195 4 роки тому

    Thx, this is the one im looking for.
    Unfortunately ur site cant be open anymore, sad

  • @JoeEvansSound
    @JoeEvansSound 5 років тому +3

    Great. Nice easy and simple instructions - good job :¬)

  • @kierrennoeloribello7709
    @kierrennoeloribello7709 3 роки тому

    Is it possible for a single Arduino to send multiple serial data (from its modules ) to PC?

  • @nobody2254
    @nobody2254 5 років тому

    I’ve got a question: when using wired serial communication; will this make other serial communications unavailable? Let say i need an Arduino UNO to Communicate with an Arduino Nano via wired connection; and still need the Arduino Nano (with Bluetooth, Wireless, etc) to communicate with other MicroControllers wirelessly. Is this possible, or the microcontroller will just listen to the wired connection?

  • @markmurray6990
    @markmurray6990 4 роки тому

    where are you getting the power for the boards from ?, I notice the USB cable is not the same colour on both boards, are you using a powered hub ?

    • @KatzenFisch
      @KatzenFisch 4 роки тому

      he has them both plugged in his pc

  • @ParasFtl
    @ParasFtl 4 роки тому

    How to specify a specific rx-tx pair for communication on arduino mega as megas has 4 pairs of rx-tx?

  • @3xAudio
    @3xAudio 4 роки тому

    Thanks for sharing, great video. I'm trying to make a sound sculpture using CCTV cameras/speakers and Arduinos communicating with each other if i can get the code right

  • @ranahassankhalid6399
    @ranahassankhalid6399 5 років тому

    Can we do the same with ethernet shields to communicate between 2 arduinos?

  • @horticultural_industries
    @horticultural_industries 3 роки тому +2

    This doesn't work. It says "initializer-string for array of chars is too long" Issue with the char thing

    • @mischgamertv7260
      @mischgamertv7260 3 роки тому +2

      Maybe I am a bit too late for the awnser, but the problem is the 'char mystr[5] = "Hello";'.
      You need to write 'char mystr[6] = "Hello";' or 'char mystr[] = "Hello";', but I would prefer the second one.

    • @mischgamertv7260
      @mischgamertv7260 3 роки тому +1

      And at 'Serial.write(mystr,5);' you need to write the right number. For example if you have a Word , that has 9 charakters, then write a 9 (Serial.write(mystr,9);).

    • @rafeekaita11
      @rafeekaita11 3 роки тому

      @@mischgamertv7260 it’s still saying invalid conversion, I tried both changes

    • @mischgamertv7260
      @mischgamertv7260 3 роки тому

      @@rafeekaita11 Strange. Try some other numbers. At my code it worked...

  • @matijasegrc384
    @matijasegrc384 4 роки тому

    Is this UART or which serial communication protocol?

    • @mitsos_306
      @mitsos_306 3 роки тому

      Hi, this is serial communication

  • @rad8845
    @rad8845 4 роки тому

    how to do simulation of this in proteus

  • @devilvortex1
    @devilvortex1 4 роки тому

    How fast is the transfer?

  • @joealki1248
    @joealki1248 6 років тому

    Hi , I followed your tutorial and am not seeing any output from my "reciever" board. I have the tx/rx connected as per your diagram and have uploaded 2 seperate uno board with recieve/sender code from your website. From the default serial monitor of arduino I can see the sender sending "hello" but the reciever does not have any data to report through serial monitor. Thanks for any help.

    • @Iotguider
      @Iotguider  6 років тому

      Please connect TX pin of sender Arduino to RX Pin of receiver Arduino. For more details please share your screenshots to iotguider@gmail.com. Thank you.

  • @thomasanton9074
    @thomasanton9074 5 років тому

    Thank You. This help me verry much!!!!

  • @alonsovalls4633
    @alonsovalls4633 4 роки тому

    Hey, how do I make the receiver print it once? Thanks.

    • @Martin-dw4eo
      @Martin-dw4eo 3 роки тому

      just use a delay() function

    • @Martin-dw4eo
      @Martin-dw4eo 3 роки тому

      My bad it's Serial.println(). ln means line.

  • @ekdilipkumar
    @ekdilipkumar 6 років тому

    How to program and use the pins of the slave..

    • @Shakespeare1612
      @Shakespeare1612 6 років тому

      The slave in this case would be the "sender", so modify the sender code to monitor it's own pins, and then send data back to the "master", or receiver. You can use Serial.println in the Master(receiver) to send data back to the send as well. Both the serial monitor and the slave(sender) are should be hearing everything that is on the serial bus.

    • @nutzboi
      @nutzboi 6 років тому

      @@Shakespeare1612 so this means I can have them both working as master and slave at the same time?

    • @Shakespeare1612
      @Shakespeare1612 6 років тому +1

      @@nutzboi No, I don't think so, but you can have one master several slaves, and the distinction should not be important because weather master or slave, they should both be able to send or receive data, at least when the master makes the bus available to them. This is all theory however, If you read my other post, I have not been able to get this to work, and I don't know why not.

    • @fatroberto3012
      @fatroberto3012 5 років тому

      This is simple serial communication, there is no master or slave. I think you are confusing it with SPI, in which several Arduinos can be connected to one bus, one master and multiple slaves and the master chooses which slave unit is addressed.

  • @achmadmaulana9463
    @achmadmaulana9463 5 років тому

    Sir, please help me. What code for transmit data float in arduino to arduino?

    • @shashanklreddy2654
      @shashanklreddy2654 3 роки тому +1

      float tempr = 24.65;
      const char * result = "";
      dtostrf(tempr, 6, 2, result); // Leave room for too large numbers!
      myserial.write(result,8);

  • @noname-ot1jc
    @noname-ot1jc 3 роки тому

    I am sure you could not transfer the digits as valubale type )) only ASCII codes of chars.. It is sucks..

  • @manuelaguilarrios2993
    @manuelaguilarrios2993 5 років тому +3

    This doesnt work anymore

    • @alperkaya3334
      @alperkaya3334 5 років тому

      say what? why wouldn't it work anymore

  • @salmanhabib7991
    @salmanhabib7991 6 років тому

    thanks a lot bro..

  • @chamodkavinda7291
    @chamodkavinda7291 6 років тому

    Thanks

  • @vincedelima7515
    @vincedelima7515 6 років тому +1

    did not work .

  • @christoffere425
    @christoffere425 3 роки тому

    A shame that it didn't work. :/

  • @joealki1248
    @joealki1248 6 років тому

    pls contact digivalve@gmail.com shukria

  • @t.n.1056
    @t.n.1056 Рік тому

    Please be honest to us: where Have u put in your microphone 😮😮 ?? Please be honest to is 👎👎

    • @you-suf2173
      @you-suf2173 11 місяців тому

      wtf is your problem with this guy

  • @gilfoyle46
    @gilfoyle46 6 років тому +3

    Fake accent