Friday, July 11, 2014

Designing a Brew Chamber Controller (Part 3)

In this session we're going to build a mockup of the brew chamber controller and discuss how this works.

Hopefully you have the following items:

  1. 1 Red LED
  2. 1 Green LED
  3. 2 1k ohm resistors
  4. 1 thermistor
  5. 1 10k to 50k ohm resistor(depending on your thermistor)
  6. or 1 temperature sensor (replaces items 5 and 6)
The goals of this experiment are:
  1. Populate Breadboard
    • Add simulated heating device components
    • Add simulated cooling device components
    • Add thermistor/voltage divider or temperature sensor
OK let's get started.

The BBB has several different types of pins on each of its expansion headers.  The first ones we will discuss are the General Purpose Input Output (GPIO) pins.  The GPIO pins can be set as either input or output pins and they are assigned as such at the start of the program.  The GPIO pins operate between 0 volts and 3.3 volts maximum.

When set to output mode the BBB can switch the pin between 0 volts (LOW/OFF) and 3.3 volts (HIGH/ON).  Using the pins in output mode we can apply power to small devices that operate on low current by telling the software to turn the pin on.  To operate devices that require more power we have to use driver circuits. The driver circuits can be turned on or off by the BBB GPIO pins and in turn the drivers actually turn the high power devices on or off.

When the GPIO pin is set to input mode the BBB detects whether there is a voltage present or not on the pin.  The pin can be set to normal high mode by routing 3.3 volts to it through a "pull up" resistor. A switch is connected to the pin and to ground. When the button is pushed the pin is shorted to ground. The reverse is used to set the pin normal mode low. The pin is connected to ground through a "pull down" resistor and the switch is connected to the 3.3 volt rail.  When the switch is pressed 3.3 volts is applied to the pin.

In the next post during our initial experiment and testing of the software with the mock up Brew Chamber Controller we'll be using the GPIO pins in output mode to turn the LEDs on and off.


The BBB has sensitive IO pins that operate at low current levels. To protect the IO pins we need to use a resister in series with the LED. The current limiting resistor will also protect the LED as too much power will damage the LED.  When a resistor is used in this configuration it is called a "current limiting" resistor. A 1k ohm resistor usually suffices when used with a LED.  If too high a resistance is used for the "current limiting" resistor the opposite will happen and the LED will glow to dim or not glow at all.  If the LED glows to bright for your application then increase the resistance value of the "current limiting" resistor.

The Red LED will simulate our heating device and the Green LED will simulate our cooling device.  If I had a blue LED I'd use that instead of the green one since blue is associated with cold.

The circuit diagram for each LED looks like this:

LED Circuit Diagram

We now need to add these components to the breadboard so they look like this:

Red and Green LEDs and Current Limiting Resistors

To save having to use two extra jumper wires I've used the resistor to connect the LED cathode (short lead) to the breadboard ground bus.  It doesn't matter what side of the LED the resistor goes on so long as it's in series.

The red wire will go to the BBB GPIO pin we will use to control the heating device.

The green wire will go to the BBB GPIO pin we will use to control the freezer.

THE BBB Analogue to Digital Converter (ADC) PINS

The BBB expansion headers also had analog to digital converters (ADC) on them.  They read an analog voltage between 0 volts and 1.8 volts.  If you will be buying analog sensors for any of your projects make sure they are 1.8 volt versions so they will work with the BBB ADC pins. Voltages greater than 1.8 volts will damage the analog inputs.

Next we'll install the components for the thermistor voltage divider network.

The circuit diagram looks like this:

BIG NOTE HERE: Positive should be next to the thermistor and negative next to the resistor.  The circuit will read the resistance incorrectly and thus calculate the temperature backwards.

The Thermistor Voltage Divider Network

The thermistor that came in the bundle of components I bought is a 503.  The data sheet says it has an internal resistance of 50k ohms at 25C. To use this component we need to create a voltage divider network. One side of the thermistor is connected to ground and the other is connected with a resistor of equal value to the thermistor resistance value at 25C. The other end of the resister is connected to 1.8V. This forms a voltage divider.

When the two resistances are equal (should be at 25C) the voltage in the middle of the voltage divider should be 1.8 / 2 or 0.9 volts.  As the temperature deviates from 25C the resistance of the thermistor changes.  If the resistance is lower than 50k ohms the the voltage will be less that 0.9 volts.  If the resistance is more than 50k ohms then the voltage will be higher than 0.9 volts.

The components installed in the breadboard look like this:

Swap the red and black wires in the thermistor circuit.

Thermistor Voltage Divider Network

The black wire connects one side of the thermistor to the ground rail.  The red wire connects the far end of the resistor to the ADV 1.8V pin (shown incorrectly in the photo - will be fixed soon).  The yellow wire will connect the thermistor/resistor junction to the BBB ADC input pin.

If you are using a 3 pin temperature sensor then one outside pin goes to ground, the center pin goes to the BBB ADC pin and the other outside pin goes to the ADC 1.8V pin.  The temperature sensor has the divider network built in to that tiny chip.  Buy several to keep on hand for other projects.

OK, so now we have all the components and wire jumpers installed on the breadboard awaiting a function check.  In the next post we'll fire up the BBB and do some simple checks to make sure the breadboard functions as designed.

See you then!


  1. Images seem to be broken. Is there a way I can find them?

  2. I guess the location that blogspot uses to store the pictures lost them. THanks for having such a robust servoce blogspot, NOT!