| Electronics > Beginners |
| Communication bus for off the pcb sensors |
| << < (3/3) |
| Eka:
I formerly had a few I2C sensors at the end of a meter long shielded cable connected to a Raspberry Pi Zero. A few times a year a lightening strike close by could knock out a couple of the sensors. The system then had to have a full power off power cycle for the glitched sensor to start working again. Not easy when the power supply has a battery backup in it. I've had a lot less lockups now that the sensors are on a 30 cm cable, but they still happen. Next revision of the hardware will have the sensors connected through a normally closed TPDT relay. That way I can power the sensors down without powering down the whole system. I'd switch the Vcc, Data, and Clock lines. I'd keep the grounds connected. The dual trow is so the relay grounds the lines when it switches the sensors off to reset them. The I2C bus has proper termination, and transient voltage suppressors (TVS) to clamp the signal lines and Vcc voltages to a maximum of about 6 Volts above ground, and a volt below ground, but that is enough to glitch a couple of the sensors. The system does have a bucket tip type rain gauge, but it is optically isolated using an optical link. |
| T3sl4co1l:
RS-422 transceivers can extend SPI trivially. Just add interfaces, and twisted pair cable. Don't ignore ground, everything is still common ground, and still prefer shielded cable for best results. (RS-422 receivers have a generous immunity, so they can tolerate a fair bit of noise via unshielded cable.) It's not very efficient on wires, but it's very easy to realize. The cables are easy, too -- you can buy 5-pair ribbon cable that's got twisted sections, followed by flat sections where IDC connectors mate as normal. RS-232 and RS-485, with various protocols (and for 485, bus arbitration), are very common for industrial sensors. CAN bus. Maybe Profinet, haven't heard it much around here but I recall it's broadly similar. If heavy-weight solutions are okay, there's always Ethernet, and a facility probably has an existing network of it. For max 2m, I would mind, but accept, I2C on shielded cable. SPI (CMOS level) on shielded cable, with terminations, and maybe added Schmitt trigger receivers, would be a little preferred over that. RS-422 seems a little over-the-top for this range but will be very reliable, even moreso with a shielded cable. I don't think you'd worry about anything else, unless say you've already got a CAN bus in the project so you can just tee onto that. Tim |
| Navigation |
| Message Index |
| Previous page |