The Gaspresso Propeller Project Ripping apart a coffee maker and converting it to Propane- and 12V operation, and developing a hideous control system to mimic ‘bot personality (Douglas Adams-like) I would not call them challenges, really. To run the pump safely and to specified pressure and duration, and to heat the water to specified temperature should not be too hard. Well, the latter could be, knowing that the time delay of the heating of the water is very long, but this can probably be sorted by applying adaptive control. The remaining control challenge is to slowly throttle up the gas valve, ignite the gas, and then control the heat rate as needed. Of course, the system needs to have enough sensors, devices and logic to also take care of user interaction and things such as safety and failures. Control challenges SW HW  EL HMI The espresso-making process is simple; warm the water to setpoint temperature (92-96C) and pump it through the grains in selected quantity, not too fast, not too slow, with sufficient pressure to create creamy coffee on the top. It may or may not increase the quality of brewing if ‘preinfusion’ is performed, i.e. first pump a dash of water, then wait a second, then start pumping for real. For this machine I have decided to offer the full range of strengths, ranging from teawater, through Texas coffee, farmers coffee, americano, espresso long, espresso, Turkish, Irish Coffee, and Irish only (yes, there is a seprate small tank, and a separate small pump). If anyone instead wants to make their americano the traditional way by adding water afterwards that is fine with me. The process For the main sensors I only need to measure temperature, pressure, level, gas flow and flame. For the user interaction there are lots more, but that is part of the HMI story. To find the sensors I browsed the Parallax site, the Sparkfun site, and an ElfaElectric site locally. I found what I needed - and more. These are the sensors:   Temperature: LM34, which gives out a voltage propotional to the temperature. I will use this to monitor the temperature of the water as it comes out from the heating coil. The plan is to glue it to the copper pipe and wrap around some layers of aluminum foil to stop any hot air distorting the measurement, then wrap it up in some flame resistant sheathing. Pressure: DSSPD300ABto5, which has a Wheatstone resistor bridge, with varying resistance propotional to pressure 0 - 20Bar. It took a long time before I found this - which is not too expensive, but Elfa had it. It is originally intended for LPG pressure measurement, but water is fine too. Level: I fell for the Level Tape from Parallax, but when it arrived it appeared it could not be shortened or bent, so it did not fit in the water tank. The solution was to mount a separate 1” plastic tube from bottom to top of the machine (overshooting the size of the tank) and connect this tube to the water tank to get the same water level inside. The sensor changes resistance as the level changes, so it is simple to intefrace. Flame: To detect flame (gas burning) I found an Infrared sensor, the MLX90614, which communicates by means of SMBus (or alternatively PWM). This sensor was intended to look at the burner and measure the temperature of the flame, only, as I discovered when I tested it, it does not see the temperature of a flame, only of surfaces. I will probably instead use a Ultraviolet photodiode - which almost only will see a flame. Gas flow: Flowing gas emits a distinct acoustic noise. I have decided to use a microphone to pick up this noise, route the signal through a high-pass filter, rectify, then low-pass - which should give a signal propotional to the flow (not linearily though). The sensors The control system is based on the Parallax.com Propeller embedded controller. Additional circuitry is an 8ch ADC, an SD card reader, a few MOSFET based power driver circuits, and an opamp for current amplification. The logic is programmed in the SPIN language whereas the interface drivers are a mix of SPIN and assembly. Controlling the espresso-making process is fairly simple, but the user interface has (intentionally) grown quite complex. The software is described on the SW page and the user interface on the HMI page. Below is the System Control Diagram. The control system The only real electrical engineering challenge was to design a new electrical solenoid coil for the impulse pump. I ripped off the old 220V 50Hz 50W coil, and then started the calculations. What I wanted was a new coil which would result in 50W @ 12V pulsed DC. To get this, here is what I did: To get desired Impedance (sort of resistance to AC)   Z = U^2/P, 12V^2/50W =~ 3Ω (Z= Impedance, U= Voltage, P= Power) To get required Inductivity (sort of electromagnetic inertia) L = Z/ω, 3Ω/50Hz*2π = 0.019Henry = 19mH Unsure if this holds true for pulsed DC too. (L= Inductivity, ω = angular rotation, f= frequency) To get the number of windings for the coil N = f(wire gauge, coil form dimensions, magnetic core properties) and it must be calculated through iterations until convergence - best done by a computer. I chose 1sq mm copper wire based on the current it should take without overheating, and I chose Permeability for the iron core (the cylinder and piston of the pump) to be µ= 150. The result was N= 110, less than10m of wire. I will never know if these calculations where right. Trying the pump at 50Hz resulted in too high current drawn, so I doubled the number of windings to 220. But, the thing is, when I tested it at frequencies from 20 - 60Hz the amperage jumped all over the place, not propotional to frequency as it should. I am sure this is because the magnetic core is not still, but pumping, and is bound to have mechanical resonance frequencies. At 40Hz and 50/50 duty cycle there was a sweet spot where power consumption was just fine, so- problem solved. Electrical engineering challenges The electrical story OSCILL+ MOSFET WATER WHISKEY GAS COIL DRIP TRAY RFID GASPRESSO -powered by Propeller USER INTERFACE INPUTS As the project has progressed, the wiring between the coffee machine and the Propeller Professional Development Board has turned into a crow’s nest. I decided to make an interface board located in the machine, and then run a flat cable from this board and to the Propeller board. That would make it tidy, even when I have the Propeller on my computer desk, and the machine on my lab bench. Also, it would make it very easy to switch from one project to another, simply by plugging in different flat cables. There is one problem, though:  how and where can I find a flat cable-to-vero board connector? The wiring x x x x x x x x x x x x x x x x x x GND VSS 3,3V x Panic pushbutton x Trayinplace reed sw. x Traywaterlevel sw. x PIR x Piezo x Cupinplace sw. x LevelWater    x TempWater     x PressWater    x PositionHolder x WeightCup     x VoltageSupply x (A6)       x (A7) x SD DI x SD CLK x SD DO x SD CS x IR CLK x IR DATA x ENC A x ENC B x VIB x x SERVO x AUDIO R x AUDIO L x PUMPi x x PROP x PUMPw x COIL x GND x GND x VSS 3.3V x VSS 3.3V GND <2 VSS 3,3V <2 PinPanic      = 0         PinTrayPlace  = 1         PinTrayWater  = 2         PinPIRperson  = 3         PinHit        = 4         PinCup        = 5         PinUnused     = 6   PinADCdata    = 7 PinADCclk     = 8         PinADCcs      = 9         x        x x        PinSDcs       = 13        PinSDdi       = 14        PinSDclk      = 15        PinSDdo       = 16        x       PinIRclk      = 18        PinIRdata     = 19        PinENCa       = 20        PinENCb       = 21        PinVIBRATE    = 22        x   PinSERVO      = 24        PinAUDIOr     = 25        PinAUDIOl     = 26        PinPUMPirish  = 27        x   PinPROP       = 29        PinIMPUMP     = 30        PinCOIL       = 31        (GND)                                   (GND) (VSS 3.3V) (VSS 3.3V)