nice!nano v2 Library for Proteus simulation: the macro pad with four keys, the knob, the MUTE LED and the phone

nice!nano v2 nRF52840 Library for Proteus: BLE Macro Pad Simulation

40
700
60
25
60
PCBWay

Hello friends, I hope you all are doing great. Today, I am going to share the nice!nano v2 Library for Proteus, so you can run a Bluetooth LE simulation of the nice!nano v2 - the tiny nRF52840 board that wireless keyboard makers drop into the place of a Pro Micro. It has the Pro Micro's pinout, a USB-C port, a Li-Po charger and a blue LED. Our part is drawn at true scale, and it runs your Arduino sketch in Proteus 8.5 with Bluetooth LE to a phone.

nice!nano v2 macro pad simulation in Proteus: the keys, the knob, the MUTE LED and the phone at work
Figure: The macro pad working in the Proteus simulation.
Updates

nice!nano v2 Library for Proteus

Latest version: V1.0 (November 2026, this tutorial)

Helping Tools

For the demo we built a Bluetooth macro pad: four keys for PLAY/PAUSE, MUTE, PREVIOUS and NEXT, a volume knob, a red MUTE light, and a phone that receives every key.

NOTICE: Proteus has no nRF52840 model, so our team has put a lot of effort into building this board ourselves: the pins, the LEDs and Bluetooth LE to the phone are all our own model, and your sketch compiles with our free TEP Boards for Proteus add-on. Your feedback is the fuel that keeps us going, so please tell us what you think in the comments below. And if our free libraries help you, you can buy us a coffee. So, let's get started with the nice!nano v2 Library for Proteus:

nice!nano v2 Library for Proteus simulation: the macro pad with four keys, the knob, the MUTE LED and the phone
Figure: The nice!nano v2 Library for Proteus: the macro pad at work.

What is the nice!nano v2?

The nice!nano is a development board by Nice Technologies made to replace the Pro Micro in mechanical keyboards. Hundreds of keyboard designs - split boards like the Corne and the Lily58, macro pads, numpads - have a Pro Micro footprint. Put a nice!nano into that socket and the keyboard becomes wireless: the board carries the Nordic nRF52840 (an Arm Cortex-M4F with 1 MB of flash, 256 KB of RAM and Bluetooth LE), a charger for a small Li-Po battery and a USB-C port.

Version 2 is the current one. It keeps the Pro Micro's 24 pins in the same places, adds two battery pads at the top (B+ and B-), three extra GPIO pads near the bottom (21 GPIOs in all), a blue LED you can program, an orange charge LED and a MOSFET that can cut the 3.3 V VCC pin to save the battery when LEDs on the keyboard are idle.

The real nice!nano v2 and the library
PartThe real boardIn the library
ChipNordic nRF52840, Bluetooth LEyour Arduino sketch, ArduinoBLE
Size18 x 33.5 mm, Pro Micro pinoutdrawn at true scale
Pin numbersP0.06, P1.04 and so onn = P0.n, 32 + n = P1.n, plus D0 to D21
AnalogP0.02, P0.29, P0.31 on the headerA1, A2, A3: analogRead 0 to 1023
LEDsblue on P0.15, orange chargethe blue one programmable
BusesSerial1, I2C, SPI on the Pro Micro placesthe same pins
PowerUSB-C, Li-Po on B+ / B-, VCC cut-offdrawn; VCC always on

A Pro Micro Replacement

The maker's pinout puts every signal where the Pro Micro has it. On the left from the USB end: B-, P0.06 (D1), P0.08 (D0), GND, GND, P0.17 (D2), P0.20 (D3), P0.22 (D4), P0.24 (D5), P1.00 (D6), P0.11 (D7), P1.04 (D8) and P1.06 (D9). On the right: B+, RAW, GND, RESET, 3.3V, P0.31 (D21), P0.29 (D20), P0.02 (D19), P1.15 (D18), P1.13 (D15), P1.11 (D14), P0.10 (D16) and P0.09 (D10). Our part has the same rows, labelled like the silk on the back of the real board (006, 008, 017 and so on).

Pin Numbers and Pro Micro Names

The nRF52840 has two GPIO ports. Our board package numbers the pins like the community and Meshtastic variants: P0.n is pin n and P1.n is pin 32 + n, so P0.22 is pin 22 and P1.04 is pin 36. On top of that, the Pro Micro names of the maker's pinout are ready as constants: D4 is pin 22, D19 is pin 2. Be careful with the small numbers - digitalRead(2) reads P0.02, while digitalRead(D2) reads P0.17. The demo sketch uses the D names throughout.

Features of the nice!nano v2 Library for Proteus

  • The board at true scale: the matte black PCB, the mid-mount USB-C, the orange and blue LEDs, the regulator, the charger, the crystals, the nRF52840, the three extra pads, the logo and the two rows of gold pads, with our small TEP signature.
  • Your sketch: a .hex for "nice!nano v2 (TEP Proteus)" with the nRF52840 pin numbers or the Pro Micro names.
  • Bluetooth LE: ArduinoBLE with services, characteristics, descriptors and notifications; our Mobile WiFi Monitor is the phone.
  • The buses: Serial1, Wire and SPI on the Pro Micro's places, analogRead on A1, A2 and A3.
  • A complete package: about 4.8 MB with the part, the add-on, the push buttons, the potentiometer, the LED, the resistor, the phone and the demo, without the source code of the models.

The nice!nano v2 in Proteus Simulation

nice!nano v2 in Proteus simulation at true scale: the USB-C, the LEDs, the nRF52840 and the 26 pads
Figure: The part as the library draws it, with our small TEP signature.

Search NICENANO in Pick Devices; the device NICENANO V2 is in TEPNICENANO.LIB (Microprocessor ICs, Bluetooth Boards), with the prefix U. The USB-C opens the serial monitor. The real board has no buttons - RESET is a pin - and so has our part.

nice!nano v2 in the Proteus simulation demo before Run, the keys on D4 to D7 and the knob on A1
Figure: U1 in the demo, before Run.

The Pins

