Skip to the content
PCBKitNew board
2 layers68.6 × 53.3 mmJVS IO, the printed circuit board in 3D

JVS Library for Arduino

Size
68.6 × 53.3 mm
Copper layers
2
Thickness
1.6 mm
Parts
52
Nets
47
Pads
157
Tracks, vias
317, 24
Pours
2
Routed
Yes
KiCad
KiCad 6 (file 20211014)
Created
16 Aug 2021
Updated
29 Apr 2024

Overview

JVS IO is an open-source printed circuit board by NaokiS28, from the NaokiS28/jvs repository on GitHub. It is a 2-layer board of 68.6 × 53.3 mm with 52 parts on 47 nets, routed with 317 tracks and 24 vias.

It is built around the MAX485ED, LM393 and BC847, with the BAS70-04 among its other parts. Its parts include 22 resistors, 5 diodes, 5 connectors, 4 transistors and 3 capacitors.

Main components

4

README

readme.md

JVS ArduinIO

This is a WIP library for communicating over the JVS protocol in Arduino compatible boards. This library supports both host mode and device mode. It requires one hardware UART to work connected to an RS485 transceiver such as the MAX RS485 TTL converter module.

A host can only have 1 input port per instance, a device must have 1 ouput port but may optionally have an input port for daisy chaning IO devices. The data lines are connected between ports, the sense line must connect to an output for the output port and an input for the input port. You will also need to connect the sense pin to pin 1 of USB-A connector.

Hardware

Device mode

This library requires a MAX485 transceiver or equivalent connected to the serial port RX and TX pins. You also need to specify an RTS (Request to Send) pin which is connected to both DE and ~RE.

Finally, you will either need a transistor (BC547 or 2n2222 or eqv.) for pulling the sense line low; whilst you can use the IO pin directly, it is better practice to do it this way to protect your MCU and the library would need to be changed to uninvert the pin. The sense line needs to be at 2.5v with the ID unset, and it's recomended to use 4x 1n4007 diodes from the sense line to ground to acheive this but users have reported a 1K resistor will also work - This will depend entirely on the host you are using.

Optionally you can specify a sense input line but this isn't unless you are supporting daisy chaining. If you are, you need a way to automatically terminate or remove the termination resistors from the bus. The bus must be terminated if there is no secondary IO board attached. It must not be terminated if there is a secondary IO board attached to your device.

Here is an example with downstream IO sensing which is needed for daisychaining. alt text

Host mode

In host mode, it is advised to use an LM393 opamp to handle 5V, 2.5v and 0v sensing. This allows one to use either two pin or one pin to sense IO status (present with/out ID, not present). Otherwise, you can connect this to a GPIO pin, perhaps use a 220Ω resistor in line for over current protection.

Sensing

Depending on how you want to sense IO boards, you will need to consider different methods of sensing the IO board attached.

The SEGA/Nintendo/Namco Triforce does single pin sensing which is good enough for most use cases: alt text

Another option is to remove the buffer gate and use two pins for better sensing. This allows one to know exactly the state of the sense in pin, be it IO board not connected, IO is present with no ID or present and ID'd. The SEGA Chihiro uses a verison of this sensing: alt text

Usage

To use the library, include it before setup and then declare an instance by passing a UART port and the sense pin input/output. On Arduino UNO this will be Serial, but on board with multiple serial ports, you can use Serial2, Serial 3 etc. You cannot use SerialUSB. Note you can only have one instance at one time.

text
#include "jvs.h"
JVS jvs(Serial, 2, 3);     // HardwareSerial port, Sense pin, RTS pin

Once delcared, you will then need to run the initialization routines at startup either as a host node or a device node.

text
// Init as Device
void setup(){
    jvs.begin(DEVICE_NODE);    // Begin as device node
    jvs.initDevice();
}
text
// Init as Host
void setup(){
    jvs.begin(HOST_NODE);    // Begin as host node
    int found = jvs.initHost();       // Will hang here until devices are assigned or there is no JVS nodes. Returns number of JVS nodes
    //Serial1.print("Found: ");
    //Serial1.print(found);
    //Serial1.println(" nodes");
}

Then you will need to put update() in your loop. This is so you can receive packets from the IO board. You can have the JVS library run command codes, so long as it's in device mode and have set the iput/output data arrays:

text
void loop(){
    if(jvs.update()){
        jvs.runCommand();
    }
}

Or you can read the data in manually:

text
void loop(){
    if(jvs.update()){
        JVS_Frame inFrame;      // Frame in
        inFrame = jvs.read();   // Read frame into buffer
    }
}

Data Storage/JVS Frame layout

The data for commands and arguments is stored in JVS_Frame.data:

text
struct JVS_Frame {
    uint8_t sync = 0xE0;            // Sync is always E0
    uint8_t nodeID = 0;             // Node that frame is intended for, 0xFF is a boradcast frame
    uint8_t numBytes = 0;           // Includes all subsequent bytes (Status, data and sum) in frame after this byte
    uint8_t statusCode = 1;
    union{
        uint8_t data [254] = {0};   // Is command and parameters from host, report and results from device
        uint16_t data16 [127];      // Some parameters are 16-bit ints
        char dataString [102];      // When reading node IDs, they are stored as ASCII
    } ;
    uint8_t sum = 0;                // Checksum of ID, numbytes, data bytes
    uint8_t cmdCount = 1;           // Number of commands counted. Only counts standard commands (not manufacturer specific)
};

JVS Info

Both host and device nodes will need some data to report back when requested. The host needs the game name filled in where as devices need to report their name and what features it supports. If no data is supplied, it is prefilled with generic data. Note: When set as device, _ident is used where as _mainID is used when set to host. It's worth noting that only Namco games/devices seem to care about the main board ID, you can choose to support it or not, but Namco games might not be happy if you don't support it.

The library supports storing JVS IO board data in the following struct. This can be used for multiple IO boards by delcaring an array.

text
struct JVS_Info {
    char ident[100] = {"JVS ArduinIO;github.com/NaokiS28/jvs;VER:0.1 Beta"};
    char mainID[100] = {"ArduinoIO Host;github.com/NaokiS28/jvs;VER:0.1 Beta"};
    uint8_t cmdRev = 11;            // Stored as BCD, some JVS hosts (Triforce) will report ver 0.0 if it's higher than 1.1
    uint8_t jvsRev = 30;            // Stored as BCD, JVS rev. 20 and 30 are valid
    uint8_t comRev = 10;            // Stored as BCD, use 10 unless you need to otherwise
    uint8_t totalFeatures = 4;      // How many features supported, this isnt sent to the host but for the library
    featureTypes featureSupport[16] = {
        switchInput, coinInput, analogInput, gpOutput       // Supported features. These are listed in jvs_message.h
    };
    uint8_t featureParameters[16][3] = {                    // Parameters for the list of supported features.
        {2, 12, 0},     // Is switchInput in generic construction
        {2, 0, 0},      // 2 Coin slots
        {6, 10, 0},     // 6 ADCs, 10-Bit resolution
        {8, 0, 0}       // 8 GPOs (general purpose output)
    };
};

Parts

