Тёмный

What is RS485 serial communication? How to use RS-485 MODBUS to design Arduino point-point network. 

Challenger Tech.
Подписаться 1,5 тыс.
Просмотров 66 тыс.
50% 1

In this video will learn about the RS485 TTL module and how to use it for serial communication.
Then we gonna develop a simple yet powerful point to point network with 2 Arduinos boards.
***You may need to check the Implementation of Arduino MultiHop RS485 MODBUS network "PART-1" at this link:
• Design and Implementat...
Happy learning!

Опубликовано:

 

15 сен 2024

Поделиться:

Ссылка:

Скачать:

Готовим ссылку...

Добавить в:

Мой плейлист
Посмотреть позже
Комментарии : 90   
@prezbenny7842
@prezbenny7842 Год назад
amazing, the world need more teacher_instructor like you Sir. good job
@AliChallenger
@AliChallenger Год назад
Thanks for the compliment.
@jdarnell123
@jdarnell123 Год назад
EXCELLENT VIDEO!!! I liked and subscribed! Very clear explanation for both hardware and software. I'm also impressed that you wrote your code on-the-fly while you were recording the video! 🙂
@AliChallenger
@AliChallenger 7 месяцев назад
Many thanks my friend, happy learning.
@smokeysky
@smokeysky Год назад
It is a good thing this is youtube, I could not stay awake through it xD but eventually I finished it and learned a lot. Thanks!
@AliChallenger
@AliChallenger Год назад
Happy to hear that Teddy, Happy learning.
@pawedawcewicz9120
@pawedawcewicz9120 Год назад
Thank you. Simple and clear. One question - when Slave transmits/Master receives, RX LED blinks on Slave, and TX LED on Master. The same the other way - when Master transmits/Slave receives, TX LED blinks on Slave, and RX LED on Master. Why? It's counter intuitive. PS. You could share both scripts in video's description, so one doesn't have to rewrite it. PS2. It's not MODBUS, as video's title says - it's just simple serial communication over RS-485. MODBUS protocol is not used here.
@AliChallenger
@AliChallenger Год назад
Thanks Pawel for your comment, The RX and TX LEDs are blinks while transmitting the data due to the data transfer from the serial monitor to the MCU only and nothing to do with MODBUS modules.
@xinhaizou9240
@xinhaizou9240 Год назад
Excellent Video!! Thanks a lot!! Btw, I guess another possibility for 38:15 is that your RS_DE_RE for the master is still "HIGH", and you need to input something to let it "LOW": See line 27 in master: digitalWrite(RS_DE_RE, "LOW"); And before calling this loop() function, it is still "HIGH", which means that the slave cannot transmit messages to the master.
@AliChallenger
@AliChallenger 7 месяцев назад
Sorry for the late reply, You are correct, I can see what do you mean. To put it simply: The master node need to receive an input from the slave to enter the if(serial.available) condition and at the end set the digitalWrite(RS_DE_RE, "LOW");. Then the master can receive data from the slave. That's make sense, will update this issue in the future. Thanks for your input.
@RSEmbedded
@RSEmbedded Год назад
Very clear and good explanation , easy way to understand the concept
@AliChallenger
@AliChallenger 7 месяцев назад
Thanks. Happy learning
@hicmikrolab
@hicmikrolab Год назад
Very straightforward and easy to understand. Thank you
@AliChallenger
@AliChallenger Год назад
Thanks to you too. Happy learning.
@sametbrhan
@sametbrhan Год назад
Thanks for video. Simple example for understanding.
@AliChallenger
@AliChallenger 7 месяцев назад
Many thanks my friend.
@douglasvanderclute9261
@douglasvanderclute9261 2 месяца назад
Thank you for this video. Wiring and program worked well.
@DavidTessler-r4m
@DavidTessler-r4m Месяц назад
Dear Sir, is there an example/library for MODBUS RTU protocoll in the meantime ? Thanks a lot for thsi great video !
@elalemanpaisa
@elalemanpaisa 7 дней назад
we just need to put AES into the mix and I am happy :D
@shahinsalman3665
@shahinsalman3665 10 месяцев назад
Excellent Video!! Thanks a lot!!
@AliChallenger
@AliChallenger 7 месяцев назад
Thanks, Happy learning.
@MrWangsan
@MrWangsan Год назад
Thank you for your great work
@AliChallenger
@AliChallenger 7 месяцев назад
Thanks a lot, happy learning.
@arindamghatak
@arindamghatak 8 месяцев назад
Wonderful video. Downloaded.
@AliChallenger
@AliChallenger 7 месяцев назад
Thanks, happy learning.
@zachreyhelmberger894
@zachreyhelmberger894 Год назад
Good intro! Thank you!
@AliChallenger
@AliChallenger 7 месяцев назад
Thank you, happy learning.
@xrphobby1341
@xrphobby1341 Год назад
Thank you for your video, it's very simplified explanation. Got a question, is there a way not to use physical wires for terminals A and B to connect the 2 modules, so in this case it will be totally wireless? I just wonder if this is possible?
@AliChallenger
@AliChallenger Год назад
You can directly use a wireless modules instead, there are wireless modules that support serial UART interface. You may check these videos: ru-vid.com/video/%D0%B2%D0%B8%D0%B4%D0%B5%D0%BE-W2Ha3vBpxSM.html&ab_channel=ChallengerTech. ru-vid.com/video/%D0%B2%D0%B8%D0%B4%D0%B5%D0%BE-h883lBQIhuo.html&ab_channel=ChallengerTech. ru-vid.com/video/%D0%B2%D0%B8%D0%B4%D0%B5%D0%BE-yz9r2c4diLA.html&ab_channel=ChallengerTech. ru-vid.com/video/%D0%B2%D0%B8%D0%B4%D0%B5%D0%BE-kgkSilELi-w.html&ab_channel=ChallengerTech.
@HaziqAziziJamalullail
@HaziqAziziJamalullail Год назад
Hi, I follow your video and it works but I don't understand how to make the slave send data to master with the value of a sensor read by the slave. I have a PZEM-004t on my slave. I want to make the value come out when the master call. For example, I write "req,PZEM1" at the master, then the value of voltage, current, power and etc. from the first PZEM are sent to the master.
@AliChallenger
@AliChallenger Год назад
Hello Haziq, to implement the scenario that you described it you need data addressing scheme to request and receive the specific data, you may check these videos: ru-vid.com/video/%D0%B2%D0%B8%D0%B4%D0%B5%D0%BE-diDnelKFqg0.html&ab_channel=ChallengerTech.ru-vid.com/video/%D0%B2%D0%B8%D0%B4%D0%B5%D0%BE-RyiIGNZ__jI.html&ab_channel=ChallengerTech. ru-vid.com/video/%D0%B2%D0%B8%D0%B4%D0%B5%D0%BE-HUCiRF5Ceh0.html&ab_channel=ChallengerTech. ru-vid.com/video/%D0%B2%D0%B8%D0%B4%D0%B5%D0%BE-03ZZmRFTGYU.html&ab_channel=ChallengerTech.
@MC-NARESHKUMARR
@MC-NARESHKUMARR 11 месяцев назад
Does pzem 004t have memory to store the total energy consumption even when turned off.
@modbusinternet3354
@modbusinternet3354 5 месяцев назад
My king u the best in the game
@AliChallenger
@AliChallenger 3 месяца назад
Thanks my friend
@extremedry3379
@extremedry3379 8 месяцев назад
Would you mind to post up the information of the hardware you show in the video? I’d like to purchase one and hand on for more experience.
@AliChallenger
@AliChallenger 7 месяцев назад
In this tutorial I am using MAX485 module and Arduino UNO. They are available in abundant online.
@rydinorwin
@rydinorwin 9 месяцев назад
Really fantastic! One Question, I think you are using a Mac, how the heck do I open 2 serial monitors? Mac seems to only allow one instance of Arduino IDE to be open, not the necessary 2? I read it was in terminal, but couldn't get the thing to work, so had to swop to windows.
@AliChallenger
@AliChallenger 7 месяцев назад
Sorry I am not using Mac.
@hedalen001
@hedalen001 Год назад
thanks for this great video, but where can i find the sketches?
@AliChallenger
@AliChallenger 7 месяцев назад
Sorry, I do not keep/upload the sketches. You may need to follow the video steps, I explain everything in details.
@adonaugustin2907
@adonaugustin2907 10 месяцев назад
informative video . Can I connect this module to raspberry pi? while doing so I can send data but not able to recieve data.
@AliChallenger
@AliChallenger 7 месяцев назад
Hello, yes sure can. Will try to make another tutorial about the RS485 with the raspberry pi.
@madanjitender
@madanjitender Год назад
Can you make a Tutorial on PC USB to 485 (USB To 485 converter) to 485 to TTL Connector to Arduino?
@AliChallenger
@AliChallenger Год назад
I will try my best to implement that.
@MrRicardosgeral
@MrRicardosgeral Год назад
Do you a similar video with more than one slave? What changes ?
@AliChallenger
@AliChallenger Год назад
Hello Ricardo, I am working in developing multi-hop example with more than 2 modules, gonna release it soon.
@amirahmadi794
@amirahmadi794 Год назад
does the ground need to be connected between two majouls? or not? and dont you need to change the slave pinmode to low again after you print the charachter?
@AliChallenger
@AliChallenger 7 месяцев назад
Sorry for the late reply, Well, the RS485 is a differential signal so no common ground is required. However, Connecting the GND wire between the source and receiver might be useful to limit the common mode voltage that can be impressed on the receiver inputs.
@shakaibsafvi97
@shakaibsafvi97 18 дней назад
Hi, There is not MODBUS code in the video.
@keithbrown162
@keithbrown162 7 месяцев назад
Did you have to use two laptops for this? I can’t seem to get two IDE and two serial monitors working at one time on my PC laptop. I have the slave on COM 5 and master on COM 6.
@keithbrown162
@keithbrown162 7 месяцев назад
a work around by opening the master in IDE 1.8 and the slave in IDE 2.0
@AliChallenger
@AliChallenger 7 месяцев назад
Hello@@keithbrown162 , well, you may try to open 2 arduino IDE instances at the same time, then you set different COMs following the arduino boards. This is what I usually do.
@arbjful
@arbjful Год назад
Does this module come with the MODBUS protocol programmed? Or do we have to develop the program ourselves?
@AliChallenger
@AliChallenger Год назад
This module is providing the physical MODBUS layer, on the software part you may need to develop your own protocol to match the target.
@MrWangsan
@MrWangsan Год назад
Sir , I Know why In the end ,you first sending from slaver to master is not worked , Cause the master is set the RS_DE_RE to HIGH at first .
@MrWangsan
@MrWangsan Год назад
So in the end , there is no master or slave actually . The master could just use the same code which the slave use.
@AliChallenger
@AliChallenger 7 месяцев назад
Hello@@MrWangsan That's correct.
@Jtube0101Mega
@Jtube0101Mega Год назад
I have a question. Imagine I would like to connect another Node or other 2, 3, 4 or five nodes into this connection. How would be the connections? In that case, will I just joint the A, B connection ?
@AliChallenger
@AliChallenger Год назад
Hello Jobson, Yes, You are right, Need to join the A and B wires but in a multi-drop connection manner. I am working in developing multi-hop example with more than 2 modules, gonna release it soon.
@AliChallenger
@AliChallenger Год назад
BTW Jobson since you gonna interconnect more that 2 modules, you gonna need an addressing scheme as in: ru-vid.com/video/%D0%B2%D0%B8%D0%B4%D0%B5%D0%BE-03ZZmRFTGYU.html&ab_channel=ChallengerTech. ru-vid.com/video/%D0%B2%D0%B8%D0%B4%D0%B5%D0%BE-HUCiRF5Ceh0.html&ab_channel=ChallengerTech. ru-vid.com/video/%D0%B2%D0%B8%D0%B4%D0%B5%D0%BE-RyiIGNZ__jI.html&ab_channel=ChallengerTech. ru-vid.com/video/%D0%B2%D0%B8%D0%B4%D0%B5%D0%BE-diDnelKFqg0.html&ab_channel=ChallengerTech.
@jacktie5774
@jacktie5774 Год назад
Hi, how could we use MODBUS RTU with this set up? I could not get any response from my digital sensor which takes rs485 data input, I simply entered my request to the serial input and I'm not getting any responses. Could you please help me? many thanks
@AliChallenger
@AliChallenger 7 месяцев назад
Sorry for the late reply, although the digital sensor support RS485 as a communication, there might be a specific protocol/commands sequence to talk to it. Might need to check the sensor manual/datasheet first. Will try to work on the MODBUS RTU examples in the future.
@syedumarjunaid5499
@syedumarjunaid5499 Год назад
Please suggest working and easy library for modbus rtu slave. I want make 12 modbus rtu with PC as master
@AliChallenger
@AliChallenger 7 месяцев назад
Sorry for the late reply, Well, No specific RS485 library in my head. However, you can do your own one, not that hard though. Here is a tutorial show you how: ru-vid.com/video/%D0%B2%D0%B8%D0%B4%D0%B5%D0%BE-AXzksa8JDnE.html
@gokhankunt3884
@gokhankunt3884 6 месяцев назад
thank you for share, it is helpfull video. Absoluttely i got a new infos. İ have a question. If i connect an arduino pro mini to hmi device with rs485 protocol, what i need code or library type, have you any example as this. Othervise, can you suggest to me any tutorial video for arduino and hmi master/slave. Thank you again.
@AliChallenger
@AliChallenger 3 месяца назад
Hello gokhankunt3884, Well, you need to study the HMI RS commands then use arduino to send them to the HMI.
@amiralgadab
@amiralgadab 2 года назад
Good
@AliChallenger
@AliChallenger Год назад
Thanks
@madanjitender
@madanjitender Год назад
Don’t we need RX and TX TTL Connections?
@AliChallenger
@AliChallenger Год назад
Not needed as the MAX485 supports TTL directly.
@abhisheksardar7367
@abhisheksardar7367 Год назад
TX Rx is for modbus TCP ......not for modbus RTU (rs 485)
@yacineyacine9375
@yacineyacine9375 Год назад
Can I transfer data long distance 4km ??
@AliChallenger
@AliChallenger 7 месяцев назад
I don't think you can do so, you gonna need a repeater to maintain the signal at each 1km.
@goodfriend1717
@goodfriend1717 5 месяцев назад
Sir my ra485 comunication is breaking it's fluctuate what I can do to fix it
@AliChallenger
@AliChallenger 3 месяца назад
You may need to double check the terminal resistor.
@ankitkailashi9777
@ankitkailashi9777 5 месяцев назад
si ri wan to recieve dat aonly form a device uisng rs485 tottl can u please tell me how can i procced
@AliChallenger
@AliChallenger 3 месяца назад
Hello ankitkailashi9777, These tutorials will help you to receive data from any device: ru-vid.com/video/%D0%B2%D0%B8%D0%B4%D0%B5%D0%BE-9CwwZ-SMMoA.html ru-vid.com/video/%D0%B2%D0%B8%D0%B4%D0%B5%D0%BE-k5Jgrq3NzB0.html ru-vid.com/video/%D0%B2%D0%B8%D0%B4%D0%B5%D0%BE--P71Xbzs57c.html
@kourivi
@kourivi 5 месяцев назад
Hello sir Is it possible to communicate with hmi with softwareserial library?
@AliChallenger
@AliChallenger 3 месяца назад
Sure can kourivi, you may need to study the HMI commands so you can send them through the serial.
@kourivi
@kourivi 3 месяца назад
@@AliChallenger yup I did ;)
@smokeysky
@smokeysky Год назад
PS please update your arduino?
@AliChallenger
@AliChallenger Год назад
So sorry for that, but, for the time been you can follow the tutorial directly.
@smokeysky
@smokeysky Год назад
@@AliChallenger oh the tutorial itself was great :P works like a charm
@jw5gi
@jw5gi Год назад
Это не MODBUS протокол. Использование протокола MODBUS подразумевает адреса устройств. У вас этого нет. Измените название видео, не вводите в заблуждение.
@AliChallenger
@AliChallenger Год назад
Thanks for your comment.
@sajjadkareem608
@sajjadkareem608 Год назад
😂😂😂
@joramotorsportteam3277
@joramotorsportteam3277 5 месяцев назад
Its possible 12V in ModBus RS485 devices? GREE HP we measurins and 11.24V
@AliChallenger
@AliChallenger 3 месяца назад
Commonly talking, VCC = [3.3 - 6]V A, B = [-9 - 14]V However, it is better to consult the chip datasheet to conform the ranges.
Далее
World’s Tallest Man VS Shortest Woman!
15:07
Просмотров 15 млн
UART To RS-485 Interface  / Pro Mini / LoRa Interface
9:51
What is Modbus and How does it Work?
8:58
Просмотров 1,7 млн
ARDUINO NANO MODBUS RTU SLAVE
21:32
Просмотров 1,7 тыс.
Serial Communication RS232 & RS485
12:58
Просмотров 504 тыс.
10 years of embedded coding in 10 minutes
10:02
Просмотров 398 тыс.
Understanding Modbus Serial and TCP IP
12:07
Просмотров 133 тыс.