Skip to content

Latest commit

Β 

History

5 Commits

Folders and files

NameName
Last commit message
Last commit date
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

πŸŒ™ The Nyctograph Machine

Arduino thermal printer for Lewis Carroll's alphabet for writing in the dark

Arduino Thermal Printer License

Roni Bandini β€” Buenos Aires, Argentina β€” May 2021

The Nyctograph Machine is an Arduino-powered device that translates ordinary alphabetic text into Lewis Carroll's Nyctographic Square Alphabet and prints the resulting symbols on thermal paper.

A rotary encoder is used to select letters on a 16Γ—2 LCD. After entering a 16-character phrase, the Arduino replaces each character with its corresponding 104Γ—104 pixel nyctographic bitmap and sends the sequence to a thermal printer.

The project combines Victorian writing technology, substitution alphabets, Arduino electronics and physical printing.


✨ Features

  • πŸŒ™ Lewis Carroll Nyctographic alphabet
  • ♾️ Arduino Mega 2560
  • πŸŽ›οΈ Rotary encoder text input
  • πŸ–₯️ 16Γ—2 IΒ²C LCD
  • 🧾 Thermal printer output
  • πŸ”‘ 26 bitmap glyphs stored in flash
  • πŸ–ΌοΈ 104Γ—104 pixel / 1-bit symbols
  • ✍️ 16-character phrase input
  • πŸ’‘ Status LEDs
  • πŸ§ͺ Alphabet test-print mode
  • πŸ“• PDF user's guide included
  • 🧱 Custom 3D-printable enclosure

πŸ—οΈ Architecture

flowchart LR
    USER["πŸ‘€ User"]
    ENC["πŸŽ›οΈ Rotary Encoder"]
    LCD["πŸ–₯️ 16Γ—2 LCD"]
    MEGA["♾️ Arduino Mega"]
    PHRASE["16-character buffer"]
    MAP["πŸ”‘ Nyctograph glyph lookup"]
    BITMAP["104Γ—104 bitmaps"]
    PRINTER["🧾 Thermal Printer"]

    USER --> ENC
    ENC --> MEGA
    MEGA --> LCD
    MEGA --> PHRASE
    PHRASE --> MAP
    BITMAP --> MAP
    MAP --> PRINTER
Loading

The complete alphabet is stored locally inside the Arduino firmware. No computer or network connection is required during operation.


πŸŒ™ What Is a Nyctograph?

Lewis Carroll β€” Charles Lutwidge Dodgson β€” developed the Nyctograph in 1891 as a way to record ideas while lying in bed without having to light a candle.

He created a small writing guide based on square cells and developed a corresponding alphabet made from dots and strokes.

The common visual rule is a prominent dot in the upper-left corner of each letter symbol, helping identify the beginning of each character.

Carroll recorded the invention on September 24, 1891 and described it publicly in a letter published in The Lady on October 29, 1891.

Historical reference:

πŸ‘‰ Alice's Adventures in Carroll's Own Square Alphabet β€” Lewis Carroll Society of North America


πŸ”„ This Machine

The original Nyctograph was designed to help a person write without seeing.

This project reverses the direction:

Conventional alphabet
        ↓
Arduino
        ↓
Nyctographic alphabet
        ↓
Thermal paper

Instead of manually encoding each letter, the Arduino performs the substitution automatically.


πŸŽ›οΈ Text Entry

The firmware contains:

static char letters[27] =
    " ABCDEFGHIJKLMNOPQRSTUVWXYZ";

char phrase[16] = "";

The rotary encoder moves through the alphabet:

if (digitalRead(outputB) != aState) {
    counter++;

    if (counter > 26)
        counter = 26;
}
else {
    counter--;

    if (counter < 0)
        counter = 0;
}

The selected character appears on the LCD.

Pressing the encoder button stores its numeric index:

phrase[index] = counter;

index = index + 1;

counter = 0;

πŸ”’ Why 16 Characters?

The main phrase buffer is:

char phrase[16] = "";

The interface also uses a:

LiquidCrystal_I2C lcd(
    0x3F,
    16,
    2
);

After sixteen positions have been entered:

