I am a proud owner of a FrancisFrancis! X1 espresso machine. The machine has a wonderful design and sufficient brew pressure to b called an espresso machine. So it’s a great toy. Almost. The thermometer which shows kettle temperature is (was) not only unprecise, it died suddenly. A quick examination revealed that the thermometer was a barometric one, supposedly a cheap one, too. There are spare parts, but their price of ~50€ made me decide on something else. So lets go…
The new thermometer should have the following features:
- Precise temperature display
- Graphic display with nice, colorful digits…
- Brew Timer (for standard conform timing)
I did search quite some time for displays and decided on (after looking at 2″ TFTs in 16:9 – which wouldn’t fit the 52mm boring in the case of the machine) a 1,04″ OLED-Display with 16 bit depth. It’s only $7 and is shipped with a nice breakout-board. I’m generally no fan of breakout-boards because I usually layout my own boards and thus BoBs are not necessary. But in this case it was quite helpful, the basic circuit was already on the board and it was easy to mount. So I connected it to a Mega88 for testing. This was initialization and first tests (and of course debugging using the scope and Logic Analyzer)…
Next Problem: A charset. I had no interest in designing my own chars pixel by pixel, so I found and used ‘GLCD font Creator‘ by MikroElektronika. It is really a great tool but will only export librarys for the MikroElektronika glcd libraries. But you don’t give up that fast, so I took a look at the project files the tool saves. The boys and girls at MikroElektronika were so friedly to use (well a little obscure) XML format! So all that was to do was some find-and-replace and counting chars to get the charset out of the file in a pixel-pattern. I then optimized the chars (not all of them have the same width) and wrote a little tool which compiled the bit-pattern into bytes which then were stored in the flash of the AVR. I actually did 2 seperate charsets; one was 21pt, containing only the numbers 0-9 and a ‘°C’ symbol, and one, 8pt, with ASCII characters 32 to 127. The big numbers were stored char by char; while the charset for ‘writing’ got an index containing each char’s width (cause height was consant). I will do a seperate post on that soon, also containing the (badly programmed) tools I used.
Now the content of the FLASH basically had to be copied into the GRAM to get chars…
So, the display does what it’s told and we got a charset. Time to do a PCB. I orginally settled for a Mega168 but discovered that it had too few pins for the project (and my taste) so I changed to a Mega16 which is about the same but has more IOs. Features for the PCB:
- Small formfactor
- Interface to the OLED breakout board
- MAX6675 thermocouple converter
- 3 IOs with Analog-In as multi purpose IO
- I²C expandability
The PCB was developed quickly but contained some errors…
- The OLED needs 12V. A step-up would have fitted the PCB. Don’t always think 12V will magically appear somewhere… (Acutally 9V would’ve been availabele…)
- The data-connector for the OLED was turned 180°. That could be compensated for in software but led to decrease in frame rate.
…all of that occured to me later of course… 😉
I wanted to mill the PCB initially but because of my engraving bit or my incompetence in setting this up it didn’t work out. So I decided to mill the outline and mounting holes out of photoresistive FR4 to etch the artwork on later. Which looks like this after a saturday of work…
…with OLED breakout board mounted piggyback…
Now it was on the firmware. The demands rose because of the nice shiny OLED:
- Color of Temperature should change with temperature
- Diagram should show temp over time
- Minimum, maximum and average temperature
- Mode display
Well this is the point where it started to get overengineered I think…
The diagram was a little difficult to implement because the line commands of the display controller were too slow for the use. So I had to generate the diagram on the fly while writing it into the GRAM of the display. But the routine turned out quite well, it shows red lines when the datapoint to show lays out of the display area and automatically adjusts display area. The brew timer then was no problem at all, routines for printing text were already written.
Now the thermometer had to be mounted inside the machine somehow. I milled a plate out of 3mm aluminium which fitted the machine and the thermometer. This was then mounted to the machine using kapton tape. I stole 5V power from the machines ISP header (it is actually using a Mega8L!), which might led to problems [see update]. I also had to add the 12V stepup converter for the OLED. Then I connected 2 of the 3 IOs to the mode switches on the front panel, which actually switched TTL voltage (win!).
And that’s it.
It turned out that the step up converter caused problems with the internal electronics. Step up converters cause huge current spikes. The internal 5V supply rail of the machine was sourced through a 7805 linear voltage regulator which had just a ceramic cap on the output. I put in 1000µF and since then the problem seems to have disappeared…
…and of course a nice cover will be added. That’s what the 4 holes in the plate are for.
- Franzitherm_brd_R1 (Eagle V5)
- Source code is temporarily unavailabele (Charset…)