La Pavoni PID Pressure/Temperature Mod

Water temperature is an important factor in the espresso extraction process and is rather difficult to control on La Pavoni espresso machines (especially pre-millennium models). Users resort to extreme measures to manage temperature including using ice water to cool the group or portafilter, installing dipper mods on pre-millennium models to eliminate steam contact with the group neck, installing insulating gaskets between the group and the boiler, etc. One user went so far as to install a commercial PID controller through an extremely involved process requiring permanent modification of the boiler (making a hole). I love this kind of DIY hacking, and was interested in trying something similar. However, I was not willing to make any permanent modifications to my La Pavoni (made in 2000 but is a pre-millennium configuration). Furthermore, since the La Pavoni can only operate when the boiler is pressurized, there is no reason to measure the water temperature as this information can be obtained from the boiler pressure (measuring water temperature for PID control is only needed when the brewing temperature is below boiling as is the case with most PID machines). Therefore I decided to build a pressure-based PID control system. I’ve documented the parts, code and assembly in case anyone would like to build something similar. Note: Because I only modified the electronics by inserting a relay to open/close the heating circuit, the existing safety systems (pstat and thermofuse) still function normally.

Things to note:

  • You should have some familiarity with Arduino IDE, particularly how to install libraries as this code uses two.
  • You will need basic soldering equipment (not included in parts list) and should know how to safely work with mains power (i.e. unplug your machine first…).
  • I have not made a wiring diagram since it would vary depending on the Arduino/components used. However, all of the required connections are evident from the Arduino code (from the pin assignments) – you will need to know how to wire the components apart from their control pins on the Arduino, but this information would be available in their data sheets. If you get stuck on this part just leave a comment or shoot me an email.

Parts list:



Note that the wiring/pin assignments are noted in the code, and are not discussed here. Usage instructions, important notes and calibration procedures are also written within the code document.

Brass fitting assembly with pressure transducer shown on left.

Prototyping the control board. Solid state relay shown with wires coming from the underside of the LP. Rainbow ribbon cable connects the controller to an FDTI programmer (bottom), which in turn allows programming and data transfer between the controller and the computer.

Upper control assembly installed in upper case (what I’m holding) connected to controller. Lower enclosure shown bottom middle.

All electronics installed in the enclosure and holes cut for pressure sensor wires and relay control wires.

All closed up and powered on. The yellow light indicates that the controller is booted and also indicates that the battery is not dead (light would not turn on otherwise). The green light indicates that the pressure set point (set using the potentiometer) is within 0.02 atm of the measured pressure (i.e. ready to use at the selected pressure).

Slot cut for pressure sensor wires and charging the battery via a micro USB cable.

Relay placement inside the LP. Note the green and white wires coming from the control box (not shown) are routed unter the bottom plate and through one of the ventilation holes to the relay. The relay opens/closes the connection between the on switch (black wire) and the pstat (read wire) to regulate heat generation. In this configuration the pstat and thermofuse function normally and would override the relay if necessary. 

All done! Control box is mounted on a piece of alumninum which is attached the the brass fittings via zip-ties.



PS3 controller + RC car code update – Trim!

One of the most common question I get about my RC car code is about trimming the steering. For one such commenter I updated my code to include a trim function and sent it to him. He confirmed that it worked (I couldn’t test it myself at the time), so here it is for anyone who wants it.

Antenna routing for Eurgle/FlySky/Imax/Turnigy 9x r/c Receiver

The Eurgle/FlySky/Imax/Turnigy 9x line of r/c transmitters are excellent for their price and how easy it is to modify them. However, their receivers are another story. Large, bulky and with a long, droopy antenna, the receivers are often difficult to mount cleanly and safely. I’ve fiddled with them quite a bit and have came up with the following solution: Drill two small holes in the side of the receiver casing and zip-tie a small tube to the side of the receiver. Then rout the antenna through the tube and fix it at the top with a zip-tie, or other tie/adhesive. Just make sure that the red portion of the antenna is fully exposed.

