> ## Documentation Index
> Fetch the complete documentation index at: https://docs.hyperwisor.com/llms.txt
> Use this file to discover all available pages before exploring further.

# NI Evaluation Board V1

> Industrial-grade ESP32 I/O board — 8 digital inputs, 2 relays, 0-10V DAC, pulse counting, RS485/Modbus, PWM.

The **NI Evaluation Board V1** is an industrial-grade I/O board built on the
ESP32. It exposes digital inputs, relay outputs, 0-10V analog outputs, pulse
counters, RS485/Modbus, a push button, and PWM — all through a single
Arduino library, and it works with the Hyperwisor [firmware SDK](/firmware/overview).

## Features

* **8 digital inputs** — optically isolated, via PCF8574
* **2 relay outputs** — high-current relay control, via PCF8574
* **2 DAC outputs** — 0-10V analog, 12-bit (GP8403)
* **2 pulse counters** — hardware interrupt-based
* **RS485** — half-duplex with automatic direction control
* **Modbus RTU** — full Master and Slave implementation for PLC/SCADA
* **Push button** — single / double / triple / long-press detection
* **2 PWM outputs** — configurable frequency and resolution
* **Status LED** — onboard indicator

## Hardware specifications

| Component              | Model           | I²C address | GPIO              |
| ---------------------- | --------------- | ----------- | ----------------- |
| Digital input expander | PCF8574         | `0x3A`      | —                 |
| Relay expander         | PCF8574         | `0x3C`      | —                 |
| DAC                    | GP8403 (12-bit) | `0x58`      | —                 |
| I²C bus                | —               | —           | SDA 4, SCL 5      |
| Pulse inputs           | —               | —           | 34, 35            |
| Push button            | —               | —           | 16 (input pullup) |
| PWM outputs            | LEDC            | —           | 32, 33            |
| Status LED             | —               | —           | 2                 |
| RS485                  | Serial2         | —           | RX 14, TX 13      |

### Pin mapping

```
Digital Inputs  (PCF8574 @ 0x3A):  IN1–IN8 → P0–P7
Relay Outputs   (PCF8574 @ 0x3C):  RELAY1 → P3,  RELAY2 → P2
DAC Outputs     (GP8403  @ 0x58):  DAC_CH0, DAC_CH1 → 0–10V

Direct ESP32:
  GPIO 34 → PULSE1 (input only)    GPIO 33 → PWM2
  GPIO 35 → PULSE2 (input only)    GPIO  2 → Status LED
  GPIO 16 → Push Button (pullup)   GPIO 14 → RS485 RXD
  GPIO 32 → PWM1                   GPIO 13 → RS485 TXD
  GPIO  4 → I2C SDA                GPIO  5 → I2C SCL
```

## Install the library

<Card title="NI-EVALUATION_BOARD-V1" icon="github" href="https://github.com/nikolaindustry/NI-EVALUATION_BOARD-V1">
  Board library, examples, and docs on GitHub.
</Card>

Install **NI-EVALUATION\_BOARD-V1** from the Arduino Library Manager, or clone it
into your `libraries/` folder:

```bash theme={null}
cd ~/Documents/Arduino/libraries/
git clone https://github.com/nikolaindustry/NI-EVALUATION_BOARD-V1.git
```

**Dependencies:**

* **PCF8574** by Renzo Mischianti (Library Manager)
* **ESP32 Arduino Core** (Boards Manager)

## Quick start

```cpp theme={null}
#include <NI-EVALUATION_BOARD-V1.h>

NIEvaluationBoardV1 board;

void setup() {
  Serial.begin(115200);
  if (board.begin()) Serial.println("Board initialized!");
}

void loop() {
  bool input1 = board.readDigitalInput(1);   // read input
  board.setRelay(1, input1);                  // drive relay 1
  board.setAnalogVoltage(0, 5.0);             // 5.0 V on DAC ch0
  unsigned long pulses = board.getPulseCount(1);
  delay(100);
}
```

`begin()` accepts optional RS485 baud, PWM frequency, and PWM resolution:
`begin(rs485Baud = 115200, pwmFreq = 5000, pwmResolution = 8)`.

## API summary

| Subsystem      | Methods                                                                                                                                                                   |
| -------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| Digital inputs | `readDigitalInput(channel)`                                                                                                                                               |
| Relays         | `setRelay(channel, on)`, `setAllRelays(on)`                                                                                                                               |
| DAC (0-10V)    | `setAnalogVoltage(channel, volts)`, `setAnalogRaw(channel, value)`                                                                                                        |
| Pulse counters | `getPulseCount(channel, resetAfterRead = false)`                                                                                                                          |
| PWM            | `setPwmDuty(channel, duty)`, `configurePwm(freq, resolution)`                                                                                                             |
| RS485          | `rs485ReadLine(timeoutMs)` (+ direction handled automatically)                                                                                                            |
| Modbus Master  | `readCoils`, `readDiscreteInputs`, `readHoldingRegisters`, `readInputRegisters`, `writeSingleCoil`, `writeSingleRegister`, `writeMultipleCoils`, `writeMultipleRegisters` |
| Modbus Slave   | `setSlaveAddress(addr)`, `process()`, `onReadCoil/onWriteCoil/onReadHoldingRegister/…` callbacks                                                                          |

## Using it with Hyperwisor

The board library is independent, but it pairs with the Hyperwisor
[firmware SDK](/firmware/overview): read inputs / drive outputs with the board
API, then push values to dashboard widgets and receive commands with the
Hyperwisor library. The board repo includes a **HypervisorIOT** example showing
the two together.

<CardGroup cols={2}>
  <Card title="Firmware SDK" icon="microchip" href="/firmware/overview">
    Connect the board to a dashboard.
  </Card>

  <Card title="The core loop" icon="diagram-project" href="/learn/how-it-works">
    Push values, receive commands.
  </Card>
</CardGroup>
