Creating a colorimeter with Scratch
Posted: Sun Apr 24, 2016 1:34 am
I recently incorporated instrument design into my upper level college Chemistry course. I have the students build a colorimeter that can be used to determine the concentration of red food coloring in beverages. Previously, the students used a multimeter as the display, but this year I wanted to give them an idea of what it would take to interface their instrument to a computer.
It turned out that Raspberry Pi with Scratch was a perfect fit.
I've provided some commentary on my website but it is short on details. The circuit design is identical to my article published in the MagPi issue 24 (grab the Word Document from github if you'd like) and I've added a 3D printed cuvette holder to block the light (my students found that the holder needs to do a better job).
The scratch program consists of two routines, one to toggle the LED (source) on and off and one to read a measurement from the detector. Since we don't have an easy way to read analog signals on the RPi, I'm using the ideas from Adafruit on making resistor based measurements using an RC circuit. I simply converted their Python code into a Scratch code block.
My students had zero experience in programming and only one of them had ever built a circuit before. Over three lab periods, the students learned the basics of Scratch, circuit design, instrument design and developed a system to measure (reasonably correctly, as it turns out) the food coloring in beverages of their choice. I owe the efficiency of the content delivery to:
[*]The ability to create multiple identical Raspberry Pi configurations by copying the SD card
[*]The ability to "teach" programming without having to delve into syntax, formatting and punctuation
[*]The RPi version of Scratch and its ability to interact with the GPIO pins on the RPi.
Below are a few pictures, an example screenshot of the code a student designed and a sample instrument.


It turned out that Raspberry Pi with Scratch was a perfect fit.
I've provided some commentary on my website but it is short on details. The circuit design is identical to my article published in the MagPi issue 24 (grab the Word Document from github if you'd like) and I've added a 3D printed cuvette holder to block the light (my students found that the holder needs to do a better job).
The scratch program consists of two routines, one to toggle the LED (source) on and off and one to read a measurement from the detector. Since we don't have an easy way to read analog signals on the RPi, I'm using the ideas from Adafruit on making resistor based measurements using an RC circuit. I simply converted their Python code into a Scratch code block.
My students had zero experience in programming and only one of them had ever built a circuit before. Over three lab periods, the students learned the basics of Scratch, circuit design, instrument design and developed a system to measure (reasonably correctly, as it turns out) the food coloring in beverages of their choice. I owe the efficiency of the content delivery to:
[*]The ability to create multiple identical Raspberry Pi configurations by copying the SD card
[*]The ability to "teach" programming without having to delve into syntax, formatting and punctuation
[*]The RPi version of Scratch and its ability to interact with the GPIO pins on the RPi.
Below are a few pictures, an example screenshot of the code a student designed and a sample instrument.