The pins in the library
LabelPinWhat the library does with it
006, 0086, 8 (D1, D0)Serial1 TX and RX, or GPIO
017, 02017, 20 (D2, D3)Wire SDA and SCL, or GPIO
022, 024, 100, 011, 104, 10622, 24, 32, 11, 36, 38 (D4 to D9)GPIO, PWM, interrupt, pulse timing
031, 029, 00231, 29, 2 (D21, D20, D19)A3, A2, A1: analogRead 0 to 1023, or GPIO
11547 (D18)GPIO (the Pro Micro's A0 - digital only on the nRF52840)
113, 111, 010, 00945, 43, 10, 9 (D15, D14, D16, D10)SPI SCK, MISO, MOSI, SS, or GPIO
VCC, RAW, B+, GND, B-, RST-3.3 V, the battery +, ground, reset

Download nice!nano v2 Library for Proteus

Click the button below to download nice-nano-v2-Library-for-Proteus-v1.0.zip (about 4.8 MB, without the source code of the models):

nice!nano v2 Library for Proteus V1.0
  • README.txt: installation, the demo, the pins, the properties, troubleshooting and the limits.
  • Proteus Library Files: TEPNICENANO.LIB, the push button, the potentiometer, the LED and the resistor (TEPBUTTON.LIB, TEPPOT.LIB, TEPLED5MM.LIB, TEPRESISTOR.LIB) and the phone and laptop.
  • Proteus Model Files: TEPNET.DLL, TEPBUTTON.DLL, TEPPOT.DLL, TEPLED5MM.DLL and TEPRESISTOR.DLL.
  • Arduino Code: the demo sketch and the TEP Boards for Proteus add-on 2.0.0, with ArduinoBLE.
  • Proteus Simulation: the demo project, its HEX file and copies of the DLLs.

No Proteus yet? Read How to Download and Install Proteus 7 and 8. New to libraries? Follow How to Install a New Library in Proteus.

How to Install nice!nano v2 Library for Proteus

  1. Close Proteus and extract the whole zip file, for example to your Desktop.
  2. Copy the files from Proteus Library Files into the LIBRARY folder of Proteus.
  3. Copy the DLLs from Proteus Model Files into the MODELS folder, replacing an older TEPNET.DLL.
  4. Delete TEPNICENANO.IDX from the LIBRARY folder if it is there.
  5. For your own sketches, copy Arduino Code\TEP Boards for Proteus\hardware into your Arduino sketchbook (Documents\Arduino) and restart the Arduino IDE; the board is nice!nano v2 (TEP Proteus).
  6. Start Proteus, press P and search for NICENANO.

Demo: a Bluetooth Macro Pad in Simulation

A macro pad is a small extra keyboard with a few keys for the things you press all the time. Ours is a media pad: play and pause, mute, previous and next track, and a knob for the volume - the kind of build people start with before their first full keyboard.

Open nice-nano-v2-BLE-Macro-Pad.pdsprj. U1 runs NiceNano_BLE_Macro_Pad.hex; SW1 to SW4 are 6 mm keys from our Push Button Library for Proteus - green PLAY/PAUSE on D4, red MUTE on D5, blue PREVIOUS on D6, yellow NEXT on D7, each from its pin to ground; RV1 is a 9 mm pot from our Potentiometer Library for Proteus - pin 1 to ground, pin 3 to +3.3V, the wiper on A1 (D19); D1 is a red LED from our 5mm LED Library for Proteus, the MUTE light, through R1 (220 ohm) on D8; MOB1 is the phone.

nice!nano v2 Proteus simulation: the macro pad with four push buttons, the potentiometer, the MUTE LED and the phone on A4
Figure: The whole demo: the keys, the knob, the MUTE light, the board and the phone.
The macro pad
WhatMeaning
SW1 .. SW4PLAY/PAUSE, MUTE, PREVIOUS, NEXT - one event per press
the knobthe volume, 0 to 100 %
the red LEDmuted
the blue LEDblinks while advertising, on with a phone, off for a moment per key
the phonethe last key, the volume and the keys sent, with notifications

The Bluetooth Service

Three characteristics carry the last key as text, the volume in percent and the number of keys sent, each with a readable 0x2901 name for the phone's app:

BLEService padService("19B100E0-E8F2-537E-4F6C-D104768A1214");
BLEStringCharacteristic keyChar("19B100E1-E8F2-537E-4F6C-D104768A1214", BLERead | BLENotify, 16);
BLEIntCharacteristic volumeChar("19B100E2-E8F2-537E-4F6C-D104768A1214", BLERead | BLENotify);
BLEIntCharacteristic sentChar("19B100E3-E8F2-537E-4F6C-D104768A1214", BLERead | BLENotify);
BLEDescriptor keyLabel("2901", "Last key");
BLEDescriptor volumeLabel("2901", "Volume %");
BLEDescriptor sentLabel("2901", "Keys sent");

Reading the Keys

Every key is a push button from its pin to ground with the internal pull-up, so it reads LOW while pressed. A key bounces for a few milliseconds, so readKeys() accepts a new level only after 25 ms without a change - one press, one event:

void readKeys() {                                           // each key bounces: a new level counts after 25 ms without a change
  for (byte k = 0; k < 4; k++) {
    const bool raw = digitalRead(KEY_PIN[k]);
    if (raw != lastRaw[k]) { lastRaw[k] = raw; rawSince[k] = millis(); }
    if (raw != level[k] && millis() - rawSince[k] >= DEBOUNCE_MS) {
      level[k] = raw;
      if (level[k] == LOW) sendKey(k);                      // pressed
    }
  }
}

The Volume Knob

The knob is read twenty times a second. knobPercent() averages the last four readings, and readKnob() reports a new volume only when the value has stood still for 250 ms and moved by at least 2 % - the phone hears about real turns, not about the noise of a real pot:

void readKnob() {                                           // 20 times a second: smoothed; reported when it has settled
  ring[ringAt] = analogRead(KNOB); ringAt = (ringAt + 1) % 4;
  const int percent = knobPercent();
  static int last = -1;
  settled = (percent == last) ? settled + 1 : 0;
  last = percent;
  if (settled < 5 || abs(percent - volume) < 2) return;     // still moving (250 ms), or only the jitter
  volume = percent;
  Serial.print(F(">> VOLUME ")); Serial.print(volume); Serial.print(F(" %"));
  if (muted) {                                              // turning the knob unmutes
    muted = false;
    digitalWrite(MUTE_LED, LOW);
    keyChar.writeValue("MUTE OFF");
    Serial.print(F(" (unmuted)"));
  }
  Serial.println();
  showVolume();
}

Mute and Unmute

MUTE is a toggle: it lights the red LED and the phone reads 0 %. Turning the knob while muted unmutes, as most media keyboards do. Each key goes to the phone only when one is connected:

void sendKey(byte k) {
  const char* what = KEY_NAME[k];
  if (k == 1) {                                             // MUTE: a toggle, with its LED
    muted = !muted;
    digitalWrite(MUTE_LED, muted ? HIGH : LOW);
    what = muted ? "MUTE ON" : "MUTE OFF";
    showVolume();
  }
  keyChar.writeValue(what);
  Serial.print(F(">> KEY ")); Serial.print(k + 1); Serial.print(F(": ")); Serial.print(what);
  if (BLE.connected()) {
    sent++;
    sentChar.writeValue(sent);
    blinkUntil = millis() + BLINK_MS;                       // the blue LED blinks off: sent
    Serial.print(F(" (sent ")); Serial.print(sent); Serial.println(F(")"));
  } else {
    Serial.println(F(" (no phone yet: not sent)"));
  }
}

The Blue LED

The blue LED tells the state without a screen: a short blink every second while the pad advertises, steady with a phone, and off for 80 ms whenever a key has been sent:

void updateLed(bool connected) {
  bool on;
  if (connected) on = millis() >= blinkUntil;               // on, off for a moment per key
  else on = (millis() % ADV_PERIOD_MS) < BLINK_MS;          // a short blink every second while advertising
  digitalWrite(LED_BUILTIN, on ? HIGH : LOW);
}

Run the Simulation

Press Run. The serial monitor - the same window as our TEP Serial Monitor Advance for Proteus - shows the volume and the name the board advertises, and the blue LED starts to blink:

nice!nano v2 Bluetooth Macro Pad - The Engineering Projects
Volume 50 %   keys D4 PLAY/PAUSE, D5 MUTE, D6 PREVIOUS, D7 NEXT
Advertising as "nice!nano Macro Pad"
Pad: advertising, volume 50 %, keys sent 0
nice!nano v2 serial monitor in the Proteus simulation: the volume and advertising
Figure: The serial monitor at the start.
Potentiometer window in the Proteus simulation: the volume knob at 50 %
Figure: The potentiometer's window.
Push button window in the Proteus simulation: SW1, the PLAY/PAUSE key
Figure: A key's window.

Connect the Phone

On the phone open the Bluetooth app, press SCAN and connect to "nice!nano Macro Pad" - the blue LED stays on:

Mobile WiFi Monitor in the Proteus simulation: the scan finds nice!nano Macro Pad
Figure: The phone's scan.
Mobile WiFi Monitor in the Proteus simulation: READY, the volume and no keys yet
Figure: The phone: connected.

Press a Key

In SW1's window click Press (or click the key on the sheet): the monitor prints the key, the blue LED blinks off once and the phone shows PLAY/PAUSE:

Push button window in the Proteus simulation: SW1 pressed
Figure: SW1 pressed.
nice!nano v2 in the Proteus simulation: the blue LED on, a phone connected
Figure: The board with a phone connected.
Mobile WiFi Monitor in the Proteus simulation: the last key PLAY/PAUSE, one key sent
Figure: The phone: PLAY/PAUSE.

Turn the Volume, then Mute

Click the +10 % chip in the pot's window twice: the volume goes to 60 %, then 70 %. Then press MUTE (SW2): the red LED lights and the phone reads MUTE ON and 0 %. Here is the complete circuit while the simulation runs:

Potentiometer window in the Proteus simulation: the volume knob at 70 %
Figure: The knob at 70 %.
nice!nano v2 macro pad in the Proteus simulation: the red MUTE LED lit
Figure: Muted: the red LED.
The complete nice!nano v2 macro pad running in the Proteus simulation workspace
Figure: The complete circuit running in the Proteus workspace.
Mobile WiFi Monitor in the Proteus simulation: MUTE ON, the volume 0 %
Figure: The phone: muted.

Unmute with the Knob

Press NEXT (SW4), then click the 100 % chip: the knob unmutes the pad - the red LED goes out and the phone reads 100 %. A last press of PREVIOUS (SW3) makes four keys sent:

Potentiometer window in the Proteus simulation: the volume knob at 100 %
Figure: The knob at 100 %.
nice!nano v2 macro pad in the Proteus simulation: unmuted, the MUTE LED off
Figure: Unmuted.
Mobile WiFi Monitor in the Proteus simulation: MUTE OFF at 100 %
Figure: The phone: 100 %.
Phone connected
>> KEY 1: PLAY/PAUSE (sent 1)
>> VOLUME 60 %
>> VOLUME 70 %
Pad: phone connected, volume 70 %, keys sent 1
>> KEY 2: MUTE ON (sent 2)
>> KEY 4: NEXT (sent 3)
>> VOLUME 100 % (unmuted)
>> KEY 3: PREVIOUS (sent 4)
Pad: phone connected, volume 100 %, keys sent 4
nice!nano v2 serial monitor in the Proteus simulation: the keys, the volume, mute and unmute
Figure: The serial monitor after the run.

Keys on Pins or in a Matrix?

Four keys can each have their own pin. A full keyboard cannot: a 60 % board has about 61 keys, and the nice!nano has 21 GPIOs. Keyboards therefore wire the keys in a matrix - rows and columns, a diode at every key - and scan it: drive one row LOW, read all the columns, go to the next row. With 5 rows and 14 columns, 19 pins read 70 keys. The diodes stop "ghost" keys when three keys are held at once. Our demo keeps one pin per key, the simplest and clearest way to start.

Debouncing in Numbers

A real key switch does not close cleanly: the contacts bounce for 1 to 5 ms, and a fast loop would count each bounce as a press. Our push button models that too - in the run, SW1's window counted 9 edges in 4.43 ms for one press, and the sketch still sent exactly one PLAY/PAUSE. The demo waits until the level has been stable for 25 ms. Keyboard firmware usually uses 5 ms per key: a typist hits 10 keys a second at the most, so even 25 ms leaves plenty of room. The same idea works for any button on any board.

Bluetooth HID and the Phone App

A real wireless keyboard speaks the Bluetooth HID profile: the computer sees it as a keyboard, with no app. ZMK, the firmware most nice!nano owners use, does exactly that. Our simulation does not model HID; the demo uses a custom service instead, which the phone's Bluetooth app can read, so you can see every key, the volume and the count arrive. The logic - scanning, debouncing, mute and the volume - is the same you would write for a HID device.

Split Keyboards

Many nice!nano builds are split keyboards: one board in each half. The right half connects to the left half over Bluetooth, and the left half talks to the computer - so the left board is a peripheral to the computer and a central to the other half at the same time. In our simulation a board is a peripheral only, with the phone as the central; one half of a split keyboard, or a single macro pad, is what you can try here.

The Battery and the VCC Cut-off

The nice!nano charges a single-cell Li-Po from USB at about 100 mA; bridging the BOOST jumper on the back raises that to about 500 mA for batteries above 500 mAh. The small 301230 cell (100 mAh) fits under a socketed board. P0.13 drives a MOSFET on the VCC pin: switching it off cuts the power of RGB LEDs and displays, which can draw 1 mA each even when dark. In our part the charger is drawn and VCC stays on.

A Power Budget

Bluetooth keyboards live for weeks on 100 mAh because the radio is idle most of the time: with a short connection interval while typing and a long one when idle, the nRF52840 averages tens of microamps. One always-on LED at 2 mA would empty the same battery in two days - which is why the demo's blue LED would be the first thing to switch off in a real battery build.

The Moving Average

knobPercent() averages the last four readings taken 50 ms apart. A quick turn reaches its new value in 200 ms, and the small random noise of a real pot is divided by two. The "settled" counter then waits for five equal results in a row before it reports, so a turn that passes through 55 %, 62 % and 68 % on its way to 70 % sends only the 70 %.

Polling or Interrupts?

The loop polls the keys every pass - fine here, because BLE.poll() is quick and nothing blocks. If your sketch draws a display or waits for a sensor, use attachInterrupt() on the key pins instead, so a short press is never missed. Real keyboard firmware also sleeps between scans and wakes on a key interrupt to save the battery.

Try It Yourself

  • Add layers: hold PREVIOUS and NEXT together to switch the keys to COPY, PASTE, UNDO and SAVE.
  • Give the knob a curve so the low volumes get finer steps.
  • Add a writable characteristic so the phone can rename the keys.
  • Wire a 3 x 3 matrix with diodes on D4 to D9 and scan nine keys.

Ideas to Extend the Macro Pad

  • A rotary encoder instead of the pot for endless volume steps.
  • An OLED on Wire (D2, D3) that shows the layer and the battery.
  • A long press on MUTE to put the pad to sleep.
  • A counter of key presses per day, stored in flash.

Your Own Sketches

Write the sketch in the Arduino IDE with the board nice!nano v2 (TEP Proteus), use Sketch > Export Compiled Binary and set the part's PROGRAM property to the .hex.

Moving to a Real nice!nano

  1. For a keyboard, build ZMK for the nice!nano and describe your matrix in its keymap - no Arduino code at all.
  2. For Arduino sketches, install an Adafruit-nRF52-based board package with a nice!nano variant and port the Bluetooth part to Bluefruit.
  3. Wire the keys from D4 to D7 to ground, the pot to VCC, GND and P0.02, and the LED with 220 ohm to P1.04.
  4. Double-tap RESET to ground to enter the UF2 bootloader and drag the new firmware onto the drive that appears.
  5. Add the battery on B+ and B- only with the polarity checked twice.

The pins, the logic and the service stay the same; on the real board the nRF52840 core takes the place of ours.

Properties of the nice!nano v2

Double-click the board to change them
PropertyWhat it does
PROGRAMthe sketch: a .hex from TEP Boards for Proteus (the nice!nano v2 board)
MONITOR, BAUD, AUTOOPENthe built-in serial monitor: on, its baud rate (115200), open at Run

Troubleshooting

  • The phone's list is empty: call BLE.begin(), set a local name and BLE.advertise(); call BLE.poll() in the loop.
  • A key does nothing: the pin numbers are the nRF52840's - use D4 or 22, not 4.
  • analogRead always reads 0: only A1, A2 and A3 (P0.02, P0.29, P0.31) are analog inputs.
  • One press counts twice: debounce the key - 25 ms without a change.
  • A number goes wrong above 32767: int is 16 bits in the simulation - use long.

Limitations of the Simulation

  • A0 is the Pro Micro's name for P1.15, which has no ADC on the nRF52840; the three extra pads are drawn, not pins of the part.
  • The charger, the battery and the VCC cut-off are not modelled; USB HID is not modelled; one phone is the central.
  • P1.15 and P0.29 share one interrupt slot in the simulation - use one of the two for an interrupt.
  • Your sketch gets 8 KB of RAM in the simulation, and int is 16 bits there.
  • nice!nano is a name of Nice Technologies, nRF52840 of Nordic Semiconductor ASA, Pro Micro of SparkFun Electronics and Arduino of Arduino; this library is not made or endorsed by them or by Labcenter.
  • Tested in Proteus 8.5 in November 2026 (the demo as shipped, about 25 s of simulation). Proteus 7 is not supported.

So, that was all about the nice!nano v2 Library for Proteus. I hope it helps you try your keyboard and Bluetooth ideas in a simulation before you solder the first switch - the keys, the knob and the phone, all on one sheet. If you have any questions, ask in the comments and I will help you out. Till the next tutorial, take care and have fun!


Comments

0

Join the conversation