Publish Date : 2021-11-26
Last Modified : 2023-11-21

(K118)ATOM Printer

ATOM Thermal Printer Kit

img

ATOM Printer offers the best value in a desktop DIY thermal printer, includes an ESP32-Pico based IoT controller ATOM Lite, and a 58mm thermal printer to meet your multiple printing requirements. Supports text, graphics, barcode, QR code printing. The ATOM Printer has geekery kraft packaging design, built-in firmware boasts two modes of AP Connect Print + MQTT Notifications Print . You can enrich your creation, fun and practical with ATOM Lite IoT controller.

Datasheet

Review

Box

It is in a plastic case.

A printer and ATOM are included as a set.

It’s the back side. The command is written.

I removed ATOM. This board connects the printer and ATOM. Also step down from 12V to 5V.

I opened the box. Please remove ATOM. Spare paper is also included.

It is a printer. TTL (UART), RS232, USB can be used.

I opened the lid.

Power ON

AC adapter is not included. Requires 2.5A at 12V.

The plug is 5.5mmx2.1mm and is center plus.

When you turn on the power, it will start up as a Wi-Fi access point.

I connected with my smartphone. This screen will appear automatically.

You can print from your browser.

Printing is not possible with a 1A power supply.

Press the button on the printer to feed the paper. Press and hold to self-test.

Adafruit Thermal Printer Library

Characters can be printed. Images cannot be printed. The command of the image seems to be different.

M5Stack Library

Not yet.

There is a sample sketch.

I changed to the library format. I have issued a pull request, so it may be reflected soon.

Image printing

Is possible.

If there is a lot of black, a line will be included.

It disappears when Wait is entered.

Image printing method

Image to Data

Prepare a Jpeg, PNG or BMP file.

There is a conversion page in Tools on this site.

Let’s convert this 32x32 image.

// m5.png
// https://m5stack.lang-ship.com/tools/image2data/

const uint16_t imgWidth = 32;
const uint16_t imgHeight = 32;

// 1bit Dump
const unsigned char img[128] PROGMEM = {
0b11111111, 0b11111111, 0b11111111, 0b11111111,
0b10000000, 0b00000000, 0b00000000, 0b00000001,
0b10000000, 0b00000000, 0b00000000, 0b00000001,
0b10000000, 0b00000000, 0b00000000, 0b00000001,
0b10000000, 0b00000000, 0b00000000, 0b00000001,
0b10000000, 0b00000000, 0b00000000, 0b00000001,
0b10000000, 0b00000000, 0b00000000, 0b00000001,
0b10000000, 0b00000000, 0b00000000, 0b00000001,
0b10000000, 0b00000000, 0b00000000, 0b00000001,
0b10000000, 0b00000000, 0b00000000, 0b00000001,
0b10000111, 0b00000111, 0b00011111, 0b11000001,
0b10000111, 0b00000111, 0b00010000, 0b00000001,
0b10000111, 0b10000111, 0b00010000, 0b00000001,
0b10000111, 0b10001111, 0b00010000, 0b00000001,
0b10000110, 0b10001011, 0b00011111, 0b00000001,
0b10000110, 0b11011011, 0b00000001, 0b10000001,
0b10000110, 0b01110011, 0b00000000, 0b11000001,
0b10000110, 0b01110011, 0b00000000, 0b11000001,
0b10000110, 0b00100011, 0b00000000, 0b11000001,
0b10000110, 0b00000011, 0b00000000, 0b11000001,
0b10000110, 0b00000011, 0b00100001, 0b10000001,
0b10000110, 0b00000011, 0b00011111, 0b00000001,
0b10000000, 0b00000000, 0b00000000, 0b00000001,
0b10000000, 0b00000000, 0b00000000, 0b00000001,
0b10000000, 0b00000000, 0b00000000, 0b00000001,
0b10000000, 0b00000000, 0b00000000, 0b00000001,
0b10000000, 0b00000000, 0b00000000, 0b00000001,
0b10000000, 0b00000000, 0b00000000, 0b00000001,
0b10000000, 0b00000000, 0b00000000, 0b00000001,
0b10000000, 0b00000000, 0b00000000, 0b00000001,
0b10000000, 0b00000000, 0b00000000, 0b00000001,
0b11111111, 0b11111111, 0b11111111, 0b11111111,
};

I was able to convert.

void Print_BMP(int width, int height, const unsigned char *data, int mode, int wait) {
AtomSerial->write(0x1D);
AtomSerial->write(0x76);
AtomSerial->write(0x30);                      // 0
AtomSerial->write(mode);                      // m
AtomSerial->write((width / 8) & 0xff);        // xL
AtomSerial->write((width / 256 / 8) & 0xff);  // xH
AtomSerial->write((height) & 0xff);           // yL
AtomSerial->write((height / 256) & 0xff);     // yH
for (int i = 0; i < (width / 8 * height); i++) {
AtomSerial->write(data[i]);                 // data
delay(wait);
}
}

Create a function like this.

Print_BMP(32, 32, img);

call!

The maximum width is 384.











comments powered by Disqus