Arduino-Based Pasteurization Scanner 2.0

This post is much overdue.

As I worked on the original Arduino-Based Pasteurization Scanner (I will now refer to it as the 1.0), I began to realize that many of the components I was adding could possibly be integrated onto one PCB board.  When I first began the 1.0, I really had no knowledge about PCB design, so I sort of pushed the thought off to the side for a good year or so.  It just so happened that some of my father’s friends in the cider-brewing community got word of the work I had done, and were possibly interested in having one of their own.

For those of you with less technical knowledge about electrical design, a PCB stands for Printed Circuit Board, which are the “chips” that are inside pretty much of sort of electronic you use daily.  They generally contain only the minimum amount of hardware necessary in order to cut down on cost.  And since a PCB can be designed once, and printed as many times as the designer wants, it is a good way to mass-produce your design for an electronic.

I soon discovered that PCB design is sort of like carpentry where the mantra of “measure twice, and cut once” rules over everything.  All the parts that you intend to use get laid out in software, but the designer has to double check that each part that is necessary in the design matches the physical dimensions in the software, or else the parts won’t fit and a new board will need to be fabricated.

Messy first design

At first, I wanted my PCB to be exactly the same size as the screen I was using, so that the screw holes on the LCD would match the screw holes on my PCB.  Then the PCB could just rest directly behind the screen (and when looking straight on, you wouldn’t even know there was anything there).  The pins on the right side of the screenshot above match up to the LCD screen inputs, so a vertical header could be used to directly plug in the screen to the PCB.

Getting slightly better…

As I went on in my design, I tried to minimize the amount of traces (which are the electrical connections between parts on the board), and vias (which are when the traces switch from the top side of the PCB to the bottom, so that two different traces don’t intersect).  I also added something extra, a WiFi module that prints out data when the user connects to it through a web browser (that’s the big rectangular thing in the upper left on the below screenshot).  I also added a 4-axis joystick button, another thermometer port, and a speaker.

Final design

Eventually, I scrapped the idea of making the PCB have the same size footprint as the screen and made it even smaller, since I was being charged by the square inch of my design.  I also tried to optimize the pins I was using on the microcontroller so that the traces needed could be simpler and require fewer vias.

Once the PCB came in, all I needed to do was solder all the parts on and hope they all fit!

They didn’t.  In fact there were a couple errors in my design, which you can’t see since I fixed them on the backside.  Also my barrel plug footprint did not match up with the ones I ordered, so I had to break it out with some wires.

I plan to have a complete final design done by the time I graduate.

Re: Dorm automation

I just recently saw Ben's post  on Dorm Automation ideas and felt I should share something similar I've done. Last year, I lived in Barringer Hall, a horrible dorm lacking both air conditioning and a thermostat for the radiator. We had fans in the windows, but it became a huge pain for me to get out of bed to turn them on and off whenever I wanted to change the temperature. Using an Arduino, ethernet shield, WRT54G, and spare components, I set out to create an unnecessarily complex system for controlling my fan wirelessly and satisfying my laziness. As it turns out, this was extremely easy to do by hacking together a bunch of sample code, simple circuits, bash scripts.

I installed OpenWrt on my router, which is a custom firmware designed to add lots of enterprise features on consumer hardware; it runs the Linux kernel, but not the full GNU userspace due to a lack of flash memory. It was already running a HTTP server, so I was able to just write a simple HTML page that included frames of external pages on the Arduino. On the Ardunio, I modified an example web server and had it also interface with a LM34 temperature sensor to display its output value, which was fairly easy to do. Hardware was equally simple, as I only needed a NPN transistor to amplify the signal from a digital ouptut pin and operate a solid state relay which controlled a 120VAC extension cord. I ended up putting it in a large enclosure to discourage questions from curious fire marshalls. While the whole setup was one big kludge, it worked well and I was the envy of my fellow engineering hallmates.

Unfortunately, I don't think I saved my final code, so I can't share it. I had planned to replace this whole setup with a more robust python daemon, but soon moved to an apartment with a real thermostat and disassembled it. In the future, I plan on replacing this with either something python based on a laptop that controlls a parallel port or a Cerebot board I have left over from 2534. My eventual goal is to have something more complex than Zack Anderson's setup.

Arduino-Based Pasteurization Scanner

My father is a bit of an English-cider making enthusiast and he generally looks to maximize what he gets out of paying for my Virginia Tech tuition.

When he realized that he would like to be able to have a system that would automatically measure how well pasteurized his cider is while in the pasteurization tank, he came to me.  Naturally, I obliged.

One Pasteurization Unit (PU) is defined as 1 minute of heating at 60 degrees Celsius.  The equation is as follows:

Using interrupts, every 1000000 microseconds (or 1 second), the temperature is read from a waterproof thermometer sensor, which is then sent to the Arduino which plugs that value into this cumulative PU equation:

PU = PU + pow(10,((C-TEMP_REF)/Z))/60; where C = the current temperature, TEMP_REF and Z are user-defined constants respective to the liquid being pasteurized.  As you can see, because this equation is effectively called every second we must divide by 60 because this equation is meant for every minute.  This results in a very accurate cumulative PU reading since the temperature is being read so actively.

The PU value is then sent to a screen (I elected to use a graphical LCD instead of a text-based screen since it is much larger and allows for bigger text) and displayed along with a timer since the scanner has been active.

A switch was constructed to have an active and inactive mode (the LED changes color from red [inactive] to blue [active] depending on the state).

An enclosure was constructed to make the system as waterproof as possible, although the thermometer cord itself has a fairly long waterproof cable which should prevent any possible damage to the system.

Using a bigger screen caused some more complexity to the project which I did not expect.  This was because the screen runs on 3.3v, and since the Arduino runs on 5V logic all the signals sent from the Arduino to the screen must be reduced to 3.3v.  Using a 4050 level-converter, we can do just that:

I forgot to get a picture before we closed it up but the 4050 can be seen at the top of this picture:

Happy brewing!

Source Code

2 LED’s with Arduino

So for my first project with Arduino, I made 2 LED’s fade and get brighter in a loop.  Basically when one LED is at its brightest the other should be off, and vice versa.

It wasn’t too hard, and the example code provided with the compiler helped me to get started.

Ben Schoeler - 6/1/2012

Fade with 2 LED's

This example shows how to fade LED's on pins 9 and 10

The brightness of each LED will be opposite of the other LED

int yellow_led = 9;
int red_led = 10; // the pin that the LED is attached to
int yellow_brightness = 0; // how bright the LED is
int fadeAmount = 5; // how fast to change the LED's brightness
int red_brightness = 0;

// the setup routine runs once when you press reset:
void setup() {
// declare pin 9 and pin 10 to be outputs:
pinMode(yellow_led, OUTPUT);
pinMode(red_led, OUTPUT);

// the loop routine runs over and over again forever:
void loop() {
// set the brightness of pin 9 (yellow):
analogWrite(yellow_led, yellow_brightness);

// set the brightness of pin 10 (red):
analogWrite(red_led, red_brightness);

// change the brightness for next time through the loop:
yellow_brightness = yellow_brightness + fadeAmount;

// reverse the direction of the fading at the ends of fade:
if (yellow_brightness == 0 || yellow_brightness == 255) {
fadeAmount = -fadeAmount;

//set red brightness to be the opposite of yellow brightness
red_brightness = 255 - yellow_brightness;

// wait for 30 milliseconds to see the dimming effect

I hope to do one of these Arduino projects every day.  I think tomorrow I’m going to set out working on an I2C interface with an LCD screen I have.

Sneak peak: