Sunday, 6 June 2021

Making OLED Display for Elektronika MK-52

In the previous article I described how to scan Elektronika MK-52 (Электроника МК-52) VFD with STM32F108C8T6 and dump to serial port what is being displayed on the VFD. In the last couple of weekends I made some progress with 256x64 16 Grayscale SH1122 based OLED display which looks like a good fit for the original VFD replacement with respect to both dimensions and brightness:

This OLED uses 7 wires SPI interface and works quite stable up to 8MHz. There are a couple of non-essential problems though:

  • On-board DC-DC converter does not produce enough current to driver OLED when all pixels are on
  • When lowest gray color is used one half of the display looks a bit more dark, probably because 256x64 are actually two separate 128x64 drivers?

SH1122 controller support 16 shades of gray, which could be useful to animate the display when program is running. On the real VDF you can see some flashing digits when you start a program execution. On this OLED we can use gray color for flashing digits and white for solid ones.

There are a few tricks I used to make this OLED work:

  • SPI initialized used STM HAL, but then all writes are done using CMSIS for direct register access – works almost 3x times faster
  • Font is coded using 0x0F color, so with a simple mask it can be easily converted to any other color
  • Frame buffer size is 256x37 – just enough to store font full height and speed-up frame flushing over SPI

Shadow frame buffer stores symbols being displayed, so only changes are rendered

Putting everything together.

This is how OLED look like compare to VFD:


OLED is very bright, so even using gray level 0x07 it looks quite good behind the original MK-52 green filter:

Next step is to mount STM32 board, OLED display and isolating DC-DC to power them inside MK-52 body.

Projects's github got updated with OLED support.

P.S. Famous МК-52 ЕГГОГ:



Sunday, 23 May 2021

Making Elektronika MK-52 VFD scanner

One of my Elektronika MK-52 (Электроника МК-52) Soviet era micro calculators decided to show its age by turning off a couple of VFD positions. In this case the ‘minus’ sign and the first digit are almost invisible, so instead of ‘-123’ you can see only ‘  23’. I have a few spare VFDs and could just replace the faulty one, but that would be a bit boring. Plus, all spare ones I have are from Soviet era as well and there is no guarantee that they will last.

So I’ve decided to replace original VFD with something else, preferably some ready to use parts. Having a few STM32F103C8T6 boards laying around it was the obvious choice – use STM32 to scan VFD pins to read the values being displayed and send them to anything connected to the STM (to be yet decided).

MK-52 drives its VFD using -27V, so direct connection with STM is not possible. But simple resistive voltage divider works just fine. There is how I’ve connected VFD to the STM:

Note that only of VFD grid controls is connected, below I’ll explain why.

This is how VFD digits multiplexing works:

Saturday, 20 March 2021

Making XY-LPWM display serial port friendly

Popular PWM generator XY-LPWM has a small, but heavily packed LCD display:


driven by Holtek HT1621 LCD Controller, driven by Nuvoton N76E003 - 8051 based MCU.

This MCU runs on 16 MHz internal RC oscillator and provides 18 KB Flash ROM, 1 KB SRAM, 18 I/O pins supporting two UARTs, SPI , I2C, 6 channel PWM and high resolution 12-bit 8 channel ADC. Sounds very interesting to hack into.

Unfortunately out of box only Keil and IAR supported as development tools. But with Small Device C Compiler (SDCC) happily compiling for 8051 MCUs for years it can be fixed quite easily.

So here it is: Nuvoton N76E003 SDCC BSP.

With this BSP it is quite easy to make XY-LPWM display serial port friendly, just compile and upload xy-lpwm-lcd example, connect the board to UART at 38400 baud and type

 > lcd @0GoodByte


Monday, 7 January 2019

Making Ruideng DPH5005 power supply case fan silent

I use Ruideng DPH5005 as a bench power supply and it is quite good for what I need, the only problem I have with it - 5V high speed fan of the original power supply case which runs always, regardless of load/temperature, making a lot of noise.

DPH5005 board has it's own small fan which kicks in only when power supply is overloaded, so probably I could disconnect the case fan completely or connect it to the heatsink fan, but I find no fun in doing so.

There are a couple of suggestions on the Internet how to deal with the noise of the fan - connect it in series of diodes to lover running voltage or to use Normally Open bi-metal thermal switch to turn on the fan at about +45 C.

