Tag Archives: Java

ИГГ1-64/64M Adventure

IMG_5436

It appends I spend a bit of time on eBay looking for uncommon or old displays such as the famous Nixie tubes. Large matrix displays emerge some time ago maybe due to the discover of an old stock. However, I never found someone using them, for a good reason. Around 360 Volts is needed to light up a pixel.

Gazotron

gazotronGazotron, or Газотрон is (or was) an Ukrainian electronic tube manufacturer (do not confuse with Gas-o-tron). It’s not easy to find information about this company, even gazotron.com is closed. But actually there is still plenty of their products available if you would like to buy electronic tubes, such as IN4-nixie tubes. The logo is dot inside a circle.

81491517582909158

They made in the 90’s different sort of dot matrix panels. They are quite large, 19x19cm, and for the moment I saw 3 kind of pixel composition. A 32×32 matrix, all pixels are green. A 64×64 matrix, pixels alternating green and red, and finally a 64×64 matrix with red-green-blue alternating pixels.

I bought one green-red some time ago, and recently saw a page on hackaday.io that revive my interest.

Seek for information

The short datasheet provided with the screens (shown in the mentioned page) explains the voltage values needed to light up the pixels as well as the timings, but it does not help to find a way to generate these high voltage signals.

My research on internet first leads me to this Youtube video demonstrating a 8×8 pixel drive, and a quick view of the breadboard circuit. Then I start to find forums written in Russian where someone manage to drive the all 32×32 matrix.

And finally, a piece of a datasheet showing a circuit example able to generate the ~400 Volts anode signal from a 200 Volts source.

35281517586682013

Test Drive

I reproduced the circuit on a breadboard as well, using a 180V ‘nixie’ power supply.

IMG_5318

Motivated by this success, I started Kicad and designed a PCB. I Selected SMT components in order to reduce the size of the 64 anode drivers and the 64 cathode drivers. The board arrived as perfect as usual with OSHPark.

IMG_5366

And they are working!

IMG_5365

 

Cabling and soldering

There is 92 components and 34 wires on each of the 8 boards to solder. As I don’t own a air soldering station, I did everything with a good iron and solid patience.

But it was worth the effort, they all work great.

Interface

I used the same micro-controller as the BIG_CLOCK to talk with the high voltage boards. Especially because it has at least the 32 outputs needed. To interface this controller with the outside world and being able to display some useful pictures, I used the serial port.

I could then make a tiny Java program that copy part of the computer screen and send it to the serial port.

IMG_5436

Fun with Pixel Dust

