Yobot: Arduino Yogurt Maker

From MAKE Magazine

From MAKE Magazine

This project first appeared on the pages of MAKE magazine.

Build your own smart yogurt maker.

  • Author: Chris Reilly
  • Time required: Weekend
  • Difficulty: Moderate
  • Add Note x
  • x 6

I’m lazy. My impatience often leads me to botch important steps when I make yogurt. So to get better control over the fermentation process, I made a crockpot thermostat attachment to precisely control the temperature.

You can buy electric yogurt makers, but most of them only incubate; the heating/sterilization step still has to be done on the stovetop. I wanted to experiment with Arduino microcontroller programming and electronic circuit design in Fritzing (an open source circuit layout tool that lets users document and share designs), so why not combine them into something I enjoy doing?

With my old-school yogurt recipe (adapted from wikihow.com/Make-Yogurt), I’d use a stovetop and a candy thermometer to heat the milk to 185°F and cool it to 110°F, then use a warm oven or radiator to ferment it at 100°F. That takes a lot of attention, and more containers than I care to wash later. Even with a commercial yogurt maker, I’d probably have to heat the milk myself, and that’s the step I’m most likely to botch.

Don’t get me wrong — it’s a great recipe as long as you’re diligent. But the combination of boring, time-consuming, temperature-sensitive steps puts my diligence to the test; that’s why the automation of an Arduino-controlled crockpot yogurt maker makes perfect sense to me.

Sections
Tools
Relevant parts
  • micro-controller, Duemilanove This project may also work with the new Arduino Uno, but hasn't been tested
  • Arduino ProtoShield kit, part #MKAD 6 from http://makershed.com and includes: ProtoShield bare PCB; Stackable headers, 6-pin (2); Stackable headers, 8-pin (2); LEDs, 5mm, yellow (2); Resistors: 330Ω(2), 10kΩ(1); Momentary push buttons (2); Capacitors, 0.1μF ceramic (2)
  • Breadboard, mini Maker Shed #MKKN1. Goes directly on the ProtoShield. A separate breadboard can also be usedBuy it
  • Relay control PCB SparkFun #COM-09096
  • Relay SPST -NO, sealed, 30A SparkFun #COM-00101
Relevant parts (continued)
first image

