Тёмный

#106 

Ralph S Bacon
Подписаться 54 тыс.
Просмотров 62 тыс.
50% 1

New! ralphbacon.blog
If data transmission via radio waves is not for you (see video #73 on the nRF24L01+ modules) then maybe good old 2-wire transmission using the RS485 interface is a better choice.
The modules are to be had for pennies, the coding is simple and no libraries are required although we do use the SerialSoftware library to create a new serial port on arbitrary GPIO pins - not needed if you have a Mega 2560 as that four hardware serial ports built right into the hardware.
Data transmission speed can be quite high (115200 bps) and distances quite long (1.2km) but not both at the same time!
All in all, this can be a solution for outlying buildings, sheds, barns and the like as long as they have power.
As a bonus, you get first look at my new blog which I'm going to use to fill the gaps between videos. Yes, I know, I'm spoiling you.
All code can be found in my Github:
github.com/Ral...
Interesting links about stuff I mention in my video:
Wikipedia article on RS485
en.wikipedia.o...
Bangood RS485 modules
www.banggood.c...
Nick Gammon's excellent article on RS486 including libraries and multidrop example
www.gammon.com....
My new blog! All about stuff I never get to video about.
ralphbacon.blog
Here's one I made earlier... classic childrens TV
www.bbc.co.uk/c...
My channel and blog are here:
------------------------------------------------------------------
/ ralphbacon
ralphbacon.blog
------------------------------------------------------------------

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

 

14 окт 2024

Поделиться:

Ссылка:

Скачать:

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

Добавить в:

Мой плейлист
Посмотреть позже
Комментарии : 116   
@JerryEricsson
@JerryEricsson 6 лет назад
Cool, reminds me of my old days when I ran Land-line teletype over in Vietnam, we dealt with a sort of ancient version of this using tube sets that amplified the signals after they had been processed by the crypto gear, I also did some time in the Brigade Headquarters Switchboard room as an operator for a few months, this was where I was exposed to the phantom and phantom simplex circuits using the earth as one side of a land line phone circuit it was really amazing, we could go from the Cam Rahn Bay to Saigon and to Phu Bi using just the earth for one side of the circuit. Basically one wire communications. Of course we did use special gear that got it done, I still recall the glow from the tubes in those boxes....
@RalphBacon
@RalphBacon 6 лет назад
Single line transmission was how the first telegraphs were sent, Jerry, using the actual ground as, er, ground. Unfortunately, for the Wild West users, the ground in the USA sometimes became so dry that the transmissions stopped. There are anecdotes of telegraph operators pouring jugs of water around the earth peg to try and get a connection. Eventually, technology caught up and two-wire comms became the norm and no more wet earth pegs were required! I'm not recalling this from memory, I hasten to add, it's just something I have learned about!
@IldefonsoZanette
@IldefonsoZanette 5 лет назад
Thanks to you and Gammon, I got my RS485s working. The absence of that delay that Gammon found out was the culprit of the failed communication.
@RalphBacon
@RalphBacon 5 лет назад
Excellent news! So glad you got it working. With Bacon AND Gammon how can you go wrong!?
@tabmaryland2333
@tabmaryland2333 6 лет назад
What could possibly be better than more Ralph Bacon. Huzzah!
@RalphBacon
@RalphBacon 6 лет назад
You're very kind, Tab Maryland! I just hope I'm not going to overload my Arduinite subscribers and followers with information. I'll try and restrain my enthusiasm. Don't forget to "follow" on the blog though! Thanks for posting.
@j1952d
@j1952d 3 года назад
Once used some RS232 - RS485 converters for a fussy customer. Distance was a bit close to 10m, so customer insisted. He also insisted on some "fancy" ones at about £50 each! He was paying, so he was correct ;)
@RalphBacon
@RalphBacon 3 года назад
If the customer has a reason for specifying higher quality components, so be it! They must have a reason (and not just that the bloke down the pub said so).
@nburton01
@nburton01 6 лет назад
Used RS485 for my original home grown home control system, about 9 years ago. Had the same problem with the output buffer. RS485 worked well for a few devices but found CAN bus a lot easer and more reliable for multiple devices. The MCP2515 CAN bus Module are a bit more expensive but still less than a £1 each (from AliExpress) and go up to 1Mb/s and use the same number of com wires. If you use a micro controller with built in CAN bus (e.g. ESP32) you can just use a SN65HVD230 CAN bus buffer about the same cost but requires fewer pins.
@RalphBacon
@RalphBacon 6 лет назад
So another comms protocol for me to investigate then, Nick! Although I think my car uses a CANBUS to route all the signals around, which is how it knows the offside parking bulb is blown. I'll take a look at the device you mention, at that price it seems worth looking at in some detail. Thanks for the heads up, good to hear from you.
@nburton01
@nburton01 6 лет назад
Yes as you probably know Can bus was originally developed for vehicles by Bosch back in 1983. Great Videos btw Some good starting points I found. Just in case you or anyone else are interested in investigate. Using the MCP2515 CAN BUS Module Board with Arduino www.14core.com/wiring-the-mcp2515-controller-area-network-can-bus-diagnostics/ This site was useful in getting CAN working with an ESP-32 www.iotsharing.com/2017/09/how-to-use-arduino-esp32-can-interface.html Im also using a PiCAN hat on a Raspberry Pi skpang.co.uk/catalog/pican2-canbus-board-for-raspberry-pi-23-p-1475.html Think it would be possible to use the MCP2515 CAN BUS Module Board though. It uses the same chipset as the PiCAN. The PiCAN was just more convenient. Been using CAN on my Raspberry Pi to communicate with several Arduino nodes on my home control system for several years and has proved very reliable using four core telephone cable for 12v power and signal.
@RalphBacon
@RalphBacon 6 лет назад
Excellent links there, NIck, thanks for that, I (and perhaps others too) will explore. I'm amazed you can use standard telephone wire for both power and signal; as far as I know, they are not even twisted pairs just wire so I will be interested in that, for sure.
@nburton01
@nburton01 6 лет назад
Not sure if standard phone cable has twisted pairs but the cable I used has. It’s a lot better to use, in the home, than ethernet cable as it’s thiner and more flexible. This makes it easer to install without looking too messy. So far my run of cabe is about 30m using 500Mb/s it has been very reliable. Ideal for sending short control messages to and from multiple low cost devices. Which is what it was designed for I guess.
@RalphBacon
@RalphBacon 6 лет назад
I will check my telephone cable - perhaps they are twisted by default! Thanks for this, keep tuned!
@DncmFamily
@DncmFamily 4 года назад
Excellent tutorial on RS485. I am justing a project that will be using RS485 and your video was a big help. Thanks so much..
@RalphBacon
@RalphBacon 4 года назад
Glad it helped, David!
@boblewis5558
@boblewis5558 6 лет назад
ALWAYS USE GREAT CAUTION WHEN MAKING DIRECT COPPER CONNECTIONS OF ANY KIND TO OUTBUILDINGS!! This is a HUGE subject to try to cover briefly in a comment. Suffice to say the following. 1. MASSIVE inductive spikes (10's thousands of volts) can appear on the outdoor connections that can blow your circuitry (literally) to smithereens. Research for example opto and galvanic isolation of RS485 lines. 2. Protect your circuits and youselves as much as possible by fitting suitable lightning arrestors and transorbs (tranzorbs, TVS diodes) with suitable fuses in series - Google for more info. 3. Even when any outside mains power supply has been properly and professionally installed with maybe individual bonded earth in addition to any SWA earth cable back to the consumer unit, NEVER, NEVER, NEVER assume that there is ZERO voltage between ground potential in the outbuilding and ground potential in the house!! It MIGHT spike to several thousand volts difference during an overhead lightning storm!! It's why it's not such a good idea necessarily to have an outside supply from an MCB covered by an RCD feeding other internal circuits as well. Use a separate supply feed altogether from the main isolator or use an RCBO connected BEFORE the main RCDs. Otherwise you may find spurious whole or half house power trips happening all the time. Hope this doesn't confuse people too much but please research on line as it is important for YOUR life and safety as well as to protect your gear.
@RalphBacon
@RalphBacon 6 лет назад
Thanks for that safety update, Bob, much appreciated, as many treat anything at mains potential and higher as no more than a 9-volt battery. And as you say, ground on any circuit is not necessary zero volts.
@boldford
@boldford 6 лет назад
Hi Ralph. I see you managed to find your MAX485 modules. '-) You can have up to 32 standard 12 Kohm modules (including the master) on a RS485 bus. If, however, you use the MAX487 chip you can increase this to 128. I'm soaking up Nick Gammon's wise words and will adapt his protocol to my needs. Many thanks for the video.
@RalphBacon
@RalphBacon 6 лет назад
Yes, Nick Gammon (no relationship, but there should be) has a great website and goes into great detail, Brian. Good luck with your project.
@mcocker
@mcocker 6 лет назад
I just remembered why I have a pile of these modules at home, RS485 is used for DMX lighting control, so you can use these modules along with an Arduino (or any similar) to control DMX stage/disco lights. Now I mention it sounds like a cross over to Big Clive channel :D (sure you don't mind me mentioning his channel here) I had a sketch working on a few lights as a proof of concept and meant to do something proper with it for a simple control without needing full computer, dmx dongles and software for some static looks and some basic effects.
@RalphBacon
@RalphBacon 6 лет назад
Who Clive? New boy, is he, Matt? 😜 In my days as a DJ (yes, really) I hankered after a DMX controller. Even though my lights could have been connected up together, the controllers and cables and so on made it prohibitively expensive, back in the '90s. I think I might have been able to concoct something to control those lights with an Arduino and an RS485 module, had the Arduino been invented back then. Even worse, I did one stint in a huge nightclub and they let me use all their equipment, including DMX controlled lighting. There's something special seeing laser lights move in perfect synchronisation before doing their own thing! Ah yes, memories of Robin S, Show Me Love... Thanks for the memories, Matt.
@tablatronix
@tablatronix 6 лет назад
If using twisted pair you have to ensure you pair the twists up, and you should use a drain wire, as you mention grounding the shield on one side, this is a drain.
@RalphBacon
@RalphBacon 6 лет назад
Just like my shiny new CAT-6 ethernet cable going to my soon-to-be-constructed workshop, that has an exposed drain at one end for (extra) earthing. Good point, tablatronix, thanks for posting.
@boldford
@boldford 6 лет назад
Hi Ralph I do think RS485 deserves to be revisited to scratch a little deeper below the surface. You had a defective module first time round so you were unable to create a multidrop network. Additionally, you never overcame the buffered delay in printed characters.
@RalphBacon
@RalphBacon 6 лет назад
I'm struggling to recall the details, Brian, but wasn't the delay just the fact that one unit was receiving the data and the other was sending the NEXT request at which point the first request was then echoed back to the first unit? Hence the (one character) delay? We could have overcome it, I believe, by asking for the response before sending another character. If this all barking up the wrong tree let me know and I'll deeper into it.
@boldford
@boldford 6 лет назад
Hi Ralph I recall you were unable to properly set up a multi-drop network as one of your RS485 modules decided to have a benny (no pun intended). Wasn't the character held in the buffer and not sent out until it had received another? Or something like that.
@Logical_Controls
@Logical_Controls 6 лет назад
Hi Ralph, I maybe missed it somewhere in the video but it is probably worth mentioning that RS485 requires 120ohm terminating resistors at each end of the line, i cant imagine they are built in to the RS485 modules as this would then prevent you from having anymore than 2 in the network so this would likely need to be added manually. nice video though, thanks for sharing :)
@RalphBacon
@RalphBacon 6 лет назад
Ah, yes, you have to be careful here, DazzleK93. I did mention that you don't need to add resistors because they are all built into the module (see schematic here: yourduino.com/sunshop//index.php?l=product_detail&p=323 ) BUT you are very right in pointing out that the more you connect the lower this resistance will be. I'm guessing the manufacturer of the module does this so you can start using the module right away with no faffing about. But... If you connect more than one (and this applies to I2C modules too that have 10K pull-up resistors on the CLK and DATA lines) you should really REMOVE the extra ones. So, in this case, R5, R6 and R7 should be removed on all but one of the modules. Very well spotted, and thanks for bringing this up as it would surely cause issues if half a dozen were all connected up on the same lines. Thanks for the post and your kind words too!
@tablatronix
@tablatronix 6 лет назад
I am surprised they did not make the EOL resistors a jumper to make it more multi drop useful.
@RalphBacon
@RalphBacon 6 лет назад
The only reason: cost. As always, things are built down to a price. Now if Sparkfun had designed these they would have had jumpers, a built-in LED display of some kind, and an onboard 4K EEPROM, just for fun. And then they would have cost £10 each! Sorry, am I being too cynical here? As it happens, your post has highlighted this issue so removal of said surface-mounted resistors should be easy.
@boldford
@boldford 6 лет назад
If you want to optimally use these modules in a multi-drop configuration you'll need to remove R5, R6 & R7 from the MAX485 board at all the intermediate stations and R5 and R6 at one of the end stations.
@avejst
@avejst 6 лет назад
Thanks for sharing 😀👍 Interesting to see your blog, nice done 👍
@RalphBacon
@RalphBacon 6 лет назад
Thanks for that, Asger Vestbjerg, glad you liked my blog, nice to hear from you.
@mcocker
@mcocker 6 лет назад
Ralph Bacon ... Nick Gammon, some unintentional pun in there somewhere ;)
@RalphBacon
@RalphBacon 6 лет назад
Well, he's smokin' that's for sure! The same thought did occur to me but thought best not to say anyth.... oh, too late!
@boldford
@boldford 6 лет назад
A crack(l)ing coincidence.
@Ed19601
@Ed19601 6 лет назад
Matt Cocker the things I learn here :-)
@Debraj1978
@Debraj1978 3 года назад
I use SN75176B for RS485 communication. I have not faced the issue as mentioned by Gammon. But I have a different issue -- after transmission, once I enable reception, sometime, the 1st byte of reception is the last byte that was transmitted. I have used some software work around, but a simple fixed delay after transmission did not solve the issue. Somehow, either the delay sometime appears inadequate while some other time, the delay becomes too much and I loose the 1st valid RX byte.
@RalphBacon
@RalphBacon 3 года назад
So is the 2nd byte you receive actually the first byte from the sender unit? Do you get the last byte successfully? I had a similar issue but it was all about the FIFO or buffering. In other words, it was my misunderstanding of the protocol and my software than an actual error.
@Debraj1978
@Debraj1978 3 года назад
@@RalphBacon Yes could be the reason. In such case, I usually bypass the SW layer and directly access the HW register. But my code is running on ESP8266-NodeMCU and I am not familar with background. Hence, I have to be happy with using serial functions provided in Arduino like code.
@mrasp3203
@mrasp3203 6 лет назад
Thanks ! As always very detailed and informative...greatly appreciated.
@RalphBacon
@RalphBacon 6 лет назад
Thanks for your post, Mr ASP, good to hear from you.
@MrBobWareham
@MrBobWareham 6 лет назад
Hi Ralph its Bob tried your Blog but no confirmation email back so will leave it with you, All the best and blog looks good!!
@RalphBacon
@RalphBacon 6 лет назад
I think you will get an email back when a new post is sent, Bob. I'll experiment on one of my old email addresses and see what happens. Thanks for your kind words and keep tuned!
@alexsemine1
@alexsemine1 5 лет назад
Thank you Sir for another great video!!! Question: what is the relation between baud rate and admissible transmission distance? Half baudrate means double distance or is it more complicated? Here's an idea for some future video: PCA9615 that converts I2C to a differential line. Looks quite nice for long distance communications with sensors and there's surprisingly little amount of info online. Best regards
@RalphBacon
@RalphBacon 5 лет назад
It's not quite that mathematical, Alex. The lower baud rate ensures less risk of corruption over longer distances. The only way to know whether your baud rate works is to try it. But what works today may not work tomorrow when the microwave next door (or a hairdryer) is switched on! Regarding the PCA9615, that deice does indeed look intriguing. I wonder if it could be coupled with a TCA9548A I2C multiplexer, that would be interesting too?
@surenbono6063
@surenbono6063 11 месяцев назад
...3 wire UART comm are simpler.(RX,RX,gnd)..not sure about its range
@gbetromero
@gbetromero 4 года назад
Very nice tutorial, 1 quick question, If you had more then 1 slave how to determine the slave id?
@RalphBacon
@RalphBacon 4 года назад
I'm using SoftwareSerial library to keep things simple. Unless you can make each slave accept an ID, using digitalWrite and then ensure you only send data to that Slave ID (eg for a response), I don't know if the way I did this would work. There is undoubtedly an RS485 (or MODBUS) library available these days that works on the Arduino family and which you can assign an ID to a Slave (or read it, if previously set). Best I can suggest, sorry I can't be of more help.
@gbetromero
@gbetromero 4 года назад
@@RalphBacon Thank you so much, your tutorial help me a lot, though i wanted to understand more about master and multiple slave. Once again thank you so much.
@ri5ux435
@ri5ux435 5 лет назад
What Arduino plugin are you using for your eclipse IDE installation? Didn't know there was even a plugin for eclipse prior to this video.
@RalphBacon
@RalphBacon 5 лет назад
It's end of life now, but still very useable: eclipse.baeyens.it/
@palkabanych
@palkabanych 5 лет назад
Amazing video! Which ide are you using?
@RalphBacon
@RalphBacon 5 лет назад
I'm using Eclipse with Arduino: eclipse.baeyens.it
@dave-in-nj9393
@dave-in-nj9393 6 лет назад
Nick's page says he is using an LTC1480 and that is a 3v3 part. the boards from Aliexpress are 5v because they use the MAX485 chip
@RalphBacon
@RalphBacon 6 лет назад
The LTC1480 is certainly advertised as a 3v3 part but can take up to 7v. I suspect that is why Nick's using the full, Arduino-friendly 5v supply thus avoiding any level shifting requirements.
@dave-in-nj9393
@dave-in-nj9393 6 лет назад
The module from BangGood and from AliExpress for less than a Dollar is a MAX458 chip, the data sheet lists that as 5v. Searching Maxim, the matrix for 3v3 to5v does not list the MAX485 chip. I gave you a thumbs up for a great video and your contributions to the community. My needs are for the EXP32/8266 chips that are 3v3. Interestingly there two sides to the RS485. the external connection side can take a very large swing of voltages as the chip is looking for differential signals on the two lines as the means of detecting data and not any actual voltage. The receiver side has a very large voltage range the LTC1480 is -7 to 12V. The MAX485 is slightly more. That allows a 3v3 ESP8266 device to connect to a PLC or automobile based network that is running at 12 volts. In a side note, I personally try to buy the mainstream parts. I assume there is a flood of them and that brings the lower costs and keeps the chip in production. I suspect that one of the main supply outlets will start with 3v3 and 5v tolerant parts and make us all happy. Thanks again for your educational videos !
@RalphBacon
@RalphBacon 6 лет назад
You are most welcome Dave -in-NJ, I'm glad you like the videos. Nice to hear from you.
@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"?
@RalphBacon
@RalphBacon Год назад
Hmm.. are we talking about THIS device: s.click.aliexpress.com/e/_DE0lb5h That device is controlled via a standard USB-to-Serial (TTL) adapter, just like the ones we use in an Arduino environment. Nothing is mentioned about using RS485, although the protocol might be used as part of that Serial comms... but seems unlikely. Let me know if it is another device.
@lutzmuller5703
@lutzmuller5703 Год назад
@@RalphBacon OK. I saw somewhere that you can use "TTL to RS485 Module UART Port Converter Module EIG88" to control the device. watch?v=yOcoux9IbzM&t=218s
@mumumumah
@mumumumah 6 лет назад
Great Videos Ralph - keep up the good work. (You kind of sound a bit like Pierce Morgan - but a much kinder, smarter version. )
@RalphBacon
@RalphBacon 6 лет назад
Let's not forget _poorer_ version! I'm not sure whether to be flattered or offended at the comparison (although I have some sympathy with Pierce and his say-it-like-I-see-it manner). Let's hope I'm not as abrasive as him, though! Thanks for the kind words, Rube, and thanks for posting.
@Ed19601
@Ed19601 6 лет назад
Ralph S Bacon Piers surely has a 'say it as I see it' manner, but sadly he is too vain to wear glasses ;-)
@purveyorenterprise5203
@purveyorenterprise5203 5 лет назад
Hi, great video, I have a question, is it possible to connect multiple slaves (rs485 output sensors) to MAX 485 (to A- B), and read slave values from Arduino, Thanks in advance
@RalphBacon
@RalphBacon 5 лет назад
Yes, the RS485 protocol is similar in some ways to I2C and you can hang multiple devices off it. I think I mention this in the video?
@anushka-ru
@anushka-ru 5 лет назад
Great project Ralph, Can you help me fixing issue. My master somehow not receiving anything back. It only sending. Not sure if slave is even getting message.
@RalphBacon
@RalphBacon 5 лет назад
Make sure your TX/RX pair go to RX/TX. Put lots of Serial.print() statements in the code so you can see what, if anything, is happening. Debugging is all part of learning C++ (as I have just spent most of the day tracking down a bug, very laborious, lots of display statements, I know how time-consuming and tedious it can be - but it must be done. Don't give up, you know the sketch works, it can only be your modules and/or the wiring.
@anushka-ru
@anushka-ru 5 лет назад
@@RalphBacon Yes trying same, would it be possible for you to share exact wiring picture, so it might help me debug if i am missing anything from video. Also i am using 2 nano, for which i used Tx & Rx pin and changed code to use 0,1 pin.
@anushka-ru
@anushka-ru 5 лет назад
@@RalphBacon Finally i am getting on both Serial monitor, thanks it took me long to fix it. But i still have issue, the data is always reverse ? mark, i did looked at baud rate and its 9600 on both Serial monitor and program. Any idea what could be i am doing wrong here?
@dominik6684
@dominik6684 4 года назад
Thx for the good video! i tried it out immediately but unfortunately only got This: Received:? in the Responders Serial Monitor. Did i wire something incorrectly? pls help
@RalphBacon
@RalphBacon 4 года назад
So you got a question mark as the received data? Hmm, sounds like corruption or transmission speed incorrect or mismatched. When I get stuck like this I just liberally sprinkle my code with Serial.print statements so I can trace the data from one module to another, and see exactly where it got changed. Try that first, Dominik.
@dominik6684
@dominik6684 4 года назад
@@RalphBacon thx for the quick response, ill try it out later
@digihz_data
@digihz_data 4 года назад
As i promised before, here is the code for using struct with RS485. Same usage of pins as your sketches Ralph. But i added 3 led's to each bord to show sending, recieving and errors. www.digihz.com/ArduinoCode/RS485SenderStructV3.zip www.digihz.com/ArduinoCode/RS485ResponderStructV3.zip Picture of my sender / responder. www.digihz.com/ArduinoCode/Sender_Responder.jpg I will supply a new version soon where the sender sends some configuration struct data to the responder, and the responder sends back sensor values. Sometimes you want to send some configuration values to a slave from a master and once that slave recieves the configuration , then the slave starts to continiously send sensor data back to the master.
@RalphBacon
@RalphBacon 4 года назад
Nicely done, Hans! And well documented too, a man after my own heart. Thanks for sharing, I hope others have a look too.
@digihz_data
@digihz_data 4 года назад
@@RalphBacon so you tried the sketches with leds connected? Or did you just have time to look at the code Ralph? Led' s are more informative i think and fun to look at to. Yes, documentation is allways important, not only for others, but for yourself to when you look at a code 5 years later :)
@RalphBacon
@RalphBacon 4 года назад
I just looked at the code, Hans. But I could see what you were doing. An old Dev Mgr of mine said that we were commenting our code for the next programmer who had to maintain that codebase - who would probably be yourself in 6 months time!!! See, we all think alike.
@digihz_data
@digihz_data 4 года назад
@@RalphBacon ok Ralph. But I think that you should try it in real life... (could be good code for your Bluetooth to to use Easytransfer). But mayby by tomorrow I have the other example finished about sending configuration data from "sender" and "responder" sending back sensor data.
@sunilsatalkar4808
@sunilsatalkar4808 6 лет назад
Hi, thanks good information
@RalphBacon
@RalphBacon 6 лет назад
Thank you, Sunil, appreciated!
@SpeccyMan
@SpeccyMan 6 лет назад
You will find my comment on your blog.
@RalphBacon
@RalphBacon 6 лет назад
Found and replied to Nick! Thanks for posting.
@Rabizza
@Rabizza 5 лет назад
thanks, but i shock see price on banggood, in my country maybe equal $0.3
@RalphBacon
@RalphBacon 5 лет назад
That would depend on which country is your country, Rabizza! If Banggood is too expensive try AliExpress.
@qzorn4440
@qzorn4440 4 года назад
i was told that the RS is Recommended Standard...? thanks...:/
@RalphBacon
@RalphBacon 4 года назад
It could be viewed as that. I'm sure Radio Spares will be delighted to hear it too!
@JxH
@JxH 6 лет назад
Very long wires run outdoors = think about lightning protection.
@RalphBacon
@RalphBacon 6 лет назад
A very good point there, JH. I must admit I imagined in my mind that everyone buries their cables but I guess they could equally string them on poles like telephone wires. Now I know you can get ADSL surge protectors so maybe you can get some other form of surge protection for standard "data" wiring, I just don't know but it's certainly something that should be considered. Thanks for the post.
@boldford
@boldford 6 лет назад
If you have long overhead cable runs it may be possible to include a degree of protection (up to about 15kV) by using opto-isolated transceivers like the LTM2881. Obviously nothing can protect completely against a direct lightning strike. Ouch!
@RalphBacon
@RalphBacon 6 лет назад
I'll keep mine buried, it just seems safer. Thanks for that update, Brian.
@digihz_data
@digihz_data 4 года назад
Great info Ralph! And i had a problem with one of my RS485 modules. I could not get it to work at all at first. But...After checking the RS485 module i noticed that the chip on the module was not soldered correctly at all (1 side of the chip had all 4 legs not even making contact with the circuit board!) After replacing the module with another one, everything worked out fine. SO!!!! Check your modules if you are not getting it to work, Ralphs code IS working. I tested with 50 meters of new telephone cable (still unwrapped from package with 4 leads (using 2 of them) and it worked like a charm, but as Ralph and Nick Gammon states....use a common ground wire to to make the transfer more reliable). I am playing around with EasyTransfer by Bill Porter www.billporter.info/2011/05/30/easytransfer-arduino-library/ Github:github.com/madsci1016/Arduino-EasyTransfer to be able to send and recieve structs, and will post an update here later with the code.
@RalphBacon
@RalphBacon 4 года назад
Glad you got it all working, Hans!
@ellpancha
@ellpancha 6 лет назад
SoftwareSerial doesn't work with big sketches
@RalphBacon
@RalphBacon 6 лет назад
When you say "doesn't work" do you mean you run out of memory space, ellpancha?
@smengineers7865
@smengineers7865 6 лет назад
Please help us arduino to delta hmi how to connect and relay operate.
@RalphBacon
@RalphBacon 6 лет назад
I've half understood the question but you need to rephrase it. Are you looking to operate a relay using RS485 comms, a pair of Arduinos and a touch screen (HMI) made by Delta?
@kennmossman8701
@kennmossman8701 4 года назад
RS485 !!!
@RalphBacon
@RalphBacon 4 года назад
Er, yes, RS485, Kenn! Works well. In fact I have seen several more RS485 modules lately, perhaps it is being used more.
@kennmossman8701
@kennmossman8701 4 года назад
@@RalphBacon It has been two decades since I heard someone talking about it but it still has its uses [I nearly puke at yet another BlueTooth boombox folks insist on using an use tech in ignorance ).
@digihz_data
@digihz_data 4 года назад
I made a new version , same hardware connection as before, only the code is different. www.digihz.com/ArduinoCode/RS485SenderStructV4.zip www.digihz.com/ArduinoCode/RS485ResponderStructV4.zip Picture of my sender / responder. www.digihz.com/ArduinoCode/Sender_Responder.jpg This version (V4) is for sending and recieving in different intervals depending on if the sender and responder are connected or not. Added some error handler function to clean up the code a bit. This example simulate the use of up to 7 pir sensors connected to the responder. (You don't really connect them :) ) INFO:Use the led's, disconnect the sender or responder or the RS485 data line and see what happens, that will make you understand everything i think.
@RalphBacon
@RalphBacon 4 года назад
That looks very neat, Hans. And from I can see in the photo, you've used the same coloured wires for each module, good consistency! You'll be wanting a video on LoRa next! Oh, wait! What's just arrived in my mailbox...
@digihz_data
@digihz_data 4 года назад
@@RalphBacon thank you Ralph. I don't know anything about LoRa. I concentrate working on arduino pro mini, arduino Nano and nodemcu 8266.
@RalphBacon
@RalphBacon 4 года назад
LoRa = LOng RAnge radio, a bit like Bluetooth/nRF24L01/433 Serial Transmitters but can have a HUGE range. The record is about 200 Km. OK, in normal use several Km. Keep tuned for a future video on this, you might find it interesting and possibly even useful!
@digihz_data
@digihz_data 4 года назад
@@RalphBacon Of course I will look at it. Wireless solutions are fun and neat, but I prefer wired connections for reability more. Have a nice weekend Ralph.
@AJB2K3
@AJB2K3 5 лет назад
Release the magic smoke from it!
@RalphBacon
@RalphBacon 5 лет назад
I think someone did that already!
@spnro8699
@spnro8699 5 лет назад
love you man.. wanna give you hug right now.. been battling rs485 for over a week now and getting nowhere.. this opened up the opportunity for me to go to the next phase in my home automation system im building. go to this link. www.dropbox.com/s/3renihvj2xt1y7h/20191007_031146.mp4?dl=0 want to have remote arduino nanos around the house detecting motion and writing a numeric code back to main controller with 8 ch dimmer board. codes will specify which rooms detect motion and which havent... if (motion_livingroom == High) write 10001 across rs485 to dimmer control panel. if (motion_kitchen == high) write 20001 ...ect..ect need help with if statements to write certain codes for certain conditions...
@RalphBacon
@RalphBacon 5 лет назад
OK, hug duly accepted (hey, I'm British, we don't go in much for actual physical contact) but the sentiment is nice. Regarding help with your project I recommend the Arduino forum which has many experts literally just waiting to help you if you clearly specify what you are stuck on and what you have done so far to get over the hurdles. forum.arduino.cc/
@markhall3323
@markhall3323 4 года назад
Thanks but it’s just too long and rambling for me
@RalphBacon
@RalphBacon 4 года назад
The wires from a RS485 device can be long and rambling too, though, so I guess I got caught up in my subject matter. All my videos end up at the 30 minute length, so I hope I don't ramble too much in the others.
Далее
The RS-232 protocol
26:10
Просмотров 847 тыс.
Слушали бы такое на повторе?
01:00
НИКИТА ПОДСТАВИЛ ДЖОНИ 😡
01:00
Просмотров 121 тыс.
Designing and Installing an RS485 Serial Network
7:24
Просмотров 202 тыс.
SparkFun According to Pete #54 - How RS-485 Works
14:31
Serial Communication RS232 & RS485
12:58
Просмотров 505 тыс.
Are PIC Microcontrollers Any Good? - Beyond Arduino #4
21:07
UART To RS-485 Interface  / Pro Mini / LoRa Interface
9:51