Introduction: Tea to Taste - Analytical Chemistry in the Kitchen

by keenpatrickson in Circuits > Arduino

294 Views, 0 Favorites, 0 Comments

Introduction: Tea to Taste - Analytical Chemistry in the Kitchen

IMG_6182.JPG

Purpose

Ultimately, this project is to show how analytical chemistry can be applied in and out of the lab. As an area of chemistry, analytical focuses on precise and accurate measurements of substances based on their characteristics, which can vary from how well they conduct electricity to how they break apart when we hit them with concentrated energy. This project, Tea to Taste, shows how to build and utilize a spectrophotometer to analyze tea and other drinks and their concentrations, which can also be linked to certain flavor profiles. Teas often come with different brewing instructions based on the type, such as green or black tea, but I didn't know whether those instructions were ideal for how I wanted my tea or for the maximum flavor possible. So I built this, what I'm affectionately calling the Quarantine Frankenstein Spetcrophotometer.

Supplies

What you'll need for this project:

  • Small boxes, such as hair dye boxes, poptart boxes, and bulk tea bag boxes. These will form the outer part of your instrument.
  • Empty toilet paper rolls. I know these have been in short supply lately, but they're really handy for round objects.
  • An Arduino microcontroller board. They're pretty inexpensive, and you can do a lot with them to entertain yourself. We'll use this to control our spectrophotometer.
  • Arduino accessories - a printer cable, a breadboard, male-to-male DuPont wires, a photoresistor, and a small 10 kilo-ohm resistor.
  • A flashlight, preferably an LED flashlight, which only has one wavelength of light.
  • A clear container for your sample; I used a small plastic bottle with a lid that I turned upside down for measurements.
  • A CD or DVD you don't mind cutting up; we use this to reflect and diffract light onto our detector.
  • Styrofoam, tape, box cutters, and some packing material for when everything moves around too much.
  • Whatever you want to test, in bulk. I used Bigelow Earl Grey Tea

Step 1: Setting Up Hardware

IMG_6173.JPG
IMG_6174.JPG
IMG_6175.JPG
IMG_6191.JPG
IMG_6176.JPG
IMG_6195.JPG

Source

The easiest part of Frankie to set up is the source, or where the light comes from. The flashlight should produce a pretty strong beam of light that we need to somehow direct through a sample compartment with as little ambient light filtering in as possible. What I did was put it in a toilet paper roll with some packing material - in this case, a (clean) sock. The flashlight can no longer move around, and I can still press the button to turn it on and off! However, the toilet paper roll moves around itself, so you also need to attach it at a suitable point of your sample compartment. You'll need to measure where you want your light to go in the sample compartment, mark and cut out a place where the toilet paper roll can fit.

Sample

Now, we have to make sure that the sample is concentrated where expect the light to go. For me, I ended up using the smaller part of my bottle to hold the sample, but that meant my bottle needed to be upside down so gravity worked properly. I also needed a way to keep unwanted light out of my sample, so I used a box I packed with stationary packing materials.This kept the bottle still, but I had to cut holes in the box so the light could filter through. Additionally, the bottle ended up being a little too tall for my box, so I used another toilet paper roll with tape covering one end and some circularly cut styrofoam on the other to act as a lid around the top of the bottle. This formation had the added benefit of allowing me to remove the bottle without having to open the box. With the light successfully leaving the sample compartment, I moved onto the analyzer.

Analyzer

A proper instrument will always have a way to select the data it needs and minimize the data it doesn't need. For a spectrophotometer, this means refracting the light, which separates the different wavelengths present. When using an LED flashlight, this isn't typically necessary as there should only be one wavelength present, but it also helps to filter out any stray ambient light. This part is one of the more difficult processes as you have to position the CD in such a way that the light from the sample compartment refracts approximately 90 degrees (minimizing direct source light hitting further components of the instrument) onto the very small head of a photoresistor. I used one whole box for the analyzer portion so I could more easily position the CD, but ultimately it's not necessary to have separate boxes for the analyzer and detector. I positioned the CD so I could see the light coming out of a small hole where I removed a strip of the outer box; I initially used a small circular hole, but the light reflected too low for the photoresistor to detect. However, eventually it was successful, and I moved on to putting together the Arduino board.

Step 2: Setting Up the Arduino Board

IMG_6187.JPG
IMG_6196.JPG
IMG_6197.JPG

Circuit Diagram

