Netduino PID Controller

Rancilio Silvia Mod in .NET Micro Framework

View project onGitHub

Project Status

  • 2013/09/11: Parts have been ordered.
  • 2013/09/27: Parts are tricking in. Real Time Clock demo working.
  • 2014/01/19: Have proved out hardware and software for all parts individually. Working on a printed circuit board and firmware.

Overview

The Rancilio Silvia is a well-known and serviceable espresso machine. Hobbyists and hackers have been upgrading its temperature controls with things like Watlow PID controllers for years. The aim of this project is to use a Netduino to power the project and execute the PID logic in software. While the code will be in C#, the concepts will be directly transferrable to Arduino given the compatible sensor and pin logic between Netduino and Arduino.

Using a K-Type thermocouple via an amplifier, the Netduino controls the brew temperature by toggling a solid state relay that controls the heating element. User interface is via a backlit 20x4 character serial LCD display, with input via a grey-code rotary encoder which provides clockwise (next), counter-clockwise (prev) and push input (select). That input/output combination is sufficient to provide a menu to control the system. A realtime clock module is used to keep time when the power is out and enables sleep, wake, and timer functions. Finally, an ultrasonic distance sensor measures the depth of the remaining water in the tank.

Inspection of the parts list will show that two of each part has been ordered. When the initial build is complete, a second, related project may be undertaken to modify a combination slow/pressure to augment accurate temperature control that enables existing functionality as well as sous vide.

Parts List

Summary and Prices

Parts purchased from numerous vendors on eBay shipping predominantly from Honk Kong and China (with the exception of the Netduino itself, which is from Little Bird). Given the disparate vendors and for posterity, images and specs have been copied here.

Prices below reflect total cost to my door, including shipping and tax, in AUD in September 2013.

Descr Qty Item $ Total $
Thermocouple 2 6 12
Thermocouple Amp 2 13 26
Sold State Relay 10A 240V 2 4.48 8.96
IC Socket Adapter 10 1 2.37 2.37
Display 20x4 2 12.99 25.98
Real time clock 2 2.21 4.42
Rotary Encoder 10pc 1 5.43 5.43
Prototyping Shield 2 4.46 8.92
Netduino 2 2 46.01 92.02
Distance Sensor 1 1.82 1.82
Total 187.92

K-Type Themocouple

  • Operating Temperature: -40 - 400 C
  • Washer Material: Iron
  • Inner Diameter: 12mm
  • Outer Diameter: 19mm
  • Cable Length: 2m
  • Cable External Shielding: Stainless Steel Braiding
  • Cable Internal Insulation: Fiberglass

AD595AQ Thermocouple Amplifier

Chip datasheet [pdf]

Solid State Relay - 24 to 380VAC @ 10A

  • Weight: 132g
  • Size:5.9 x 4.5 x 2.3cm
  • Color : Grey
  • Long service life and high reliability
  • Highly reliable, compact size designed to offer users maximum simplicity
  • Fast switching
  • Reduced electromagnetic interference
  • Output voltage: AC 24-380V
  • Output current: 10A
  • Input voltage: DC 3-32V
  • Control Method: DC to AC
  • Mounting Method: Bolts fixed
  • 3-25mA control current DC
  • -State leakage current ≤ 2mA
  • On-state buck ≤ 1.5VAC
  • Off-state time ≤ 10mS
  • Dielectric strength 2500VAC
  • Insulation resistance 500Mω/500VDC
  • Ambient temperature -30 ℃ - +75 ℃
  • Work indicator LED

DIP14 IC Socket Adapter Adaptor (10 pack)

  • SKU: 14_S000214005160
  • 10pcs 14pin IC socket.
  • Pitch of these IC sockets are 2.54mm.
  • These IC sockets measure approx. 18mm long, 10mm wide and 9mm high.
  • Description:
  • Number of Pins: 14
  • Pitch: 2.54 mm
  • Overall Size: Approx. 18 x 10 x 9 mm

20x4 Character LCD Serial Display with Blue Backlight

  • I2C 8-bit Expander Datasheet
  • Brand new and high quality.
  • Arduino dedicated IIC bus control, it only takes two IO.
  • And adjustable contrast and backlight controlled.
  • Using high-quality LCD screen 2004, blue and white, clear display.
  • IIC bus control, it only takes two IO port.
  • Controllable backlight can be controlled by jumper, you can also program control.
  • Screen display and adjustable contrast.
  • 5V power supply, the device address 0x27.
  • Apply to the arduino platform.
  • Size:9.8cm x 6cm - 3.9inch x 2.4inch.

Rotary Encoder (10 pack)

Features:

  • Brand new and high quality
  • These are continuous rotary encoder switch
  • With Built in push button switch (push to operate)
  • Can input the data when used with in-car CD player
  • Can control the volume, on/off and data selection through LED or LCD display
  • Great for use with PIC or ATMEL microcontrollers
  • I am sure it the right thing you need now.Don't hesitate, bid now and never miss it.

Specifications:

  • Rotary Shaft Length: Approx. 12mm
  • Shaft Full Length: Approx. 20mm
  • Shaft Diameter: Approx. 6mm
  • Size (L x W): Approx. 15 x 12mm
  • Output: 2-bit gray code
  • Closed Circuit Resistance: 3 ohms maximums
  • Max. Rating: 10 mA at 5 VDC
  • Operating Temperature Range: 30 to 70 degrees celsius
  • Storage Temperature Range: 40 to 85 degrees celsius


Package Included:

  • 10 x Encoder switch
  • 10 x Nut
  • 10 x Gasket

Realtime Clock Module DS1307 I2C

Features:

  • Brand new and high quality.
  • The module comes fully assembled.
  • The DS1307 is accessed via the I2C protocol.
  • Two wire I2C interface.
  • Hour : minutes : seconds AM/PM.
  • Day month, date - year.
  • Accurate calendar up to year 2100.
  • 1Hz output pin.
  • 56 Bytes of non-volatile memory available to user.
  • Size: 2.8cm x 2.7cm.

Package Included:

  • 1 x DS1307 Module

Prototyping Shield and Breadboard

Features:

  • Brand new and high quality.
  • Small soldering area.
  • All Arduino pins are brought to the top level.
  • 1 reset button, 1 general use button, and 2 LED circuits can be used directly.
  • 5V, GND, and Raw pins are exposed as well.
  • SOIC place for IC.
  • The mini breadboard has 170 tie points.
  • The breadboard sticks on the prototype shield with its self-adhesive backing.
  • Size:7.5cm x 5.5cm - 2.95inch x 2.16inch.

Package Included:

  • 1 x Arduino prototype shield
  • 1 x Mini breadboard

Ultrasonic Distance Sensor

  • 100% Brand New and High Quality
  • Working Voltage : 5V(DC)
  • Static current: Less than 2mA.
  • Output signal: Electric frequency signal, high level 5V, low level 0V.
  • Sensor angle: Not more than 15 degrees.
  • Detection distance: 2cm-450cm.
  • High precision: Up to 0.3cm
  • Input trigger signal: 10us TTL impulse
  • Echo signal : output TTL PWL signal
  • Mode of connection:
    • 1.VCC
    • 2.trig(T)
    • 3.echo(R)
    • 4.GND
  • Use method: Supply module with 5V, the output will be 5V while obstacle in range, or 0V if not.The out pin of this module is used as a switching output when anti-theft module, and without the feet when ranging modules.
  • Data Sheet

Netduino 2

See the official product page.

Real Time Clock

The real time clock module is based on a DS1307 microcontroller (datasheet [pdf]). It's connected to +5V/VCC, GND, and the Netduino 2's dedicated I2C SCL and SDA ports.

To prove that the clock works, a demo was worked up that blinks the light to show the time. See this commit. Code to read the device is via this forum post. The clock I received had never had a time set, so initially it was returnning an invalid number. After setting the clock once with clock.SetClock() the device is now working great.

Scratchpad

  • If the surface of the water is difficult to detect with the ultrasonic distance sensor, try floating a ping pong ball on the surface. Its location may need to be constrained with a PVC tube or similar. This may make the housing of the distance sensor more robust than e.g. a clip on the side of the water tank.