2014-03-10 22.37.26 2014-03-10 22.39.05

Flash the Eurgle/FlySky/Imax/Turnigy 9x r/c Transmitter with ER9x Custom Firmware

This tutorial will explain how to flash your Eurgle/FlySky/Imax/Turnigy 9x r/c transmitter with the ER9x custom firmware. As typing, “Eurgle/FlySky/Imax/Turnigy 9x r/c transmitter” is tiresome, I will, from now on, simply refer to it as “the transmitter” (my transmitter happens to be the FlySky variant).

There are several videos and tutorials on the web about how to flash your transmitter with ER9x, but all of them leave out some details that make them difficult for beginners (like myself) to follow. This is especially problematic as performing this procedure incorrectly can result in a bricked (unusable) transmitter. Because of this I will try to include all of the steps (even the most basic) required to flash ER9x onto your transmitter. I will, however, assume you know how to install software and drivers (if required) on your computer.

Required items:

  1. A computer running OSX, Windows or Linux with a USB port.
  2. An AVR programmer like this or this. I have the latter.
  3. An ISP socket like this (10 pin). Look at your local electronics store before ordering online. I got mine a Fry’s Electronics (if an employee tells you they don’t carry this socket, don’t believe them, look for yourself).
  4. A soldering iron and solder.
  5. Wire ribbon (your can use separate wires as well) with at least six strands.
  6. A hot glue gun with glue.
  7. Tools to cut a rectangular hole in your transmitter (optional). I used a Dremel with a cut off wheel and an Xacto knife.

Note: We only need six pins to program the transmitter, but six pin ISP sockets are hard to come by, and will only work if your programmer has a six pin plug (mine happens to have both (see link above) six and ten pin plugs, but ten is more common), so I used a ten pin socket. If you have a six pin ISP socket, you can use it as long as you connect it correctly. I only show which pins to use for the ten pin socket, so if you want to use a six pin socket, see here for the pinout.

If you do not wish to install a permanent programming port in your transmitter, you can still use this tutorial, just don’t follow any of the steps to cut a hole for, and install the ISP socket. Simply solder the AVR programmer wires to the transmitter circuit board (as explained below) and unsolder them after programming.

Computer setup:

  1. Install eePe for your operating system.
  2. Install avrdude. As installing avrdude manually is difficult, I recommend installing the Arduino IDE, which includes avrdude.
  3. If you are on Windows, you will have to install drivers for your specific programmer. These can be found here under “Programmers and Drivers” (scroll down).
  4. Finally, go here and download a stable binary (you will have to scroll down) to somewhere you can find it later. The binary is the firmware you are installing (ER9x). There are currently seven different versions under stable binaries, and if you don’t know what version you need, just download one at the top of the list  (“ER9x” with no extension).

Transmitter disassembly:

Now comes the difficult part. We are going to open up our transmitter and solder wires to pads on the transmitter’s main circuit board.

  1. Remve the battery pack from the transmitter (don’t pull on the wires, grip the plug). There is no need to remove the transmitter module (the rectangular, clip-in piece in the center on the back).
  2. Unscrew the six screws holding the back plate on.
  3. Remove the back plate carefully. There is a bundle of wires that attaches the components on the back plate to the main board on the front plate. There is sufficient room to reach in and unplug this bundle from the main board.

Choosing and cutting a hole for the programming port (ISP socket):

There are several places you can put the ISP socket. If you are not using the module in your transmitter, you can place it there, and if you are using a lipo battery, you probably have room it the battery compartment. However, I am using my module, and do not have room in my battery compartment, so I put the ISP socket on the bottom of the transmitter:

Programmer port - top viewProgrammer port - bottom view

I cut most of the material out with a Dremel with a cutoff wheel. I then removed the rest of the material with an Xacto knife. While cutting the hole, check the size periodically with the ISP socket to make sure you don’t cut it too much.

Soldering the ISP socket to the transmitter:

Find the Atmel chip on the main board (center bottom). Here’s a picture with the pads labeled:

FlySky Board

