Skip to content

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

License

Notifications You must be signed in to change notification settings

vortigont/plasma-clock

 
 

Repository files navigation

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.

More photos in the gallery

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

All melodies and their samples are stored in a simple format called Portable Music Format, or PoMF :3c for short. The format is described in it's header, and all of the PoMF files are generated by the compiler from the music folder using Elf2Pomf.

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.

Update Server

An update server is an HTTP (not HTTPS!) server similar to http://pis-os.genjit.su/fvudata, which contains the fs_ver.txt file as well as the <FVUFLAVOR>.avu file for the device's firmware and the fs.fvu file for the filesystem.

The device periodically fetches the fs_ver.txt file and if it's different from the FS_VER inside the built-in filesystem, it offers to install a new version.

Due to being unable to set the ESP-APP version because of using the Arduino framework, the firmware version check relies on the FS_VER file. If the FS_VER is different (new file system available), it's considered that new firmware is also available.

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

An ESP32-WROVER is required, because the firmware takes up 99.8% of an OTA partition scheme, and ringtones have to be loaded from LittleFS into RAM. Since a lot of ringtones are several kilobytes in size, a WROOM is likely not enough.

Predefined target devices

  • DEVICE_PLASMA_CLOCK (FVUFlavor = PLASMA): a clock that I built around a plasma screen from an old Japanese bus/train. Definition file
  • DEVICE_MINIPISOS (FVUFlavor = OLED): a portable devkit for PIS-OS, using a 100x16 OLED from WinStar. Definition file
  • DEVICE_MINIPISOS_VFD (FVUFlavor = NORITAKE_GU112): same hardware as above, but using a Noritake ITRON GU-112x16-7000 VFD display. Definition file
  • DEVICE_MINIPISOS_VFD_WIDE (FVUFlavor = NORITAKE_GU140): same as above, but for a GU-140x12-7000. Definiton file
  • DEVICE_LEPISOS (FVUFlavor = AKI_K875): based on the same board as the devkit, but uses 4 of the Akizuki Denshi LED panels for the display.

Supported hardware and feature-flags

Display (at least one required)

  • Morio Denki 16101DS (see below, driver, feature flag HAS_OUTPUT_MD_PLASMA)
  • Winstar (sometimes sold as Vishay) WEG010016A in 8-bit parallel mode (driver, feature flag HAS_OUTPUT_WS0010). Includes BFI (Black Frame Insertion) for smoother operation and dimming. Datasheet backup: Controller, display
  • Noritake ITRON GU-NNNx16-7000 series graphic VFDs in 8-bit parallel mode (driver, feature flag HAS_OUTPUT_GU7000). Datasheet backup before the bundled CDR got completely rotten: 140x16-7000, 140x16-7100, 112x16
  • Akizuki Denshi K-875 ×4 for a 128x16 display (I couldn't resist not scooping some up in the Outlet Sale for 200 yen apiece). Known issues: small luma jitter sometimes, driver code is cursed. Driver, feature flag HAS_OUTPUT_AKIZUKI_K875. Datasheet backup
  • Experimental Noritake ITRON GU-NNNx16-312. Mine is 192px wide, taken out of an old bus display panel (labeled GU-192x16-505), no datasheet, no other technical info aside from that written in the driver's comments. Autoincrement is weird so there is a lot of write amplification in the driver. Supports Vsync/FEP (untested). No software heater power-off. Feature flag HAS_OUTPUT_GU312.

Speaker (at least one required)

Haptics

  • Taptic Engine via 2N3904 transistor as an amp (WIP: wired in parallel with the speaker. Upd: This makes bass reproduction better, similar to a vibration speaker, so this is now part of platform!)

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.
  • HAS_HTTPFVU: OTA updates via HTTP from this repository's main branch. HTTPS is omitted for performance reasons, and the security is instead ensured using the highly secure Ostrich algorithm.

Thermal sensors

  • AM2322 over IIC (driver, feature flag HAS_TEMP_SENSOR)
  • Switchbot Meter over BLE (unstable/experimental, 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
  • IR Remote. Set feature flag HAS_IR_RECEIVER and define const infrared_definition_t HWCONF_IR_BUTTONS in the device definition. Driver

Others

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.


by Genjitsu Labs / akasaka, 2024.

About

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

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • C++ 95.8%
  • C 2.1%
  • Python 1.0%
  • CSS 0.7%
  • JavaScript 0.2%
  • HTML 0.2%