I liked the latter, but decided to combine it with the first one to limit the driving voltage with a diode. And I had a nice and proven project for that: Madis Kaal tiny_pwm for ATtimy85 microcontroller.
Using pure PWM did not work with this fan - to run the fan stable at the lower speed I had to use quite low PWM frequency with clock divider 128, which was creating extra noise, diminishing the purpose of the project.

As power supply provides 5V, we can use bump-on-the-wire approach to control the fan. Modified schematics looks like this:

Sunday, 7 October 2018

Making Bose QC 25 USB friendly

I've been using Bose QuietComfort 25 for a couple of years now. They are great for watching movies on long transatlantic flights, but their miniature on-the-wire microphone and 3mm audio jack makes them unusable for long transatlantic Skype calls. Adding USB capability sounded like a good idea, and it wasn't hard at all with my new Prusa i3 MK3 printer.

For Skype I've been using Plantronics 626 for almost 8 years and finally ear pads started to disintegrate. Instead of soursing a new ear pards for this discontinued headset I decided to used Bose QC 25 as a replacement :)

First make a model in blender3d:


 Then print:

Making black visible on black

Yesterday I tried to print using black PLA on Prusa i3 MK3 and found that black PLA on black PEI is very hard to see :) But just a week ago I got my UV LED flashlight and it did the trick - turned black PEI heatbed coating to greenish and black PLA to blueish colour:


So no problems to control the first layer :)

Sunday, 16 September 2018

Making Darkroom FIlm Hanging Clips

I do not have a darkroom, so I dry my 135 film in the shower hanging it to the shower frame using a few pieces of wire and paper clips. Or at least I used to until now. All these wires and paper clips are history now, thanks to my new shiny 3D printer.


Friday, 14 September 2018

Puting dials on feet

The first version of the stand for my salvaged dials functional but boring (see the previous post).
So here comes the new version which puts the dials on feet, literally.


Sunday, 9 September 2018

Salvaging temperature and humidity dials

A few month ago my wall clock with temperature and humidity dials feel down from the wall and broke apart.

For the clock mechanism it probably was a good move (I would throw it out of window someday anyway, so loud it was). But temperature and humidity dials were quite useful, so I decided to keep them and reuse some day. And with my new and shiny Prusa i3 MK3 printer this day just came yesterday.

Making Prusa i3 MK3 a bit more stable

A couple of weeks ago I got Prusa i3 MK3 kit as my first 3D printer.

It took me two evenings and a half of Saturday to assemble it. What a nice piece of machinery it is!

I found only a couple of problems with it, first: rubber feet that just wait for any occasion to pop out of the frame when you move the printer.

There are lot of suggestion on Prusa forum how to fix it, using special printed locks, for example, or print completely new feet (what 3D printers are for anyway, if not for replicating and eventually taking over the word).

I've decided to make something myself. And here comes my second problem - last time I used blender3d years ago, so had to spent some time remembering how it works. But after a few trials I eventually got a result with suits me completely. Here it is - a simple shell for Prusa i3 MK3 feet in blender 3d:

Monday, 6 April 2015

Making DAN - Data Acquisition Node

Transforming MMR-70 in to temperature sensing DAN - Data Acquisition Node.

Back and front (or front and back?) RFM12bs modified to provide analogue RSSI output. AA switch turns on Always Active mode, but in this case it is better to connect DAN to an external 3V power supply as CR2032 is for Power Saving mode only. Actually, in Power Saving mode this DAN draws less than 8 uA. When it wakes up for data measurement and transmission it can draw up to 14 mA, but because it happens only once a minute and takes only few milliseconds CR2032 fully restores before next session. On start up voltage goes down to 2.8V but it is back to 3.0V in about twenty minutes.

Sunday, 5 April 2015

Making shDAN - small house Data Acquisition Network

I've been experimenting with different sensors for a while now and even built a small network of sensors using RFM12bs radio transceivers. The only problem - it is very slowly moving project and sometimes I have to spend a lot of time just trying to remember what different components are doing :) So this weekend I desided to document how it works...

shDAN - small/smart house Data Acquisition Network


shDAN stands for "small/smart house Data Acquisition Network". And "small" not necessary relates to a small house, it could be just a small network in a big house :)

Why "small"? Because of the following limitations:
  • No more than 12 Data Acquisition Nodes (DAN) per subnet
  • No more than 6 sensors (zones) per Data Acquisition Node
  • Messages between Base Station and Data Nodes are quite small - 13 bytes only

shDAN main components

