Calibrating the Pressure Sensor to match the Pressure Gauge on my Espresso machine

Some time ago I fitted both a mechanical pressure gauge (shown in the photo below) and an analogue pressure sensor (Danfoss AKS 32R) to my Gaggia Classic. The analogue sensor is connected via an ADC board to a Raspberry Pi, which displays the output on an LCD display. Calibration is needed to make the sensor reading match the gauge exactly.

Pressure Gauge

When I first installed the sensor, I used an approximate calibration as shown in the pseudo-code below:

minVoltage = 0.5V
maxVoltage = 4.5V
maxPressure = 20.6842719 bar (300 psi)
voltage = pressure sensor voltage (measured by ADC)

voltageRange = maxVoltage - minVoltage
bar = maxPressure * (voltage - minVoltage) / voltageRange

Although this was only based on the sensor specifications, it actually gave surprisingly good results. There was only about 0.5 bar difference between the gauge and the pressure sensor (the sensor always read slightly higher than the gauge). Nevertheless, I decided to calibrate the sensor against the gauge (on the assumption that the gauge was more likely to be correct). Absolute accuracy isn’t really critical, but I wanted them both to show the same values.

To calibrate the sensor, I took about 20 simultaneous measurements for the gauge and the sensor and plotted them in Excel as an X-Y chart. This isn’t as easy as it sounds, because the readings need to be taken when the pressure is fairly stable. After running the pump, it takes a while for the pressure to slowly reach equilibrium, and that’s when you need to very quickly take a note of both values! It’s also difficult to read figures very accurately off the gauge.

These measurements gave a reassuringly good straight line fit (below), which suggests that both the gauge and sensor have good linearity. Using Excel, I then added a trend line to the chart and read off the scale and offset values directly (Excel has an option to display the equation), as shown below.

sensor_vs_gauge

To correct the pressure sensor reading, the value is scaled by the reciprocal of 0.9385 and the offset 0.829 is subtracted. These parameters are stored in a configuration file, so they can be easily changed if required.

This simple calibration process worked out really well and means that the pressure sensor readings displayed on the LCD (and stored in the log files) now match the mechanical gauge exactly!

Projector brightness: Optoma EH505 versus Optoma TX785 in 3D and 2D modes

This post compares the light output of two single-chip DLP projectors, running in 2D and 3D mode. These tests were prompted by a perceived reduction in brightness with the EH505 operating in 3D mode.

The projectors were set up in front-projection with 2.5m image width, and room lighting was turned off. The source was HDMI, displaying pure white full frame. For each light measurement, a central area of 200×200 pixels was scanned with an LX1330B lux meter in peak hold mode.

The EH505 projector offers 1920×1200 native resolution in 2D mode, and was tested here at the native resolution, at a custom 3D resolution, and at lower resolution for direct comparison with TX785 (an older model with 1024×768 native resolution). According to the manufacturer, both models are 5000 lumens.

For the EH505, the lamp brightness mode was BRIGHT, the lamp was at about 12 hours life, and firmware version was M01. The 3D mode used for the EH505 was VESA 3D and manually set to Frame Sequential. For the TX785, the 3D mode was set to IR Mode (i.e. DLP-Link mode disabled). Great care was taken to select appropriate settings for all parameters to permit meaningful comparison (there are too many to list here).

For the purposes of the 3D tests, the Full 3D HD 24Hz modes of the EH505 were not used, in preference for true frame sequential active stereo at over 100Hz native input frequency.

Here’s a summary of the results:

ModelResolutionHzModeLux
EH5051520x950104Presentation431
EH5051920x120060Presentation425
EH5051024x76860Presentation435
EH5051920x120060sRGB209
EH5051520x9501043D176
EH5051520x9501043D176
EH5051280x7201203D173
EH5051024x7681203D177
TX7851024x76860Presentation516
TX7851024x76860Bright703
TX7851024x768120Presentation233
TX7851024x768120Bright285

Calculating relative Lumens from Lux and screen area, it appears that the EH505 is about 37% dimmer than the TX785 in 3D mode and about 31% dimmer in 2D mode (these figures are based on a 3.91m² screen area for EH505 and 4.69m² for TX785). In mitigation, the EH505 is of course considerably higher resolution than the TX785. It’s also worth noting that these measurements were only carried out on a single projector.