Add Note Edit Step 1 — How the Temperature Control Works  ¶ 

  • I plug my crockpot into a relay, which in turn is connected to the wall socket. I leave the crockpot switched on, so that the relay controls when power is supplied to the crockpot. The relay is toggled on and off by an Arduino microcontroller, based on readings from a waterproof temperature-sensitive resistor — called a thermistor — placed inside the crockpot. I put my yogurt containers in a water bath inside the crockpot to ensure even heating, then submerge the temperature sensor in the water.

  • A voltage divider circuit is used to indirectly measure the resistance of the thermistor. In the code that runs on the Arduino, I use the Steinhart-Hart thermistor equation to translate the thermistor’s resistance into temperature. This gives a pretty good idea of the temperature inside the crockpot. In addition to the thermistor’s resistance at a given time, the equation needs to be fed 3 coefficients, which can be calculated from predetermined thermistor resistances at different temperatures, shown on the manufacturer’s data sheet.

  • You can use a simple online calculator (http://makezine.com/go/thermistor) to get your coefficients for a given temperature range, or do the calculations yourself (http://makezine.com/go/diy_calc). Since we’ll be measuring a range between 100°F (38°C) and 185°F (85°C), I used resistance values measured at 86°F (30°C), 140°F (60°C), and 194°F (90°C) to calculate my coefficients. The code that decides whether the crockpot should be on or off is very simple; it checks the temperature once per second and turns the relay on or off if the temperature is under or over the target temperature.

  • If the temperature control were variable, like a dimmer switch, then it might make sense to use a more complex control called a proportional-integralderivative (PID) algorithm. PID controllers use a sophisticated set of rules to control things like heat or pressure and keep them from overshooting their target values (see “Sous Vide Cooker,”). For our purposes, though, a simple approach works fine.

first image

Add Note Edit Step 2 — Prepare the thermistor.  ¶ 

  • Since the temperature readings will be taken in the water bath, we need a way to keep the thermistor from getting wet. I found a great reference online for constructing a waterproof sensor (http://makezine.com/go/sensor1).

  • I waterproofed my thermistor by first soldering the thermistor onto 2 long (~3') hookup wires, then wrapping the exposed wires with electrical tape.

  • I slid a short length of aluminum tubing over the sensor, then used moisture-resistant heat-shrink tubing and a heat-shrink end cap (on the open end of the tube) to seal both ends. You can use a heat gun or hair dryer to seal the tubing; you could also use epoxy to make the seals.

first image

Add Note Edit Step 3 — Construct the relay.  ¶ 

  • The Relay Control PCB from SparkFun comes disassembled, so you’ll solder the components to theboard: relay, 1K resistors (2), 10K resistor, diode, transistor, and LED. If you follow the component labels silkscreened onto the board, you shouldn’t have much trouble.

  • A few tips:

    • The relay will only fit in the correct orientation.

    • The line on the diode must match the line on the board.

    • The flat side of the transistor lines up with the flat side of the outline labeled 2N3904.

    • The unlabeled circular outline is for the LED. Face the flat side of your LED’s base toward the flat part of the outline. If your LED lacks a flat side, its shorter lead should face the flat outline.

  • SparkFun has a great tutorial for constructing a 120V relay outlet specifically for this relay board (http://sparkfun.com/tutorials/119). If you’re uncomfortable working with high-voltage control or just don’t feel like soldering as much, you can also check out SparkFun’s PowerSwitch Tail, a premade version of this relay at http://sparkfun.com/products/9842.

first image
thumb image 1
thumb image 2
thumb image 3

Add Note Edit Step 4  ¶ 

  • Here is the yogurt maker’s relay assembly. I deviated slightly from SparkFun’s instructions by using a female connector instead of a GFCI outlet. Use the extension cord’s male end with 12"–14" of cord attached. Expose the cord’s 3 wires in the middle of its length, then cut the black wire and solder the ends to the relay board’s Load 1 and Load 2 connections. This is where the line voltage toggles on and off.

  • Attach the 3 wires at the end of the cord to the female connector: the green/blue wire (ground) to the green screw terminal, and the black and white wires to the other 2 terminals. Use a connectivity tester to make sure the larger slot receptacle is connected to the larger prong on the plug.

  • The solder points on the relay are basically live exposed wires, so use a project enclosure to keep the relay from accidentally being touched

  • CAUTION : Be extremely careful when working with line voltage, as it can actually kill

first image
thumb image 1
thumb image 2

Add Note Edit Step 5 — Build the circuit.  ¶ 

  • Assemble the circuit, following these images. The former was drawn in Fritzing (http://fritzing.org), an open source tool for creating interactive electronics. It offers a visual mode that lets you document circuits the way they look in real life — a great feature for those of us who aren’t electrical engineers or are just visual thinkers.

  • The best part is that the visual mode is linked to a schematic diagram drawn with traditional electronics symbols, which can really help newbies to see the translation between the visual layout (first image) and the schematic layout (second image).

No image

Add Note Edit Step 6 — Load the code.  ¶ 

  • Download the code from http://makezine.com/25/yogurt and load it onto your Arduino.

  • The program controls 3 stages of temperature for making yogurt:

    • Stage 1: heats milk to 185°F for 10 minutes, to sterilize it and denature enzymes in it. (It’ll reach 185°F faster if you cover the pot with a towel or blanket.) When Stage 1 ends, the buzzer sounds for 1 minute.

    • Stage 2: cools the milk to 110°F. During this stage it’s useful to remove the cover and any insulation to allow for faster cooling. When the temperature reaches 110°F, the buzzer will signal. The temp will hold at 110°F for 10 minutes, then Stage 2 ends. That’s when you’ll add yogurt or starter culture and seal the containers.

    • Stage 3: incubates the yogurt at 100°F for 8 hours then shuts off the heating element. This period can be increased to taste; the longer the fermentation, the more sour the yogurt. At the end of Stage 3, the alarm will sound for 10 minutes, at which point the yogurt containers should be refrigerated.

first image

Add Note Edit Step 7 — Make automatic yogurt.  ¶ 

  • Wash everything! Before starting, gather up all the containers, lids, and stirring utensils to be used. Thoroughly wash them with very hot, soapy water. then rinse them all well with more hot water.

  • Then follow this recipe and let your Arduino do the cooking.

  • Ingredients

    • ½ gallon of milk

    • 1 package dry milk

    • Yogurt or starter culture

first image

Add Note Edit Step 8  ¶ 

  • Step 1: Add the dry milk to the wet milk. Stir thoroughly.

  • Step 2: Fill the containers and place in a water bath in the crockpot.

  • Step 3: Loosely cover the jars to prevent condensation from dripping in, and insert the thermistor in the water bath.

  • Step 4: Plug the crockpot into the relay, and the relay into a power source.

  • Step 5: You can insulate the crockpot by covering it with towels or blankets to help the heating stage go faster. The milk will heat to 185°F.

  • Step 6: Plug the Arduino into a computer. The serial monitor will give feedback and instructions.

  • Step 7: After the milk has cooled to 110°F, add about 1 tablespoon of starter or yogurt per container.

  • Step 8: Seal the lids tightly and incubate for 7 hours (or more) at 100°F. It’s yogurt! Refrigerate after opening.

This project first appeared in MAKE Volume 25.

For more information, check out the Arduino category page.

Did you successfully follow this guide?

This guide has been completed 6 times.

Related Products

Comments Add Note Comments are onturn off

Guide Add Note

I love this! I've been looking for a project to get me involved with the Arduino platform and this project looks like just the ticket. Also I think it would be easy to adapt this setup for other time/temperature sensitive cooking. For example a modified version of this project could run a proofing box for bread making, monitor beer brewing, control a chest freezer for lagering beer or control a cheese/sausage curing "cave".

Josh Burroughs, · Reply

The circuit needs a flyback diode across the relay otherwise the back EMF off the relay's coil could fry the transistor.

Nathan Kingsley, · Reply

I like this idea. I've been using my homemade crockpot-sousvide to incubate my yogurt, but I hadn't thought of using it to also heat the milk. And I like that it's totally automated.

I know with my crockpot hack, that temperature overshoots (I think because the coils don't cool off quickly and the ceramic pot continues to warm up for a bit). I'm wondering if yours has the same behavior and whether it affects the yogurt.

Ryan, · Reply

This is a good idea for the incubation process.

However,

I make yogurt all the time and there is no problem with the heating/sterilization process. You do not need to use the stove top.

The microwave works perfectly and there is no danger of scorching the milk - this can leave an unpleasant "vulcanized" flavor.

I use a 2 1/2 quart Anchor Hocking glass graduated measure for a half gallon/2-liter batch.

If the milk is right out of the fridge, it takes 15 minutes at full power in a 1000 W. microwave. (11 minutes if, like me, you leave the milk out for several hours so it is at room temp.

I use a Thermoworks EcoTemp Alarm Thermometer which sounds an alarm at the high temp setting and will alarm again when the temp reduces to 112° F., the temp specified by the culture I use.

It's inexpensive at $39.00 and well worth the cost.

I prefer to use the cultures sold by New England Cheesemaking Supply.

AndieP, · Reply

In addition, you can make sour cream by using half & half and if you use heavy whipping cream, with these same yogurt cultures, you get a product that is very close to clotted cream - and for much less cost.

AndieP, · Reply

This is a great guide! I had been looking for a good way to waterproof the temp sensors, and the sparkfun products you linked to would have been very useful to me. You could use this for sous vide cooking with a little modification to the code!

Abe, · Reply

I've not played with microprocessors before was able to build the gadget without too much difficulty, but the relay won't respond to digital pin 13. I connected it to 5 volt supply and the relay tripped fine with 5 volts applied to the ctrl lead, but digital pin 13 only puts out about 2 volts and apparently isn't enough to trip the relay. Everything else seems to work OK.

Roy Doorenbos, · Reply

In the void setup, make sure to add pinMODE (13, OUTPUT). It was missing from the downloaded code. When I added that, pin 13 operated much better.

RyanS,

I've puttered some more and I coded pin 11 to control the relay. When the Arduino turned the relay "on" pin 11 put out 4.88 volts, but not enough to trigger the relay. When I touched the control wire to a "5v" connection, it would trigger it. Voltage measured across the "5v" connection was 5-5.1 volts. Does .1 volts make that much difference?

Roy Doorenbos, · Reply

Roy are you sure that you are using a transistor to drive the relay? The relay draws too much current to connect it to the pin directly.

Andy Sharp,

Most yogurt recipes call for incubating the yogurt at 105 to 115 deg F. Yours is the first I've seen that only calls for 100 deg. Are you sure that 100 deg is correct? Anyone have any thoughts on this? We may experiment with various temps and report back.

Andy Sharp, · Reply

I used the 100 degree setting and it seemed to work ok. To be truthful, though, my infrared thermometer shows my water temp to be a bit higher than what the thermistor is reading. I want to get a thermometer that I can calibrate to for sure.

RyanS,

I went through this project a week or so ago with pretty good success. I did change the Sparkfun relay board to a solid state relay, which I had on hand. There were a few items in the code that I needed to change that didnt work right off the download (for instance the holdFor time was initially an 'int' when it needed to be a 'double'), but they were very minor. For the temp sensor I made a little different one with a 1/2inch copper coupler, and it seems to work great.

The first batch turned out just fine - even my wife said so.

RyanS, · Reply

This was my first Arduino project as well as coding...It was a great starting point. The code was wonderful doing all the hard stuff with converting the temps. Thank you for that hard work.

I did detect a couple of minor flaws in the code.

I was using the Arduino Uno with a prototype shield. I did have to connect the push button to Pin 12.

Also in the code the line to activate the Relay was missing from the Void Setup section.

I added:

pinMode(13,OUTPUT);

I had fun experimenting with different parts of the code too!

Great learning project.

Marc, · Reply