How to interface RS485 with Arduino.

แชร์
ฝัง
  • เผยแพร่เมื่อ 5 ต.ค. 2019
  • This Video shows,
    Basic Introduction of RS485 &
    How to interface RS485 with Arduino.
    Download the Circuit Diagram from the link :
    drive.google.com/open?id=1iJc...
    Download Master code from link:
    drive.google.com/open?id=1RSz...
    Download the Slave code from the link:
    drive.google.com/open?id=1Goq...
    ⭐️Please watch the video till the end. I hope that you successfully understand. If you don't understand, please comment on my videos. I try to help you.
    Thanks for checking this description.
    Follow us on:
    Facebook: / embedded.gate
    Instagram: / embeddedgate
    TH-cam: / @embeddedgate
    LinkedIn: / embedded-gate
    Website: embeddedgate.com/
    Fiverr: www.fiverr.com/s/qoWX0Z
    Upwork: www.upwork.com/freelancers/~0...

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

  • @amirfoo6565
    @amirfoo6565 ปีที่แล้ว

    Thank you it was so useful example for the RS-485 communication.

  • @kunalpingle203
    @kunalpingle203 4 ปีที่แล้ว +3

    Thank you , now i can communicate two ardiuno for long distance...

  • @arjunzoyaa
    @arjunzoyaa 4 ปีที่แล้ว +1

    Thank you for such an informative video sir..

  • @yourfaceisonfire
    @yourfaceisonfire 3 ปีที่แล้ว +1

    Nice one! I'm trying to take Modbus (Sunspec) from my SolarEdge inverter, taking the production data and turning it into RGB colour on an LED strip mounted under the panels. Much appreciated

    • @EmbeddedGate
      @EmbeddedGate  3 ปีที่แล้ว

      Thank you for comment. I can help you if you need any information.

  • @meenakamble6135
    @meenakamble6135 4 ปีที่แล้ว +2

    Thank you sir ...

  • @dr.ahmedjabbar265
    @dr.ahmedjabbar265 3 ปีที่แล้ว

    Thank you for sharing

  • @palot18
    @palot18 3 ปีที่แล้ว

    Hi i would like make remote control master with 4x4 keyboard , rs 485 line and rs485 modul arduino and relay momentary switch , i mean when i press and hold any key on key board i want switch relay . How can i do this ?

  • @michelfrance75
    @michelfrance75 2 ปีที่แล้ว

    I don't quite understand the wiring. RS485 communication is intended for long distances up to 1Km2. In your case the 2 terminations are next to each other with probably a same PC for the 2 USB ports. But in reality, at both ends, the arduino boards are connected to different PCs. Should the grounds of the 2 arduino boards be connected to each other too ? Or make a connection to the earth on both sides ? And what do we do for the 2 VCC on each arduino board, is it the same or not ?

    • @EmbeddedGate
      @EmbeddedGate  2 ปีที่แล้ว +1

      Hello. I have only one laptop with me that's why I have connected both the rs485 with a single laptop. For long-distance communication, we need only 2 wires. No need for ground.

  • @freemusicscore7281
    @freemusicscore7281 4 ปีที่แล้ว

    Thank you for helpful video.
    Is it possible to connect a 24v sensor capable of RS485 Communication to A & B terminal of RS485 Modem and transmit the reading to computer via Serial.println using arduino?
    P.s. the sensors wire are: V+, RS485 A, RS485 B, GND
    Thanks

    • @EmbeddedGate
      @EmbeddedGate  4 ปีที่แล้ว

      +Rtatzs . It is not possible to connect sensor directly to RS485. Output & Input voltage range of RS485 is -7v to +12v. To connect 24v sensor, you have to use voltage divider.

    • @freemusicscore7281
      @freemusicscore7281 4 ปีที่แล้ว

      @@EmbeddedGate From the operation guide of the sensor it says Output signal:
      Current: 0-20mA or 4-20mA,
      Voltage: 0-5V or 1-5 V
      Digital: RS485/RS232
      so I don't need a voltage divider for it?
      Thanks.

    • @EmbeddedGate
      @EmbeddedGate  4 ปีที่แล้ว

      +Rtatzs . If you are connecting 24v sensor then to communicate with this sensor you need divider network.

  • @thijsbarentsen2253
    @thijsbarentsen2253 3 ปีที่แล้ว

    So why are you declaring the LED pin as an output? You are using the MASTER_ENpin as a way to power the RS4585 right? then why also setup LEDpin13 as output?

    • @EmbeddedGate
      @EmbeddedGate  3 ปีที่แล้ว +1

      No need to declare LED pin in master code.I forget to remove that line. It is useful in slave code to indicate right character is received.

  • @hafiznaim3521
    @hafiznaim3521 4 ปีที่แล้ว

    I'm planning to use Vaisala WXT532 Wind sensor with other Sensor such BME280 & DS18B20. The thing is I already finished the code for bme280 and ds18b20 with the data being display at serial data arduino. How do I connect vaisala sensor using the rs485 to my arduino uno in order to receive the data. I don't want to use the Vaisala software since I don't want to separate the data with the bme280 and ds18b20

    • @hafiznaim3521
      @hafiznaim3521 4 ปีที่แล้ว

      Please help me

    • @EmbeddedGate
      @EmbeddedGate  4 ปีที่แล้ว

      Hello Hafiz.
      I didn't get your point. Please Explain.

  • @lutzmuller5703
    @lutzmuller5703 ปีที่แล้ว

    Hello, I have a question: is this a 485 communication.
    Is it possible with a "D1 MINI WEMOS Pro 4M 16M" using "Tasmota" e.g. B. to control a "JUNTEK DPM8624 60V24A Programmable DC DC Digital Adjustable Step Down Voltage Power Supply Buck Converter 485 Communication"?

  • @muhammadhassim5862
    @muhammadhassim5862 2 ปีที่แล้ว

    If RE and DE short together on slave modem, would they still can transmit feedback to master modem?

  • @amitmohite763
    @amitmohite763 2 ปีที่แล้ว

    Can i get this RS 485 modem in proteus software ? Bcz i wanna do its simulation ...plz reply

    • @EmbeddedGate
      @EmbeddedGate  2 ปีที่แล้ว

      Right now this module is not present in proteus.

  • @bihahazlan3393
    @bihahazlan3393 2 ปีที่แล้ว

    I try to change Arduino nano to Arduino Uno, so the controller has two Arduino UNO and I still used this coding and succeed but I want to try to add a motion sensor in this testing. can you help me with how to combine the coding?

  • @sevikharvarid9893
    @sevikharvarid9893 4 ปีที่แล้ว

    What if i want to make 1 Master Arduino with 3 Slave Arduino (UNO, Nano, Mega), can you make the tutorial?

    • @EmbeddedGate
      @EmbeddedGate  4 ปีที่แล้ว

      +Sevikhar Varid . Working on same video. Will upload as soon as possible.

    • @bakewithzobi7973
      @bakewithzobi7973 3 ปีที่แล้ว

      @@EmbeddedGate have you made the tutorial for 1 master and multiple slaves yet?

    • @EmbeddedGate
      @EmbeddedGate  3 ปีที่แล้ว

      @@bakewithzobi7973 Yes. Going to upload next week.

    • @thinktubers
      @thinktubers 3 ปีที่แล้ว

      @@EmbeddedGate could you please upload multi slave am searching on internet but I didn't find any useful tutorial!

    • @balajits9294
      @balajits9294 2 ปีที่แล้ว

      @@EmbeddedGate Hello, have you uploaded the multi slave video. If uploaded means kindly share the link.

  • @mirfozilmirazamov1263
    @mirfozilmirazamov1263 2 ปีที่แล้ว

    hey whats up guys i need help. i have sensor output is rs485 and i buy new rs485 to ttl and i dont know how to code it

  • @konradgaach2612
    @konradgaach2612 2 ปีที่แล้ว

    Why Serial. read() wont work??

    • @EmbeddedGate
      @EmbeddedGate  2 ปีที่แล้ว

      Use to read serial data.

  • @sandihasanudin3562
    @sandihasanudin3562 4 ปีที่แล้ว

    This coding is error
    if (Serial.read() =="A")
    Why ?
    please, help me
    Thankyou

    • @EmbeddedGate
      @EmbeddedGate  4 ปีที่แล้ว +1

      +Sandi Hasanudin. I'm sending character 'A' from master, If it receive in slave then LED should blink. that's why I'm using instruction if(Serial.read() == 'A') to check receive character 'A' or not.

    • @EmbeddedGate
      @EmbeddedGate  4 ปีที่แล้ว

      +Sandi Hasanudin. Download code from Description.

    • @sandihasanudin3562
      @sandihasanudin3562 4 ปีที่แล้ว

      @@EmbeddedGate I use ESP8266 (NodeMcu) as MASTER and Arduino UNO as SLAVE.
      But Arduino Uno still doesn't want to blink.
      This is coding for ESP8266 (NodeMcu) as MASTER:
      #define LED 13
      #define MASTER_EN D6
      void setup() {
      pinMode ( LED, OUTPUT );
      pinMode ( MASTER_EN, OUTPUT );
      Serial.begin ( 115200 );
      digitalWrite ( MASTER_EN, LOW );
      }
      void loop() {
      digitalWrite ( MASTER_EN, HIGH );
      delay ( 5 );
      Serial.println ( 'A' );
      Serial.flush();
      digitalWrite (MASTER_EN, LOW );
      delay ( 1000 );
      }
      And this is coding for Arduino Uno as SLAVE:
      #define LED 13
      #define SLAVE_EN 6
      void setup() {
      digitalWrite ( LED, OUTPUT );
      digitalWrite ( SLAVE_EN, OUTPUT );
      Serial.begin ( 115200 );
      digitalWrite ( SLAVE_EN, LOW );
      }
      void loop() {
      while ( Serial.available())
      {
      if ( Serial.read() == 'A')
      {
      digitalWrite (LED,!digitalRead(LED) );

      }
      }
      }
      Please give me a solution.
      Thank you

    • @sandihasanudin3562
      @sandihasanudin3562 4 ปีที่แล้ว

      @@EmbeddedGate I have downloaded the code from the description, but it still fails.
      Arduino Uno (SLAVE) still can't blink.
      May I have your email address so that I can send a video from me?
      or my email is hasanudinsandi3@gmail.com
      Thank you

    • @sandihasanudin3562
      @sandihasanudin3562 4 ปีที่แล้ว

      @@EmbeddedGate good morning.
      I have sent an email to your email.
      help for a solution
      Thank you

  • @as_-_-_
    @as_-_-_ 3 ปีที่แล้ว

    hello frends , how conect servo to slave adruino

    • @EmbeddedGate
      @EmbeddedGate  3 ปีที่แล้ว

      From master send angle instead of character. slave side receives value and according to that rotate motor.

  • @dungmanh5183
    @dungmanh5183 3 ปีที่แล้ว

    i did like you but led on slave not turn on

    • @EmbeddedGate
      @EmbeddedGate  3 ปีที่แล้ว

      check on serial terminal data is received or not. connect com port to slave.

  • @user-mp6ge7kf2y
    @user-mp6ge7kf2y 2 ปีที่แล้ว

    как добавить вторую кнопку?

    • @EmbeddedGate
      @EmbeddedGate  2 ปีที่แล้ว

      Do the same procedure, from the transmitter side send different character for the second button and for receiver side, in if condition write code for receive character.

  • @JoeEvansSound
    @JoeEvansSound 4 ปีที่แล้ว

    Has anybody ever got this project to work? I have found 2 code errors and 1 wiring diagram error. Has anybody ever fixed this? Thanx very much :¬)

    • @EmbeddedGate
      @EmbeddedGate  4 ปีที่แล้ว

      Hello PJ Jones
      please tell me where is code error. This is working project & Diagram also right.

    • @JoeEvansSound
      @JoeEvansSound 4 ปีที่แล้ว

      I think lines 8 and 9 on the SLAVE sketch should be 8: pinMode(LED, OUTPUT); 9: pinMode(SLAVE_EN, OUTPUT); and not 8: digitalWrite(LED, OUTPUT); 9: digitalWrite(SLAVE_EN, OUTPUT);.
      Also your diagram at position 00:21 on the video shows ( on the Nano ) your pink cable connecting to PIN 6 and not PIN 8.
      I am sorry if this is incorrect. I am just trying to copy what you have done - I am not trying to find errors. Thanks very much. If I am incorrect I will gladly delete my posts for you. Can you help at all please?

    • @EmbeddedGate
      @EmbeddedGate  4 ปีที่แล้ว +1

      Thank you@@JoeEvansSound. You are right. Sorry for inconvenience. I will make correction and will upload same video as soon as possible.

    • @EmbeddedGate
      @EmbeddedGate  4 ปีที่แล้ว +1

      Hello +PJ Jones . In comment section I have provided link for corrected circuit diagram and code. sorry for inconvenience.

    • @JoeEvansSound
      @JoeEvansSound 4 ปีที่แล้ว

      @@EmbeddedGate HOORRAHHHH!!! IT WORKS!!! Hi there - thanks very much it all works well now. Do you want me to try to delete my first post for you?

  • @user-um3ui1gu9t
    @user-um3ui1gu9t 2 ปีที่แล้ว

    Useless video ! You do not explain anything about RS485 and you do not compare it with radio technologies

  • @ChakaHamilton
    @ChakaHamilton 4 ปีที่แล้ว

    The music is a distraction. And if your not talking, you are't teaching.

    • @tornadokat
      @tornadokat 3 ปีที่แล้ว

      There are other videos on TH-cam showing how to use RS485 where you don't have to read. One of those should help you. Also, on the lower left area of the video is an icon that looks like a speaker and if you click on it, you can turn the music off.

    • @ChakaHamilton
      @ChakaHamilton 3 ปีที่แล้ว

      @@tornadokat ?? So your advice is to find better videos than yours on youtube? Got it!

    • @Makelifehappennow
      @Makelifehappennow 2 ปีที่แล้ว +1

      @@ChakaHamilton loser reply. I think the video is effective. Stop whining, get out of your mom's basement and go to your McDonald's night shift job. This guy did a nice video. Works for me.