We need to connect these pads to the corresponding pins on our AVR programmer. As mentioned above, if you do not wish to install a permanent programming port, simply solder these pads directly to your programmer’s cable (see here for pinouts). If you do wish to install a permanent programming port as I did, see the following picture. It shows which pins on the ten pin ISP socket correspond to which pins on your programmer (when plugged in):

ISP header

This is the front of the ISP socket. You will need to solder to the back of it. This can be disorienting, so be careful. Attach each of these pins to its corresponding pad on the main board of the transmitter (see the previous picture). Here’s how I did it:

Wires to ISP socket

Note that I have not yet secured the ISP socket to the body of the transmitter. It is just sitting in the hole so that I could take the picture. Next, secure the ISP socket with hot glue. I had an issue with the pins in the ISP socket slipping up and down when plugging in and pulling out the programmer cable. So I also put a good sized blob of glue on the pins to secure them:

Secured with hot glue

We are now finished with the hardware modifications. We can proceed to reassemble the transmitter and flash ER9x. Here’s my transmitter with the AVR programmer plugged in:

Programmer connected to ISP socket

Transmitter reassembly:

  1. Position the newly installed cable (or group of wires depending on what you used) so that the transmitter can close. There is plenty of space, but be sure that the cable will not interfere with the movement of the sticks, or get pinched.
  2. Reconnect the bundle of wires from the back plate to the front plate of the transmitter.
  3. Close, and secure the plates together with the six screws.
  4. Replace the battery.

Flashing procedure:

  1. Make sure the transmitter is off (there is no need to remove the battery).
  2. Plug your AVR programmer into a USB port on your computer and attach the programming cable to the new ISP socket in the transmitter. The screen should come on on the transmitter, displaying what is usually displayed when the transmitter is on. As the power supply from the computer is only five volts, the low voltage alarm may go off on your transmitter.
  3. Open eePe and click the “Configure burning  software” button (the gear).
  4. If you installed the Arduino IDE to get avrdude, then the default “AVRDUDE location” path should be correct. If not, you should know where you installed it.
  5. Select your programmer under “Programmer.”
  6. “m64” should already be selected for “mcu,” but if not, do so.
  7. Select “usb” for “Port.”
  8. Leave “Extra Arguments” blank and  click “Okay.”
  9. In “Preferences” (under the eePe dropdown menu on a Mac) select your language, default channel order, and default stick mode. These can be set later in the transmitter through its onscreen menus. Mode 2 is the most common stick mode in the U.S., and is what I am familiar with. The left stick controls throttle and yaw, and the right stick controls pitch and roll. As for the channel order, that is how the outputs will be arranged on the receiver. If you are unsure (I was) look at how your receiver is currently plugged in and configure accordingly. For example, I had aileron on channel 1, elevator on channel 2, throttle on channel 3 and rudder on channel 4, so I selected “AETR”.
  10. Click “Okay.”
  11. If you would like to backup your current firmware, click “Read flash memory from transmitter” (the transmitter and green arrow) and enter a save path.
  12. Click “Write flash firmware to transmitter” (the transmitter and fire) and select the firmware file you downloaded earlier (er9x.hex). Wait for the process to be complete (while the firmware is being flashed, the screen on your transmitter will be blank). DO NOT DISCONNECT OR POWER DOWN YOUR COMPUTER WHILE FLASHING. DOING SO WILL MOST LIKELY BRICK YOUR TRANSMITTER. If the flashing fails, try again.
  13. After a successful flash your transmitter’s screen will show a “Bad EEPROM data” error. Click the “DN” button (on the transmitter) to format the EEPROM. You will then get an “Alarms disabled” warning. Press any key (on the transmitter) to continue.
  14. Unplug the transmitter, and power it on. Hold the “+” button to get to “Radio Setup.” Click “-” five times to get to the calibration menu. Follow the onscreen instructions to calibrate your sticks and potentiometers.

Your transmitter is now ready for use. There are many tutorials online about how to setup and use the ER9x firmware. I found this video series and this video helpful. Look for related videos if more information is required.