RS485-CAN-HAT

From SB-Components Wiki

Revision as of 06:23, 25 May 2021 by Sbcshop (talk | contribs) (Created page with "<div class="row"> <div class="large-8 column"> == RS485 CAN HAT == RS485 CAN HAT is a multi node communication module, to communicate with devices in a long-range, designed...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

RS485 CAN HAT

RS485 CAN HAT is a multi node communication module, to communicate with devices in a long-range, designed dedicatedly for Raspberry Pi with an operating voltage of 3.3 V, CAN controller MCP2515 via SPI interface, onboard transceiver SN65HVD230 that is controlled via UART. It is built to support automatic TX/RX control without programming. It performs half-duplex communication and it has an onboard transceiver SP3485.

Features

  • Onboard TVS (Transient Voltage Suppressor),lightning-proof & anti-electrostatic
  • Standard Raspberry Pi 40 Pins GPIO Extension Headers
  • Half-duplex Communication
  • Long-Distance Communication via RS485/CAN functions


Specifications

  • Operating voltage: 3.3V
  • CAN transceiver: SN65HVD230
  • RS485 transceiver: SP3485
  • CAN controller: MCP2515
  • Communication Protocol - RS485 and CAN
RS485 CAN HAT
Buy it From : Click Here

Pinout

Board PINRaspberry Pi GPIO (BCM)DESCRIPTION
3V33V33.3V Power
GNDGNDGround
SCKGPIO 11SPI clock input
MOSIGPIO 10SPI data input
MISOGPIO 9SPI data output
CSGPIO 8SPI chip selection
INTGPIO 25Interrupt
RXDGPIO 14RS485 UART receive
TXDGPIO 15RS485 UART transmit
RSEGPIO 4RS485 TX/RX control (auto control by default)

Installation

Python

  • Stack PiRelay-V2 HAT on Raspberry Pi 40 Pin GPIO header.
  • Make sure all four jumpers are connected.
  • Open Terminal and clone/download the repository by typing below command in terminal:
 git clone https://github.com/sbcshop/PiRelay-V2 
  • Your code will be downloaded to '/home/pi' directory. Use 'ls' command to check the list of directories and 'cd' command to enter directory.
 cd PiRelay-V2 
  • 'test.py' is example code for PiRelay-V2. Run test file and play with PiRelay-V2 by running below python command.
 python3 test.py 
  • You can also use any other GPIO of Raspberry Pi by removing the jumpers and connecting relay pin directly to the Raspberry Pi GPIO header using jumper cables or wire.

GPIO 4 Relay Not working Fix

  • Click on Start button >> Preferences >> Raspberry Pi Configuration, Then click on Interfaces Tab and make sure 1-Wire is disabled.
  • Click on OK button then reboot Raspberry pi.

Relay4Fix.PNG

Resources