I was quite amazed by the code demonstrated on a 64×64 led matrix by Adafruit (https://www.adafruit.com/product/3649). So why not trying this on the IGG1 display?

I have a MPU-9250 IMU and a raspberry-pi zero. However I need to adapt the code for this accelerometer, and send the data to the screen with the serial port. I’m more comfortable with Java than C or python, then I translate the code from Adafruit in Java.

To conclude

The full story and details are on the hackaday.io page here:

https://hackaday.io/project/46302-1-64x64m-adventure

Sources and schematics are on the following github repository:

https://github.com/pierre-muth/IGG_-64x64M

It was really a good time see this screen getting back to life, now it needs a purpose such as a weather forecast display or a nice clock. A lot is possible with the raspberry pi, including the use of the PIR sensor to only turn on the screen when someone is around…

Advertisements

Wireless remote display

IMG_4370_w

Abstract.

07_rack_frontFor a while now the Pilogger needs a small remote display. The logging station is neither particularly compact nor elegant, therefore I made some tests about a battery powered status display. I tried solutions which I never used mainly by curiosity but also in order to continue to learn something. Especially the Wifi chip ESP8266 and a Sharp memory LCD. For tests logbook, see the Hackaday.io page

Wireless.

esp-12e-frontThe wave of the famous ESP8266 wifi chip from espressif reached me few time ago, but I never experimented it. As a complete image has to be transmitted, the wifi sounds a good solution and the ESP8266 is very capable (beside being very cheap). There is plenty of solution to program it, among the official SDK, microPython or arduino, I chose to test the nodeMCU one. From building the firmware to the integrated development environment ESPlorer, everything is clearly explained on nodeMCU documentation website.

Memory LCD.

LCDA now common solution for very low consumption display is e-ink or e-paper, but another solution from Sharp is interesting as well. There is significant differences between the two, for example the memory LCDs don’t keep the image while out of power. However the current needed to maintain an image is very low, the refresh rate is fast, and the surrounding electronics are very simple. I choose the Sharp LS044Q7DH01, a monochrome 320×240 pixel, 4.4″ display.

Prototype.

For the firsts tests I begun by my usual ugly wiring on a proto-board. I made a schematics with some option regarding the LCD driving. The LCD needs 5V and TI have a convenient boost converter: REG710NA-5. For the ESP12E wiring, Adafruit made a very nice job with their Huzzah board.

Codes.

After some divergeant ideas and solutions, I used sockets to transfert the image from the Raspberry pi to the ESP8266. In fact, the raspberry java code generate directly the data that should be transmitted to the LCD. The ESP Lua code is then just a bridge between socket and the SPI LCD connection. The Lua and Java code is on github (init.lua, socketLCD.lua and WifiDisplay.java).

The ESP is in deep sleep as much as possible. When waking-up, it connects and takes an IP from the house Wifi access point, connects to the raspberry pi socket, receives the image data and sends it in the same time to the LCD, and finally goes back to deep sleep.

PCB.

We cannot stay with a prototype, and for the first time I tried the OSHpark services. What an amazingly good experience! I used Kicad for schematics and board design as the file format is directly compatible. I’ve uploaded one file, and 20 days later the 3 boards were in the mail box. The quality is very impressive, and the pricing for small size is unbeatable. The board can be find here.

1878951471600347659

Frame.

As a frame, for the moment I’m staying with a simple aluminium plate. Few copper plates to fix the board do the job.

IMG_4371IMG_4370

Outlook.

With a 2 minutes refresh rate, the batteries survive around one week. There is then still some improvements to do, such as lower refresh rate during night. Another point I should keep an eye on is the LCD driving. The Sharp datasheet recommend to invert a signal either by a serial command or a physical pin (EXTMODE and EXTCOMIN), thus at a minimum frequency of 1Hz. To lower the consumption, this inversion only appends when refreshing to avoid waking up the ESP8266. After few weeks I didn’t notice any artifact on the LCD. Sharp mention a risk of image retention as well, so an inverted image during night time might be a good idea.

Image dithering

Abstract.

I had to convert images to black or white points. This post is a summary of my tests and learning. My main source is the nice ‘Dither’ Wikipedia page. The major issue I had to face is when converting an image with an undefined length coming from a scanning process.

IMG_3696

Conversion.

To print pictures on thermal paper with reasonably good rendering, they should be converted according the printer limitations. It’s quite simple, it can be printed only black pixels (and whites as the paper is usually white).

The first step consists to get a gray-scale image. There is plenty well known method, from the simplest averaging of the Red/Green/Blue channels to advanced ones where the pixel intensity is scaled to a color wavelength to simulate a particular response (such as black & white films).

michelangelo27s_david_-_bayermichelangelo27s_david_-_floyd-steinbergThe second step could be achieved by several algorithms. To convert gray-scale pixels to only black or white, a rather easy method is the Ordered Dithering. But it there is noticeable patterns on the resulting image. Another common method is the error diffusion, and in particular the Floyd-Steinberg dithering algorithm. It is this last one that I choose to study as I found the resulting image interesting.

Codes.

The codes we can find over Internet usually rely on a buffer to store and propagate the errors of each converted pixel. This buffer have the same size of the image and is completed during the iteration over all the image lines.

As receipt thermal printer use paper roll, there is virtually no image length limit. If we want to convert on the fly the image and strait print it, we cannot rely on a fixe full image sized buffer. That’s why I experimenting conversion algorithm based on Floyd-Steinberg, but with only a small rotating buffer. The size of this ‘line’ buffer could be as small as a line size plus one.

Other than the code itself, I try to explain the principle with this Gif :

dither

https://pierremuth.files.wordpress.com/2016/04/dither.gif

And the Java code use to generate it :

https://github.com/pierre-muth/selfpi/blob/master/src/tests/Dither.java

Very good readings about dithering :
http://bisqwit.iki.fi/story/howto/dither/jy/
http://www.tannerhelland.com/4660/dithering-eleven-algorithms-source-code/

Icebreaker Game

Abstract.

12026610_10207455771046540_1864584773_nAfter experimenting with the small receipt thermal printers and manage to make a portable camera, my brother came up with a very clever idea. He is organizer of a juggling convention, and he looked for a kind of funny game around beer selling and their receipt. The aim was to entertain and offer a beer every lets say 50 sold. He said we can do more than print pseudo randomly a winning ticket based on certain ratio.

The idea.

beerWe imagined a machine standing on a bar, with on the client side a camera pointing at you, a screen showing the camera output and few instructions. On the back side, a single button allowing the barman to launch the lottery for one ticket. What the machine do once you press the front big button (I really love these Adafruit massive buttons!), is taking a picture of you. And then there is two possibilities. If you loose, a souvenir receipt is printed with the picture of your face and a random funny quote. If you win, a winning receipt with the face of someone else is printed, and instructions telling you that if you find the random guy on the printed picture, you both won a free beer.

The printer.

2321The printer choice should consider reliability, speed and print
quality. Even if the last one is relative to what we can expect for black or white thermal printing. I moved from the affordable and small serial Adafruit 58mm printer to a more professional one. After some non conclusive test with a cheap 80mm Chinese printer, I finally get an Epson point of sale printer. The TM-T20 is USB and commands are very well documented on their website. If not set to the maximum print speed, they could make surprisingly good prints for bitmap pictures. It depends a bit of the paper quality as well. I get very nice results with BPA-free recycled paper roll.

The system.

Raspi_Colour_ROnce again, the raspberry pi is a nice card and of course perfectly capable of doing such a process. There is the official camera module, even if a basic webcam would make it as well, USB ports for the printer, HDMI for a screen, GPIO for buttons and leds. But most importantly, I can reuse a lot of code form the Polapi.

The software is written in Java and uses two external libraries. One for GPIO – Pi4J and an other one for USB – usb4JavaIn addition, the native raspbian program raspividyuv is used to get the camera frames. The camera output is on top of everything and always visible on the screen. The all Java software part is hosted on github. The runnable Jar file must be launch on the Raspbian LXDE environment and could be easily auto-launched. There is some logs here, but I must complete them a bit.

The case.

In the view to avoid yet another device taking dust in the garage, I made the case looks like an arcade. I just have to exchange the front panel to have a raspberry pi Mame machine ! (That will instead probably take the dust of the attic, but with style, surrounded by retro consoles)

Wood sawing 

Case filling

Resulting device

Outlook.

It was quite a success on the Juggling convention, it brought fun and few free beers ! It ran smoothly without any reboot despite I expected some bugs.

After being used on a week-end for around 500 prints, it will be used on a Hackathon in Geneva with a slightly different mode.

IMG_20160408_120647

8918261459861376809