if (index > 15) {

the machine begins printing the encoded phrase.

The original project also references the sixteen-cell format associated with Carroll's writing system and the conveniently sixteen-character phrases:

THE WHITE RABBIT
EL CONEJO BLANCO

πŸ–ΌοΈ Nyctographic Alphabet

Each character was converted into a:

104 Γ— 104 pixel
1-bit bitmap

and stored in:

πŸ‘‰ letters.h

The glyph arrays use PROGMEM:

static const uint8_t PROGMEM a[] = {
    ...
};

static const uint8_t PROGMEM b[] = {
    ...
};

This allows the large bitmap data to remain in program flash instead of occupying SRAM.


🧾 Thermal Printing

The machine uses the Adafruit Thermal Printer library:

#include "Adafruit_Thermal.h"
#include "SoftwareSerial.h"

Serial configuration:

#define TX_PIN 12
#define RX_PIN 11

SoftwareSerial mySerial(
    RX_PIN,
    TX_PIN
);

Adafruit_Thermal printer(
    &mySerial
);

Printer serial speed:

mySerial.begin(19200);

Each symbol is printed as a bitmap:

printer.printBitmap(
    104,
    104,
    a
);

printer.println(F(""));

Official documentation:

πŸ‘‰ Adafruit Mini Thermal Receipt Printer Guide

πŸ‘‰ Adafruit Thermal Printer Library


πŸ”„ Complete Runtime Flow

flowchart TD
    START["Power On"]
    LCD["Display Nyctograph 1.0"]
    SELECT["πŸŽ›οΈ Select Letter"]
    BUTTON{"Encoder pressed?"}
    STORE["Store letter"]
    FULL{"16 positions?"}
    NEXT["Continue entering"]
    LOOKUP["Find Nyctographic bitmap"]
    PRINT["🧾 Print 104Γ—104 glyph"]
    DONE["Reset phrase"]

    START --> LCD
    LCD --> SELECT
    SELECT --> BUTTON

    BUTTON -->|"No"| SELECT
    BUTTON -->|"Yes"| STORE

    STORE --> FULL

    FULL -->|"No"| NEXT
    NEXT --> SELECT

    FULL -->|"Yes"| LOOKUP
    LOOKUP --> PRINT
    PRINT --> DONE
    DONE --> SELECT
Loading

πŸ§ͺ Alphabet Test Mode

The firmware includes a test-print function.

Default:

int alphaPrint = 0;

Change to:

int alphaPrint = 1;

to activate the alphabet printing routine at startup.

This is useful for checking the bitmap conversion, thermal-printer connection and print quality.


πŸ’‘ Status LEDs

Two LEDs are configured:

#define ledA 8
#define ledB 9

They are used to indicate startup, debug printing and normal printing activity.


πŸ”Œ Connections

Component Arduino Mega
LCD SDA A4
LCD SCL A5
Printer RX / Yellow D12
Printer TX / Green D11
Encoder button D5
Encoder A D6
Encoder B D7
LED A D8
LED B D9

Firmware definitions:

#define outputA 6
#define outputB 7
#define buttonA 5

#define ledA 8
#define ledB 9

The encoder button uses:

pinMode(
    buttonA,
    INPUT_PULLUP
);

πŸ› οΈ Hardware

Component Quantity
Arduino Mega 2560 1
Thermal receipt printer 1
16Γ—2 IΒ²C LCD 1
Rotary encoder with push button 1
LED 2
Main switch 1
Power supply 1
Thermal paper 1 roll
3D-printed enclosure 1

The first prototype used an Arduino Nano, but storing the full bitmap alphabet exceeded the available program-memory resources, so the final machine moved to the Arduino Mega 2560.

The Mega provides an ATmega2560, 16 MHz clock and substantially more flash memory.

πŸ‘‰ Arduino Mega 2560 Documentation


πŸ“š Required Libraries

The sketch uses:

#include <Wire.h>
#include <LiquidCrystal_I2C.h>
#include "Adafruit_Thermal.h"
#include "SoftwareSerial.h"
#include "letters.h"

Adafruit Thermal

πŸ‘‰ Adafruit Thermal Printer Library

LiquidCrystal_I2C

Install a compatible LiquidCrystal_I2C library through the Arduino Library Manager.

Wire

Included with Arduino.

SoftwareSerial

Included with the AVR Arduino core.


πŸš€ Installation

1. Install Arduino IDE

πŸ‘‰ Download Arduino IDE

2. Install Mega Support

Install:

Arduino AVR Boards

and select:

Arduino Mega or Mega 2560

3. Clone the Repository

git clone https://github.com/ronibandini/nyctograph.git
cd nyctograph

Repository:

πŸ‘‰ github.com/ronibandini/nyctograph

4. Install Libraries

Install:

  • LiquidCrystal_I2C
  • Adafruit Thermal Printer

5. Upload

Open:

πŸ‘‰ nyctograph7.ino

Compile and upload to the Arduino Mega.

Serial Monitor:

9600 baud

The printer itself communicates at:

19200 baud

Startup LCD:

Nyctograph 1.0
Roni Bandini

πŸ“• User Guide

The repository includes the original PDF manual:

πŸ‘‰ Nyctograph.pdf

It can be used as a compact reference for the machine and its alphabet.


🧱 3D-Printed Enclosure

The custom case was modeled to integrate:

  • Arduino Mega
  • Thermal printer
  • LCD
  • Rotary encoder
  • LEDs
  • Power electronics

Printable model:

πŸ‘‰ Nyctograph β€” Thingiverse

The original build was designed in:

πŸ‘‰ Autodesk Fusion


πŸŽ₯ Demo

▢️ Nyctograph Machine Demo β€” YouTube


πŸ“ Repository Structure

nyctograph/
β”‚
β”œβ”€β”€ nyctograph7.ino
β”œβ”€β”€ letters.h
β”œβ”€β”€ Nyctograph.pdf
└── README.md

🌐 External References

πŸ› οΈ Hackster.io

Complete original build article including the electronics, bitmap conversion, rotary interface, enclosure and thermal-printer setup.

πŸ‘‰ The Nyctograph Machine β€” Hackster.io


πŸ“š Lewis Carroll Society of North America

Historical background on Carroll's original Nyctograph and Square Alphabet:

πŸ‘‰ Alice's Adventures in Carroll's Own Square Alphabet


♾️ Arduino

Current hardware documentation:

πŸ‘‰ Arduino Mega 2560 Rev3


🧾 Adafruit

Thermal-printer setup, serial communication and bitmap printing:

πŸ‘‰ Mini Thermal Receipt Printer Guide

πŸ‘‰ Bitmap / Arduino Printer Documentation


πŸ“° Additional Coverage

Project overview published shortly after the original release:

πŸ‘‰ The Nyctograph Machine β€” jpralves.net


πŸ”— Related GitHub Projects

πŸ“š Raymond Roussel Reading Machine

Arduino-controlled literary reading machine based on Juan Esteban Fassio's interpretation of Raymond Roussel.

πŸ‘‰ github.com/ronibandini/RousselReadingMachine

πŸ“– Haiku Reader

A dedicated eInk device designed specifically for reading haiku.

πŸ‘‰ github.com/ronibandini/haikureader

πŸ“° Hunter S. Thompson ASCII

Raspberry Pi literary installation combining animated writing and ASCII portraits.

πŸ‘‰ github.com/ronibandini/HunterSThompsonAscii

πŸ’³ MIFARE Poetry

Literary experiment using NFC cards as physical containers for micropoetry.

πŸ‘‰ github.com/ronibandini/MIFAREPoetry

πŸ‘οΈ Furby Borges

A 1998 Furby rebuilt as a Jorge Luis Borges animatronic.

πŸ‘‰ github.com/ronibandini/furby


πŸ“• Contracultura Maker

Contracultura Maker is a book by Roni Bandini about maker culture, experimental electronics, AI, physical computing and technological autonomy.

πŸ“‚ Contracultura Maker β€” GitHub repository

πŸ“• Download Contracultura Maker PDF


πŸ“¬ Contact

Roni Bandini Maker Β· AI Developer Β· Writer Buenos Aires, Argentina


Built with πŸŒ™ + literature + Arduino + thermal paper.

About

Nyctograph machine based in Lewis Carroll invention

Resources

Stars

0 stars

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages