Categories
Electronics Projects

Magic Eye: Emulation with Arduino

“Magic Eye” emulation project written and developed by Konstantin Dorohov (USA).

The recorders and receivers of my youth used the now defunct tube level indicators or “magic eye” on 6E1P or 6E5C lamps. Now is the time for nostalgia for the “old days” and you can buy assembled indicators on aliexpress or amazon. They are almost as popular as Nixie lamp clocks.

Since the lamp requires high voltage to operate, in modern devices this is solved with a multistage voltage converter. First, a 555 timer controls a powerful FET transistor embedded in the primary winding of a step-up transformer. Then, the secondary winding is connected to a 4-5 step voltage multiplier. This is sufficient to convert the 5 volt input to 250 volts with a current of 1-2 mA.

Below it is explained how to emulate with Arduino the 6E1P (section 1) and 6E5C (section 2) indicators.

1. Magic Eye 6E1P

1.1 Project Description

In this article I share my homemade project whose essence is to emulate, as much as possible, the “green eye” of a 6E1P lamp using a fast OLED display controlled by an Arduino board.

1.2 Main Blocks

Apart from the Arduino module, the critical components for the design are the following.

1.2.1 Display and Drivers

The hardest part was finding the right display. There are a lot of them on the market, and most of them are easily managed by the well-known Adafruit-GFX-Library driver. This is a great all-round library, very easy to use, but with normal Arduino boards it is too slow and does not allow you to display high quality animations.

After many attempts, through trial and error, a display (based on the SH1106 chip) 128×64 pixels in size and with a blue glow was found. For it, the Arduino U8G2 library is provided. A key feature of this driver is the “page-out” property: first, the image is created in the controller memory and then displayed on the screen with a single command. This allows you to create simple animations with a good refresh rate. The library also contains commands to build geometric primitives: rectangles, triangles and circles.

It is also possible to generate simple bitmaps, but it is too slow to use in animation. However, bitmaps can function as masks to cut out part of an image, and so I used one to give the screen its characteristic “green eye” shape: a vertical rectangle with a rounded top side.

The general principle for constructing geometry from primitives is as follows:

Magic Eye Bitmap Mask
Bitmap Mask for Magic Eye Emulation

The sizes of the primitives change dynamically according to the voltage at the A0 input of the Arduino board.

1.2.2 Color

In general, the emulation is quite close. Although I consider the geometry of the image to be quite close to the original, the monochrome screen did not allow for a correct background, so I have an image on a completely black background, whereas in the original lamp the background is always pale green.

There was another technical problem that I managed to overcome. This screen has a blue glow, but I need a bright green. The problem was solved with a one-inch wide high-temperature adhesive tape: this is a bright yellow polyimide adhesive tape. The material is also called “kapton“. In width it fits the screen perfectly and, when properly taped, it perfectly converts the blue glow of the screen to green, a color very similar to that of the “tube”.

1.2.3 Microphone

As input, I added a signal from a simple Max9814 microphone amplifier board to the Arduino input.

1.3 Schematic

The parts connection diagram is as follows:

Magic Eye Emulation with Arduino Schematic

1.4 Magic Eye Results

I placed the display and some additional components for the microphone on a simple circuit board cut to the size of the Arduino. All connections on the bottom side were made with wires.

Arduino + Placa Auxiliar
Arduino + AUX board (screen + microphone)
Aux Board: Top Layer
AUX board : top layer
AUX Board Bottom Layer
AUX Board : bottom layer

1.5 Code

For those who are curious, here is my code for Arduino:

I by no means consider myself an advanced microcontroller programmer and by no means claim to be perfect in style and code, I am quite satisfied that it just works.

For image smoothness, I use an average of 5 measurements. The average is written “by hand”. I tried to use the standard RunningAvg library, but for a simple Arduino Uno, along with the display library, there is not enough memory.

I made a rule to add a simple informational header to my code, as well as a couple of lines that, when executed, remind me from which file and when this code was loaded.

2. Magic Eye 6E5C

2.1 Project Description

In the post in section 1, I described the Arduino emulation of a small 6E1P “magic eye” display. Older people remember these beautiful green lights with tube technology: recorders, amplifiers, radio receivers…..

The predecessor of the 6E1P indicator was the 6E5C octal lamp. This is a copy of the American RCA 6E1 lamp developed in the 1930’s. The only Soviet device I found that had this indicator was the indestructible reinforced concrete Kometa-201 recorder:

Device with magic eye indicator
Device with magic eye indicator

These indicators were also installed in radios that were produced in large quantities in the USSR. That was a long time ago.

In the previous article, I inadvertently promised to emulate the 6E5C. I am keeping this promise:

2.2 Main Blocks

2.2.1 MicroController

To achieve good performance, I used the ESP32 microcontroller:

ESP32 module
ESP32 Module

2.2.2 Display

In practice, the reason for the work was the appearance of a very nice round GC9A01 LCD display that works with the SPI protocol. The round shape is excellent for building the image of an indicator light, however, the size of this display is much larger than the light display.

2.2.3 Drivers

The graphics were created using the Arduino_GFX library. For image smoothness, sliding averaging of the input signal over 20 samples was used using the RunningAverage library.

From a software point of view, this emulation is much simpler than the previous one. The image is constructed from:

  • a single dynamic element (a triangle with a vertex at the center of the screen),
  • two static narrow triangles placed horizontally at the sides of the screen,
  • the center,
  • three almost overlapping circles in the center, a central gray representing the screen and two others: white slightly shifted to the left and black, shifted a few pixels to the right downwards. This is my attempt to give the screen a slightly “volumetric” look. I’m not sure if it succeeds. This is what it looks like when viewed up close:
Magic Eye Volume

2.2.4 Microphone

The audio input signal was supplied, as in the previous section, from the Max9814 microphone amplifier.

2.3 Schematic

Here is a simplified connection diagram of the different parts:

Magic Eye Emulation with Arduino ESP32

2.4 Magic Eye Results

The device is assembled on a perforated plate, with the various elements wired underneath. Here are some photos illustrating the assembly:

Magic Eye 6E5C Assembly
Magic Eye 6E5C Assembly
Project Elements
From left to right: ESP32, display and microphone
Perforated Plate
Punch card: top side (left) and bottom side (right)

2.5 Code


Subscription
If you liked this contribution, feel free to subscribe to our newsletter: