/plasma-clock

Plasma dot matrix display based wall clock/weather station/etc, powered by an ESP32

Primary LanguageC++OtherNOASSERTION

PIS-OS

Personal Information System OS (formerly Plasma Information Screen OS). (Not DOS, there is no disk in it! yet.)

A somewhat portable relatively-stylish pixel-art clock/weather station.

A remark on the Morio Denki Plasma Display

This display uses high voltage, which could be lethal!!

The display comes from a bus or a train, supposedly.

It has the following labels on the PCBs:

  • Morio Denki 6M06056 (the 8085-based control board I wasn't able to get running)
  • MD 16101DS-CONT82 06 (the actual framebuffer/drive board)
  • MD-24T-ADT (2) 8201 (the boards on the plasma tube itself)

Despite using a standard "HDD" Molex 4-pin connector for the drive board power, it expects +160V on the pin where normally +12V would be supplied. Take care not to mix up the power supplies. (Plugging in +12V into the plasma board doesn't seem to damage it. Plugging in +160V into an HDD, on the other hand...)

More detailed info is available in the following articles:

You can also read the quest I went through trying to get it to run "in real time" at EEVBlog Forums.

Available widgets

  • Clock

  • Indoor temperature

  • Switchbot Meter temperature

  • Weather (via OpenWeatherMap)

  • Weather Forecast

  • Hourly Precipitation and Pressure charts

  • Weather Effect (raining and thunder on idle screen when rain/thunderstorm outside)

  • Word of the Day (via Wordnik)

  • Foobar2000 (via foo_controlverver)

  • Remaining sleep time (when using alarm app)

Available apps

  • Idle (home screen)

  • Timer

  • Stopwatch

  • Alarm (Smart Wake Up on devices with motion sensor)

    (blinking lights warning!)

  • Weighing Scale (via Wii Balance Board)

  • Settings

Available chime melodies

(All chime tones are covers adapted for single channel beeper or 1-bit PIS-OS Sequencer by DJ AKASAKA)

Beeper tones

1-bit Polyphony

Creating your own melodies

There is a MIDI to sequencer conversion tool (supports note events in one track only, track end event, and comment event): midi_to_chime

8 bit 8 kHz wave to RLE sample conversion tool (not even reading the header, so very jank): pwm.py

You can also use the HAS_SERIAL_MIDI feature flag in combination with Hairless MIDI Serial to get a rough idea of how the ringtones will sound when writing them in e.g. Sekaiju. However exact representation in comparison to the native sequencer converter script is not guaranteed. Additionally there is no way of using PWM samples in this MIDI mode.

Remote Control Server

There is a remote control server you can enable in settings for debugging remotely when uploading firmware via OTA, or using an emulator without any screen and buttons.

Also included is a primitive client that has pretty poor performance, but allows recording GIFs and taking screenshots. All of the screenshots and GIFs in this readme were made that way.

pisosremote.mp4

Usage

  1. Enable "Remote Control Server" under Settings → Display.
  2. Save and Restart PIS-OS
  3. Run python ./helper/remote-control.py <CLOCK-IP> on your computer. Port 3939 must be accessible.

Protocol

The protocol is very simple.

The control client sends a control packet to the clock via UDP:

{
    uint16_t magic = 0x3939;
    key_id_t pressed = (set bits of those keys that were pressed since last transaction);
    key_id_t released = (set bits of those keys that were released since last transaction);
}

After that the client should expect a UDP packet from the clock with the format:

{
    uint16_t magic = 0x8888;
    uint16_t display_width;
    uint16_t display_height;
    ... remainder: bitmap data in fanta buffer format
}

System Requirements

The basic configuration without any bluetooth functionality (no Switchbot or Balance Board integration) seems to work just fine on an ESP32 WROOM. However to be less limited by RAM size in further features I've decided to make WROVER the requirement, so further versions are not guaranteed to run on WROOM.

Predefined target devices

  • DEVICE_PLASMA_CLOCK: a clock that I built around a plasma screen from an old Japanese bus/train.
  • DEVICE_MICROPISOS: a portable devkit for PIS-OS, using a 100x16 OLED from WinStar.

Supported hardware and feature-flags

Display (at least one required)

  • Morio Denki 16101DS (see below, driver, feature flag HAS_OUTPUT_MD_PLASMA)
  • Winstar WEG010016A in 8-bit parallel mode (driver, feature flag HAS_OUTPUT_WS0010)

Speaker (at least one required)

Haptics (WIP)

  • Taptic Engine via 2N3904 transistor as an amp (WIP: wired in parallel with the speaker)

Software flags

  • HAS_WORDNIK_API: compile with the Word Of The Day service using Wordnik API. This requires SSL, so bloats the firmware size significantly.
  • HAS_BLUETOOTH_LE: automatically set on ESP32. Required for Switchbot-over-BLE. Uses Arduino-BLE and increases firmware size significantly.
  • HAS_OTAFVU: OTA updates via ArduinoOTA. Currently disabled due to partition size constraints from the above.
  • HAS_SERIAL_MIDI: Enable receiving MIDI data over serial. Makes the CPU a tad bit hotter so probably do not include this feature flag in production builds, unless you really want a MIDI powered alarm clock for some reason.

Thermal sensors

  • AM2322 over IIC (driver, feature flag HAS_TEMP_SENSOR)
  • Switchbot Meter over BLE (unstable, driver, feature flag SWITCHBOT_METER_INTEGRATION, needs extra ram of a WROVER module)

Motion sensors

  • Any which provides logic H when motion found, logic L when not found (driver, feature flag HAS_MOTION_SENSOR)

Light sensors

  • Opto-resistor in voltage divider mode (driver, feature flag HAS_LIGHT_SENSOR)

HID

  • Keypad/D-Pad. Set feature flag HAS_KEYPAD and define const keypad_definition_t HWCONF_KEYPAD in the device definition. Driver
  • Touch plane. E.g. a faceplate with touch sensitive arrow keys to work in place of a D-pad. Set feature flag HAS_TOUCH_PLANE and define const touch_plane_definition_t HWCONF_TOUCH_PLANE in the device definition. Driver

Others


by Genjitsu Labs / akasaka, 2024.