#I want two RPi Picos to talk to each
1 messages · Page 1 of 1 (latest)
I have some RS-485 breakouts from SparkFun that use the SP3485 transceiver, not sure if that would be an avenue, or if I should do direct UART connections between the two Picos? I have not been able to locate any tutorials or code examples for CircuitPython for this.
Can it be done with busio.UART or is that just a software way of having two picos communicate?
I currently do not have a lot of money to spend on this project, so I am hoping I don't have to buy more feathers or wings or whatever to make this happen...
Goal is essentially: Pico 1 has 6 analog buttons. Whenever these buttons are on/off, it will send a signal to the secondary Pico that sits on a Waveshare Pico-Relay-B board, and it will in turn pull the specified relay low/high.
Any help appreciated!
Maybe I can use something like this? https://www.adafruit.com/product/5728
Oh, snap, this might be the way to go... but, expensive... https://www.adafruit.com/product/5724
Or, maybe use some of the QT Py boards I have?! https://www.adafruit.com/product/5877
Except, then I would have very limited GPIO, right?
Anyway. Hoping someone can provide some advice here. Thank you for your time.
Can you say more about the data volumes and needed speeds, and the electrical environment (clean or noisy)?
CAN should work (#general-chat message) but it the messages are tiny, UART not sure... depends? There is differential for I2C (#help-with-projects message), but that's going to require some specialized programming probably.
UART is easy to test with different speeds and parameters, maybe different wiring.
Data volumes will be relatively low, I am mainly trying to control either relays or MOSFETs to switch higher current loads that are part of a vehicle 12V system.
The electrical environment will be relatively noisy, I assume, as part of the network will be present in the engine bay.
There is some support for RS-485 in busio.UART https://docs.circuitpython.org/en/latest/shared-bindings/busio/index.html#busio.UART. I'd suggest running some tests with what you have first to see if you can get something reliable enough. There's not a lot of data, and you can probably get by with low speed, so distance and noise are really the critical things. Differential signaling would help.
Just tested board.UART() (default 9600 baud) over approximately 40-50 feet of Cat5 cable (just b/c it was handy). Not a noisy environment, but this seems to work fine (short packets with CRC sent and checked). These alternatives are close to the ballpark, but again differential signaling (or at the very least, shielded cable) would really help in your environment. CAN is designed for this kind of thing.
Thank you, @lethal hollow! I think I'll get some CAN breakouts from Adafruit, then. Can I use regular cable/wire with CAN, or will it require shielded cable?
For your distance of 10m in a noisy environment, I'm not sure. There is specifically-designed CAN bus cabling, but if you have some, I'd try regular Cat5-Cat6 Ethernet unshielded twisted pair first. L and H should be on the same twisted pair, and ground need to run through the cable too.
I think I have a length of industrial cat5 somewhere! I'll see if I can find it.
some ethernet cables are shielded, you may get lucky