can-bus

Public

@araobp

Share can-bus

Check access before sharing the link.

Who can open this board

Anyone can open this board. No sign-in is required.

This link opens the latest version. Copying it does not grant additional access.

Loading…

README

IoT with CAN bus

Printed circuit design for CAN node

(I have not tested the printed circuit board yet, because I have been too busy in other priority works)

Motivation

I want to develop very cheap and low power sensor/actuator network with electronic parts sold in Akizuki-Denshi, Tokyo.

Most of parts I use are DIP.

Architecture

Basic concept

I pursue seamless communications between CAN-bus and MQTT-bus:

Specification

The CAN node consists of one base board and one expansion board.

See this page for expansion boards: EXPANSION BOARDS.

CAN node base board

ParameterValueNote
PIC16F1 MCU clock32MHz(Internal OSC 8MHz * 4 PLL)
UART baud rate9600bps (fixed)Full-duplex wire-rate is not supported
SPI clock2MHz (fixed)
CAN speedMax. 250kHz (default 125kHz)
Oscillator for CAN controller8MHz (ceramic)Murata Ceralock
Expansion board8 pins connected to PIC MCU
Circuit

PCB

BOM
Part                    Akizuki-denshi URLPrice in YenQuantity
Microchip PIC16F1825-I/Phttp://akizukidenshi.com/catalog/g/gI-10656/1501
Microchip PIC16F18326-I/Phttp://akizukidenshi.com/catalog/g/gI-11886/1301
Microchip MCP2515http://akizukidenshi.com/catalog/g/gI-12030/1601
Microchip MCP2561http://akizukidenshi.com/catalog/g/gI-12483/901
Murata Ceralock 8MHz    http://akizukidenshi.com/catalog/g/gP-00153/351
Regiter 51k ohmhttp://akizukidenshi.com/catalog/g/gR-25513/11
Register 10k ohmhttp://akizukidenshi.com/catalog/g/gR-25103/11
Register 120 ohm        http://akizukidenshi.com/catalog/g/gR-25121/11
Murata capacitor 0.1 micro Fhttp://akizukidenshi.com/catalog/g/gP-00090/103
Diode 1A                http://akizukidenshi.com/catalog/g/gI-08332/101
Toshiba TA48M05F (w/ capacitors)http://akizukidenshi.com/catalog/g/gI-00451/1001
Polyswitch 250mA        http://akizukidenshi.com/catalog/g/gP-01354302
LED 3mm redhttp://akizukidenshi.com/catalog/g/gI-04780/201
Tactile switch            http://akizukidenshi.com/catalog/g/gP-08216/201
IC sockets 14pins        http://akizukidenshi.com/catalog/g/gP-00006/101
IC sockets 18pinshttp://akizukidenshi.com/catalog/g/gP-00008/101
IC sockets 8pinshttp://akizukidenshi.com/catalog/g/gP-00017/101
Pin socket 6pinshttp://akizukidenshi.com/catalog/g/gC-03784/201
Pin socket 4pins        http://akizukidenshi.com/catalog/g/gC-10099/202
Pin header L shape      http://akizukidenshi.com/catalog/g/gC-01627/501
Phenix Contact terminal block 2Phttp://akizukidenshi.com/catalog/g/gP-08369/201

CAN Standard Identifier format

This implementation supports CAN Standard Frame only (does not support Extended Frame). For home networking, 11bit Standard Identifier suffices.

=> FORMAT

"CAN adapter to UART" command list

This implementation supports CAN adapter functionality for PC and Android.

/// UART2CAN HELP (version 0.11  March 19, 2018) ///
[Set standard identifier] @i<standard identifier>
[Set output mode] {debug: @vd, verbose: @vv, normal: @vn}
[Enable operation mode] {loopback: @ol, normal: @on}
     with SID: @ols or @ons
[Set mask] @m<n><mask(SID10 ~ SID0)>
[Set filter] @f<n><filter(SID10 ~ SID0)>
[Set baud rate] @b<bpr>
[Abort all pending transmissions] @a
[Dump masks and filters] @F
[Dump registers] @D
[Send message] <message>
[Send message beginning with '@' character] @<@message>
[Receive message] <message> will be output
[Show this help]: @h

For example, to receive messages with SID 5, 10 and 15, set masks and filters to the CAN adapter as follows:

@m02047  --> RXM0 0b11111111111
@f05     --> RXF0 0b00000000101 (SID 5 message to RXB0)
@f110    --> RXF1 0b00000001010 (SID 10 message to RXB0)
@m12047  --> RXM1 0b11111111111
@f215    --> RXF2 0b00000001111 (SID 15 message to RXB1)

Development environment


Development plan and progress

M1 (completed on March 17, 2018)

  • Purchased CAN adaptors from Amazon.
  • Evaluate CAN ==> EVALUATION.
  • Developed my original ASCII-based protocol over serial for MCP2515. The protocol is mainly for evaluating MCP2515.

At first, I use this universal board to make a prototype of the CAN adaptor:

I have finished the first prototype (Marth 25-27, 2018). I have made three boards, and it took eight hours.

M2 (completed on April 1, 2018)

3D printed enclosure for CAN node

  • Purchase three pairs of MCP2515 and MCP2561 in Akihabara.
  • Develop my original CAN adaptor board.
  • Develop CAN-MQTT gateway on RasPi and OpenWrt.
  • Develop a 3D-printed DIN rail enclosure for the board by using FreeCAD.
  • Mount all of them on DIN rail (incl. RasPi).
  • Add SLCAN that is ASCII-based protocol for SocketCAN.

M3

  • Evaluate PIC16F18326 that is cheaper than PIC16F1825 and supports two MSSPs.
  • Use KiCAD to redesign the circuit for PIC16F18326.
  • Adopt moduler architecture: base board and sensor/actuator building blocks.
  • Support sensors and actuators: doppler sensor, CdS, servo motor etc.


Reference

Datasheet (Microchip/NXP/Murata)

Microchip
NXP
Murata
Comments

No comments yet. Be the first to ask about this board.

Ask about this board

Sign in to BoardRepo

New here? Signing in creates your account; there is no separate sign-up.