Go to file
tarneo 20879cffc9
Add apostrophe and double quotes to client
2024-04-20 17:37:06 +02:00
.gitignore Add /secrets.h to .gitignore 2023-09-22 15:47:54 +02:00
Makefile Rename the sketch: `arduino` -> `printer` 2023-09-10 12:59:59 +02:00
README.md Prevent table.ino from being compiled 2024-04-04 20:05:45 +02:00
example-client.py Add apostrophe and double quotes to client 2024-04-20 17:37:06 +02:00
flake.lock Add nix flake 2024-04-04 19:56:39 +02:00
flake.nix Add nix flake 2024-04-04 19:56:39 +02:00
printer-lib.h Move the printer lib to its own files 2023-09-10 13:10:13 +02:00
printer-lib.ino wordwrap(): Handle actually print blank lines 2023-09-22 17:26:59 +02:00
printer.ino Don't trim lines in arduino main 2024-04-20 17:10:01 +02:00
table.ino.example Prevent table.ino from being compiled 2024-04-04 20:05:45 +02:00


Sharp CE-125 ESP

This is a program that can be used to control the sharp CE-125 thermal printer (released in 1982) with an ESP32-based microcontroller like a Seeed XIAO.

It is heavily based on code from the cavefischer website (in german).

For more information on the CE-125's communication protocol, see its operation manual (download).


I highly doubt that anyone will ever use this except me, but here is a brief description of the system.

I've by no means tried to document this so that other people could use it. If you have any issues or just want to tell me this was actually useful to you, feel free to send me an email.


An ESP32C3-based microcontroller is connected to the sharp CE-125 through some kind of level shifter (like a TI L293DNE).

The level shifter can use the ESP32C3's GND and +3.3V pins on one side and the CE-1251 pins 2 (VCC) and 3 (GND).

All data goes from the ESP32 to the CE-125 through the level shifter, meaning that:

  • used pins from the ESP32 are all configured as outputs and connected to the level shifter's inputs.
  • used pins from the CE-125 are all inputs and connected to the level shifter's outputs.
ESP32C3 pin CE-125 pin1
D0 4
D1 5
D2 10
D3 11

Also make sure the printer is plugged in (duh).


Software can be built and uploaded by running make install.

Since arduino-cli's devs made the questionable choice of requiring the exact same directory name and main file name (in this case printer.ino), you'll have to clone this repository into a directory called printer:

git clone https://github.com/tarneaux/sharp-ce-125-esp printer
cd printer

As an alternative you could rename the printer.ino file to match your directory's name.

Since the ESP32C3 needs to connect to a WiFi network, you'll have to configure an SSID and password by creating secrets.h:

#define SECRET_SSID "<your wifi ssid here>"
#define SECRET_PASS "<your wifi password here>"

After flashing to the ESP32 with make upload, you can try changing the HOST variable in example-client.py and run the script.

The WiFi protocol is briefly described in example-client.py.

Printing a character table

To print a character table, copy table.ino.example to printer.ino and upload.

  1. All pins for the CE-125 are counted from the top and are the ones on the 11-pin header where the "pocket computer" is meant to be plugged in. ↩︎