52
QtyValueFootprintReferences
14103Resistor_SMD:R_1206_3216MetricR1, R5, R6, R7, R8, R9, R11, R12, R13, R14, R15, R16, R18, R20
4102Resistor_SMD:R_1206_3216MetricR10, R17, R21, R22
4BC847Package_TO_SOT_SMD:SOT-23Q1, Q2, Q3, Q4
210Capacitor_SMD:C_1206_3216MetricC1, C3
2473Resistor_SMD:R_1206_3216MetricR2, R3
2BAS70-04Package_TO_SOT_SMD:SOT-23D4, D5
2Conn_01x03Connector_PinHeader_2.54mm:PinHeader_1x02_P2.54mm_VerticalJ3, J4
2Conn_01x08Connector_PinHeader_2.54mm:PinHeader_1x08_P2.54mm_VerticalJ1, PPWR1
2Jumper_2_OpenJumper:SolderJumper-2_P1.3mm_Open_Pad1.0x1.5mmJPN1, JPP1
10.1Capacitor_SMD:C_1206_3216MetricC2
1121Resistor_SMD:R_1206_3216MetricR19
1333Resistor_SMD:R_1206_3216MetricR4
1Conn_01x03Connector_PinHeader_2.54mm:PinHeader_1x03_P2.54mm_VerticalJ2
1Conn_01x10Connector_PinHeader_2.54mm:PinHeader_1x10_P2.54mm_VerticalPdig2
1DDiode_SMD:D_1206_3216MetricD1
1G6S-2Relay_THT:Relay_DPDT_Omron_G6S-2K1
1ID-SETLED_SMD:LED_1206_3216MetricD3
1IO-SETLED_SMD:LED_1206_3216MetricD2
1LM393Package_SO:SOIC-8_3.9x4.9mm_P1.27mmU2
1MAX485EPackage_SO:SOIC-8_3.9x4.9mm_P1.27mmU1
1USB_AConnector_USB:USB_A_CONNFLY_DS1095-WNR0JVS-A1
1USB_BConnector_USB:USB_B_Lumberg_2411_02_HorizontalJVS-B1

The 47 most common of 52 parts.

Questions

How big is the JVS IO PCB?

It measures 68.6 × 53.3 mm and has 2 copper layers, 1.6 mm thick.

What parts does the JVS IO use?

52 parts, built around the MAX485ED, LM393, BC847 and BAS70-04. 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 JVS IO KiCad files?

From the NaokiS28/jvs repository on GitHub, at the commit this page was made from: the board is shield/JVS-IO/JVS-IO.kicad_pcb and its schematic shield/JVS-IO/JVS-IO.kicad_sch. PCBKit opens the board in the browser, with nothing to install.

Can I use the JVS IO design in my own project?

Its repository states no licence, so its author keeps all rights: ask NaokiS28 before reusing the design.

Similar boards

  • 2 layersATMEGA 32 2, the printed circuit board in 3D

    ATMEGA 32 2

    ernest-czachorowski/Flood-Sensors-KiCad-Files

    This repository contains KiCad files for my master's thesis IoT infrastructure, which includes water leak detection sensors.

    54 partsMIT
  • 2 layers130 × 50 mmSahara, the printed circuit board in 3D

    Sahara

    AcrylicEater/Sahara

    PCB and Software for converting cheap food dehydrator to precise 3d printer filament dryer

    78 parts
  • 2 layersJvc, the printed circuit board in 3D

    Jvc

    ags-tubs/jvc-remote

    JVC Camera Remote Protocol

    34 parts4GPL-3.0
  • 2 layers93.4 × 87.4 mmNODE, the printed circuit board in 3D

    NODE

    maivananh111/NODE_PCB

    NODE_PCB

    138 parts
  • 2 layers100 × 60 mmGatewayPlus V1.4, the printed circuit board in 3D

    GatewayPlus V1.4

    maivananh111/PCB_GatewayPlus_V1.4

    278 parts
  • 2 layers99 × 105 mmSTM32 IOT GATEWAY, the printed circuit board in 3D

    STM32 IOT GATEWAY

    RiddheshVeling/Industrial-Flowmeter-Totalizer-with-Modbus-based-HMI-and-Data-Logging

    EXTC Final year project: Industrial flowmeter totalizer with Modbus-based HMI for real-time monitoring and data logging using STM32 and RS485.

    154 parts
  • 2 layers96.5 × 81.3 mmIncubator, the printed circuit board in 3D

    Incubator

    Socketto/Incubator_ESP32

    Wifi incubator with ESP32-wroom

    53 parts
  • 2 layers130 × 80 mmSmu main 1, the printed circuit board in 3D

    Smu main 1

    jaromir-sukuba/J-SMU

    DIY source-measure unit

    210 parts244