ABS - Active Base Station, replies to time sync requests from Data Nodes
LBS - Listening Base Station, only collects data from Data Nodes, but never transmit anything. Useful for a standalone displays or monitoring stations.
DAN - Data Acquisition Node
NID - Node ID, base station is always 0, DANs are in 1 to 12 range, 13-15 reserved.
SID - Sensor ID, up to 8 sensors per NID. Each NIC always has two special SIDs: 0 is RF TX power, 7 indicates List of Sensors.
TOS - Type of Sensor, 1 to 15 range. For example, 1 is for Temperature, 2 Humidity and so on. For all defined types see ```dnode.h```
EOS - End of Session bit
AA - Always Active node. Usually data nodes are in sleep mode to save battery power and wake up only to do new measurement and transmit data to a base station.

shDAN uses simple time-division multiplexing schema to spread different DANs' sessions within one minute. Start of DAN's transmission can be calculated as second = (node - 1)*5 so node 1 transmits first message at 00 sec of every minute, node 2 at 05 sec of every minute and so one. A session cannot be longer than 5 seconds, last message should have EOS bit set to indicate End of Session, so base station can send messages to AA (Always Active) nodes or other nodes can transmit urgent data.

Project's page on GitHub

See SVG pictures below for details.

shDAN topology

Latest SVG at Github
 

Sunday, 29 March 2015

Making low-power version of MMR-70

I use modded version of Sony Ericsoon MMR-70 for different projects. It is cheap - less than a euro delivered and in addition to quite capable AVR controller Atmega 32L it has FM radio transmitter with RDS support, 32kHz crystal used together with FM radio and orange LED.

For remote  temperature sensor powered by CR2032 battery I've stripped down all unused components - FM radio transmitter, 2.8V regulator, I2C pull-up resistor, transistors connected to UART pins... So in Sleep mode MMR-70 board with RFM12BS transceiver and BMP180 as temperature sensor takes less than 8uA.
 
Pic. 1. MMR-70 with FM radio chip and I2C pull-up resistors removed. UART, I2C bus and some Digital/Analogue pins exposed to round header sockets. 32kHz crystal patched to Atmega32 for real-time clock support.

MMR70-mod code on Github.

Making Sony Ericsson MMR-70 breadboard friendly

I continue to play with Sony Ericsson MMR-70 board. So far I've done a few iterations on making it breadboard friendly using round header strips. I've started with round pins, but then switched to round sockets - sockets are easier to manage and it produces lower profile. Much more useful than the very first attempt :)
Pic1. On the left - version with round strip pins, on the right - sockets. Board on the right also is very low-power version - all components which are not needed unsoldered to save power when MC is in Sleep mode.

Pic.2 Round sockets (bottom) profile is lower than pins (top).

Sunday, 7 December 2014

Sony Ericsson MMR-70 Modding (Part 2)

Modded version of Sony Ericsson MMR-70 now supports SHT1x temperature/humidity sensors and can display information on SSD1306 driven OLED:


All sources as usual on GutHub.

BDFE - Bitmap Distribution Format Exporter

Bitmap Distribution Format Exporter - utility which can extract subsets or export all glyphs from .bdf font files.

There are tons of free fonts in bdf format because for years bdf has been used by UNIX X Windows. Converters available as well, but I needed very specific converter which would create fonts for SSD1306 based OLED screens.

So here it is - bdf font converter which can export glyphs from bdf and present them as array of bytes. It also can rotate 8x8 and 8x16 glyphs CCW so they can be used on displays with SSD1306 controller.

I'm running it on my Raspberry Pi (same RPi I use to program MMR70 ATmega) but it should run on any other Linux machine as well.


Sunday, 28 September 2014

GPS library for Intel Galileo

Intel Galileo library MtkGps allows Adruino sketches to talk to any GPS modules which understand MediaTek PMTK protocol. Tested with Adafruit Ultimate GPS breakout board. Three examples are provided:

gps_terminal

Saturday, 20 September 2014

Si4703S-B16 based RDS scanner

Si4703 based RDS scanner for Raspberry Pi using Si4703S-B16 breakout board PL102RT-S V1.5

Make RdSpi. It accepts one command at a time:

Sunday, 1 June 2014

Sony Ericsson MMR-70 Modding (Extreme this time)

Last year I posted simple LED mod for MMR-70 FM Transmitter. This time it is a bit more exterme as it includes rewriting firmware for onboard ATmega32L microprocessor.

This is how the end result looks like: