

NMEA2000Shunt
NMEA2000 Shunt for measuring current, voltage, temperature based on a INA219.
- Size
- 87.3 × 28.3 mm
- Copper layers
- 2
- Thickness
- 1.6 mm
- Parts
- 26
- Nets
- 26
- Pads
- 100
- Tracks, vias
- 261, 12
- Pours
- 6
- Routed
- Yes
- KiCad
- KiCad 4
- Created
- 4 May 2023
- Updated
- 9 Sep 2023
Overview
NMEA2000Shunt is an open-source printed circuit board by ieb, from the ieb/NMEA2000Shunt repository on GitHub. It is a 2-layer board of 87.3 × 28.3 mm with 26 parts on 26 nets, routed with 261 tracks and 12 vias.
It is built around the ATTINY3224-SSU, MCP2515-I and TJA1050. Its parts include 9 capacitors, 5 resistors, 5 ICs, 4 connectors and 1 diode. It belongs with the AVR (ATmega, ATtiny) boards of this library.
Main components
3ATTINY3224-SSU
SOIC-14-40℃~+85℃ 1.8V~5.5V 12 12bit 20MHz 256Byte 32KB 3KB 8 Bit AVR Built-in FLASH SOIC-14 Microcontrollers (MCU/MPU/SOC) ROHSMicrochip TechnologyMicrocontrollers (MCU/MPU/SOC)MCP2515-I
TSSOP-20-40℃~+85℃ 1Mbps 1uA 2.7V~5.5V 5mA CAN Controller SPI TSSOP-20 CAN Controllers ROHSTokmasCAN ControllersTJA1050
SOIC-8SOIC-8 New Arrivals ROHSPhilips SemiconsUncategorised
README
README.mdNmea2000 Battery Sensor.
Mk1 used the ADC on an Attiny3224. Fine for voltage but not really accurate enough for low levels of current on a 75mV 100A shunt.
This version is built arround a INA219 which is far easier to use. It speaks CAN to communicate with a NMEA2000 bus.
A BLE version was created, but in the end I felt it was overcomplicated and would need to deep sleep to avoid draining the battery.
A Modbus version was also created, but since it adds annother bus I decided to rebuild as a NMEA2000 device using the SmallNMEA2000 library that was used in the CanPressure sensor and EngineManagement modules. Both have been in service for 2 years with no issues.
megaTinyCore
This code needs megaTiny core 2.6.4 to work as there are some timing bugs that cause it to fail with the default platform IO 2.5.11 version. Upgrading is a pain as it requires installing a custom package. Installs from github fail as the layout of the source repo is wrong and missing files.
The hacky way is to install manually as its not possible to install from a git repo due to a bug in the pio code that parses versions numbers.
cd ~/src
git clone https://github.com/SpenceKonde/megaTinyCore.git
cd megaTinyCore
git co -b 2.6.4
mkdir ~/.platformio/packages/framework-arduino-megaavr-megatinycore@2.6.4
cd ~/.platformio/packages/framework-arduino-megaavr-megatinycore@2.6.4
cat << EOF > .piopm
{"type": "tool", "name": "framework-arduino-megaavr-megatinycore", "version": "2.6.4", "spec": {"owner": "platformio", "id": 11448, "name": "framework-arduino-megaavr-megatinycore", "requirements": null, "uri": null}}
EOF
cat << EOF > package.json
{
"name": "framework-arduino-megaavr-megatinycore",
"version": "2.6.4",
"description": "Arduino Wiring-based Framework for Microchip tinyAVR 0-series and 1-series chips (megaTinyCore)",
"keywords": [
"framework",
"arduino",
"microchip",
"tinyAVR"
],
"repository": {
"type": "git",
"url": "https://github.com/ieb/megaTinyCore"
}Oled display
There is a i2c header but at this time the oled display was removed as it served minimal purpose and consumes more current.
LED status
normal operation is on for 250ms, off for 6s. Error states are indetified by a number of 250ms flashes followed by on for 3s off for 3s.
Key
- ^ == short flash
- -3s- == 3s on for 3s
- 3s off for 3s.
- Cycle repeats after 6s
| flashes | condition |
|---|---|
| ^ | normal |
| ^^ -3s- | INA219 chip failure |
| ^^^ -s3- | Can bus not connected or failing to respond |
| ^^^^^ -s3- | Both Can and INA219 failing |
ToDo
- Basic implementation, with CAN.
- Average current and voltage over time period, eg 30s
- Test CAN using a CandelLite adapter.
- Calibrate NTC sensors.
-
Add 1.3 inch Oled display -
Implement current monitoring with auto scaling for different ranges using features of the INA219Limited benefit see p21 Table 7 - design and make box
Parts
26| Qty | Value | Footprint | References |
|---|---|---|---|
| 4 | 100nF | Capacitors_SMD:C_0805 | C104, C105, C107, C201 |
| 4 | 10K | Resistors_SMD:R_0805_HandSoldering | R101, R103, R104, R105 |
| 3 | 10uF | Capacitors_SMD:C_0805 | C103, C106, C206 |
| 2 | 22pF | Resistors_SMD:R_0603_HandSoldering | C101, C102 |
| 1 | 270R | Resistors_SMD:R_0805_HandSoldering | R102 |
| 1 | 8MHz | Crystals:Resonator-2pin_w10.0mm_h5.0mm | X101 |
| 1 | ATTINY3224-SS | Housings_SOIC:SOIC-14_3.9x8.7mm_Pitch1.27mm | IC101 |
| 1 | Battery | Connect:bornier3 | K101 |
| 1 | CAN | Connect:bornier4 | P103 |
| 1 | INA219-module | Divers:INA219Module | U104 |
| 1 | LED | LEDs:LED_0805 | D101 |
| 1 | MCP2515 | Housings_SOIC:SOIC-18W_7.5x11.6mm_Pitch1.27mm | U101 |
| 1 | NCP1117ST50T3G | TO_SOT_Packages_SMD:SOT-223-3Lead_TabPin2 | U103 |
| 1 | OLED | Pin_Headers:Pin_Header_Straight_1x04 | P105 |
| 1 | Prog | Pin_Headers:Pin_Header_Straight_1x05 | P102 |
| 1 | TJA1050 | Housings_SOIC:SOIC-8_3.9x4.9mm_Pitch1.27mm | U102 |
| 1 | Temp1 | Pin_Headers:Pin_Header_Straight_1x02 | P101 |
Similar boards
- 2 layers89.2 × 38.3 mm

- 2 layers66.4 × 28.1 mm

CanPressure
ieb/CanPressure
NMEA2000 Sensor based on ATTiny3224 for Pressure, Temperature, Humidity
18 parts - 2 layers150 × 100 mm

EngineManagementSimpleWithMosfets
ieb/EngineManagement
Replacement engine electronics for a Volvo Penta D2-40 and other MDI based engines.
151 parts1 - 2 layers56.7 × 25.4 mm

BatteryMonitorATTiny3224
ieb/BatterySensor
A Modbus RTU Battery Current and Voltage sensor board based Attiny3224, MAX485, MAX9918 chips.
24 parts1 - 2 layers64.6 × 47.9 mm

- 2 layers21.1 × 19.6 mm

Soic14-bb
jaco-pixeldump/attiny-soic-14-barebone-breakout-board
A compact, breadboard-friendly breakout adapter PCB for 14-pin SOIC Microchip ATtiny microcontrollers (such as ATtiny3224, ATtiny1624, ATtiny824, ATtiny424, as well as 1-series and 0-series parts like ATtiny1614…
5 parts1MIT - 2 layers79 × 80 mm

- 2 layers93 × 93 mm

Questions
How big is the NMEA2000Shunt PCB?
It measures 87.3 × 28.3 mm and has 2 copper layers, 1.6 mm thick.
What parts does the NMEA2000Shunt use?
26 parts, built around the ATTINY3224-SSU, MCP2515-I and TJA1050. The full list of its parts is on this page, with links to each part's symbol and footprint where PCBKit's library has them.
Where can I download the NMEA2000Shunt KiCad files?
From the ieb/NMEA2000Shunt repository on GitHub, at the commit this page was made from: the board is pcb/NMEA2000Shunt.kicad_pcb. PCBKit opens the board in the browser, with nothing to install.
Can I use the NMEA2000Shunt design in my own project?
Its repository states no licence, so its author keeps all rights: ask ieb before reusing the design.