You can set up the circuitboard for the Arduino following the instructions in this link if you are already familiar with circuitry diagrams, but don't include the part of the circuit with the LED and 220 Ohm resistor. If not, I am also providing step-by-step instructions.

Main Circuit

Following the main circuit, you will need to attach a wire from the 5V power supply on the Arduino board to a positive (+) circuit on either side of the board. This allows you to attach other wires to this line to supply power. Attach another wire from the positive (+) line to one of the middle sections of the breadboard, and in that same section insert one side of the photoresistor. The other side can be inserted in a different numbered line where you will have one side of a 10 kilo-ohm resistor. The other end of the resistor should return to ground (-) either directly on the breadboard or through another wire. This completes the circuit but doesn't allow us to read any data, so we need to add something.

Voltage Reader

The Arduino uses both digital and analog signals, but for this project, analog is enough. From the A0 port on your Arduino board, connect a wire to the numbered line that contains both your resistor and your photoresistor. This allows the analog reading of voltage, and when used in conjunction with the sketch on the next page, allows the conversion of data points into a calibration curve

Step 3: the Arduino Software

Software:

You can get the Arduino software for free here. There is a downloadable version (which I use) and a web editor which typically works just as well. This allows you to interface with the Arduino microcontroller.

Sketch:

/*

This sketch was modified from the SparkFun Inventor's Kit Example sketch 07. SparkFun Electronics can be found at this website.

We use this sketch to determine how much light a photoresistor is receiving. When a photoresistor is exposed to light, the circuit's resistance increases, and vice versa for dark environments. Because of this, we can measure the difference in signal for samples that let various amounts of light through

*/

// As usual, we'll create constants to name the pins we're using.

// This will make it easier to follow the code below.

const int sensorPin = 0;

// We'll also set up some global variables for the light level a calibration value

//and a raw light value

int lightCal;

int lightVal;

int readingNumber = 0; //sets the first reading value to zero

void setup()

{

lightCal = analogRead(sensorPin);

//we will take a single reading from the light sensor and store it in the lightCal

//variable. This will give us a prelinary value to compare against in the loop

Serial.begin(9600); //initializes serial port with baud rate of 9600

//baud rate is a way of confirming that the send rate equals the receive rate

Serial.println("Serial is initialized"); // verify that it does something

Serial.print("Initial light reading: "); //verify the initial reading

Serial.println(lightCal);

//adds the lightCal reading after the previous colon

Serial.println("ReadingNumber,LightValue"); //Headers for the data that will be collected, CSV

}

void loop()

{

//Take a reading using analogRead() on sensor pin and store it in lightVal

lightVal = analogRead(sensorPin);

Serial.print(readingNumber); //prints the reading number to the serial monitor

Serial.print(" , "); //prints a comma in the serial monitor to aid in CSV data collection

Serial.println(lightVal); //prints the current photoresistor values

readingNumber++; //shorthand of saying new variable = previous variable +1

delay(1000); //sets data collection sampling rate to 1 second

//if lightVal is less than our initial reading (lightCal) minus 50 it is dark and

//turn pin 9 HIGH. The (-50) part of the statement sets the sensitivity. The smaller

//the number the more sensitive the circuit will be to variances in light.

if (lightVal < lightCal - 50)

{

digitalWrite(9, HIGH);

}

//else, it is bright, turn pin 9 LOW

else

{

digitalWrite(9, LOW);

}

}

Step 4: Taking Measurements

IMG_6198.JPG

Now you're all set up to take measurements. For my trial, I steeped tea for varying amounts of time (0 seconds, 30 seconds, 60 seconds, etc. up to 4 minutes) in a consistent amount of boiling water (1 cup). I took samples of each of these because I didn't need an entire cup of incomplete tea, and I chose 4 minutes to be the longest time because it was double the recommended time on the box (2 minutes).

Make sure you the Arduino program open with the provided sketch copied and pasted inside. Upload and compile the code, then open the serial monitor under tools. A new window should pop up with lines saying (x , y) where x is the intervals since starting the monitor and y is the measured voltage from 0 - 1023, which is the raw analog data. This can be further converted to actual voltage, but for our purposes the raw data is fine. For each steeping time, collect at least one data point and write it down.

In Google Sheets or Microsoft Excel, graph the steep time on the x-axis and the raw data on the y-axis. The steep time should be inversely proportional to the observed voltage due to an increase in concentration perpetuating a decrease in light passing through the sample. If the data produce a linear function, you can also apply your readings of other samples and figure out how long they have been steeped.