You are on page 1of 7

How to build your own scientific instrument using

Arduino

by Reese Gallagher

Introduction:

This paper gives a quick overview of the skills, materials, and planning
needed to build a simple proof-of-concept scientific instrument. Along
the way I document my experience building a spectrophotometer and
discuss the trials and learning associated with that. Finally I hope to
convince you that anyone can build a simple instrument as long as you
are willing to tinker for about two weeks.

Part One: starting out

The skills you need:

Almost as indispensible as the materials are the skills you actually


need. If you are now thinking to yourself that building an instrument
sounds cool but involves way more expertise than you have dont
worry. The main reason why this type of project seems daunting is
because you probably think you need a specialized set of skills. The
chances are however, the skills you think you needyou really dont.
For example

The skills you think you need


C programming
A good knowledge of operational amplifiers
An above average knowledge of electrical engineering
Circuit design skills
Intermediate applications of physics concepts such as
impedance
Confidence in your calculations
How to use fancy specialized equipment (e.g. Oscilloscope)

The skills you actually need


How to use this equation: V = IR
Copy and paste
How to use Google
How to turn a circuit diagram into reality
That last bullet point may be the only one you really have to learn, but
all you have to do is start simple and then expand. The fact is
whatever you are trying to do: its already been done before and there
is probably heavy documentation on how to do it. Even more so now
than ever before because the Arduino network is so user friendly and
ubiquitous that someone with a very limited knowledge of electronics
can get something to work in a few hours without even fully knowing
how it works. Therefore the skills you actually need are pretty easy to
come by these days.

Here are a few additional (but not necessary) skills that can help make
a project better:

Truly understanding the voltage divider equation (deriving it from


ohms law helps, also Google voltage divider equation)
Having a soldering Iron and knowing how to use it (soldering
irons are as cheap as $10)
A simple understanding of how a transistor can be a switch
Simple calculations like R (resistance) and C (capacitance)
equivalency, which also implies you have brushed up on your
understanding of series and parallel
Also its not a skill but get a hot glue gun ~$5 with sticks (will be
the best $5 youve ever spent)
How not to put your component in backwards (i.e. transistors,
diodes, LEDs, especially electrolytic capacitors!)

Planning:

I want to keep this section short because what you intend to build is
completely up to you. Just keep in mind the expense of the
materials that you will need. Also drawing circuit diagrams and raw
pictures can be really helpful because they act as templates to
further build your ideas off of. In addition they make for good
documentation.

Materials:

These are the main things you need:


An Arduino
A breadboard with jumper wires
An LED and resistor to practice building a simple circuit
The Arduino programming environment (free on the website)
Materials specific to your project*

*A word of caution: if you are going to use a DC motor (or other large
motor) be sure there is a resistor, a diode, and a transistor involved.
Even if you dont know how they are precisely working you need them.
There are specific examples with the Arduino controlling motors; copy
their stuff first before attempting to build your own circuit.

A second word of caution: if you are going to use a motor (or any
device that will draw a lot of current) consider having a second voltage
source. All grounds should be the same, but a voltage source can be
different than the Arduinos 5V or 3V. This is for two reasons:

1. The Arduino can only supply so much current without things going
horribly wrong. Also consider that the Arduino is probably hooked up to
your computer!

2. If you are going to be doing an analogRead the resolution can


seriously be tampered with if say a motor is on the same voltage
source.

For now these are all the warnings and suggestions I have. From here
on out your best friend is Google and YouTube.

Part two: my example building a spectrophotometer

Here is the general idea behind a spectrophotometer. Having a general


diagram like this helps with constructing your own instrument.

Specifically in my project I used a flashlight (tungsten filament) as a


source. The entrance slit is a piece of cardboard from a toilet paper
roll. The Dispersion device is a cut up CD rom on a servo motor to
move the diffracted light. For the slit I used two razor blades. For the
sample holder I used an actual cuvette. For the detector I used a
photoresistor (it changes resistance with light intensity). Additionally I
used a cheap mini magnifying glass to focus the light. Below is a circuit
diagram I drew which includes everything except for the flashlight
which is powered by two AA batteries.

Explaining the circuit diagram:

Pin 8 on the Arduino is connected in between the button and a 10K


resistor (this is in essence a simple voltage divider). Analog pin 0 which
will read the light intensity is connected in between a 10K and the
photoresistor (a really obvious voltage divider). Note it matters the
order that the 10K and the photoresistor are in because of the voltage
divider equation. For example in my project I wanted to directly
measure transmittance and so I needed the numbers from the analog
read to increase with intensity; the opposite happens if the resistor and
photoresistor are switched (It has to do with the voltage divider
equation!). Pin 10 is connected to an LED (which indicates when the
motor is in motion). Finally pin 9 controls the servo motor. Notice that a
separate 5V source is controlling the motor yet everything is
connected to the same ground (refer to reasons 1 and 2 under a
second word of caution).

Soldering, hot glue, and a lot of ghetto rigging later and Bobs your
uncle.
Note that in the last picture I built what is commonly known as a
protoshield. Its a step above a breadboard because its a permanent
soldering job. You cant see it but there are pins on the other side of
the board that plug into the Arduino. This is useful because Arduino
projects are not meant to be permanent (also you cant solder to the
Arduino anyway). In fact the Arduino microcontroller is specifically
under the category development board. The Fact that I built a
protoshield was so that the Arduino could easily be removed and put
back in at a later time. In your project simply leaving the wires in a
breadboard will suffice (just know that at some point you will take
apart those wires and if you want to rebuild your project you have to
rebuild everything from scratch).

Coding:

I could copy and paste the exact code I used for this project however
that wouldnt do any good. For one it is not immediately
understandable, secondly it wont teach you anything anyway. The
Coding for your project is literally all about finding a similar code on
the web (usually from the Arduino site directly) and pasting it into the
Arduino IDE (where you would paste your code). You may have to
tweak it a bit before it does what you want it to. The important part
isnt that its beautiful code but rather if it does exactly (or close
enough to) what you want. Trust me when I say Im not a coder so
dont feel discouraged if youve never coded before. If you know how
to Google search and copy/paste youll be fine.
If it works:

Its incredibly rewarding to build something that works, but the cool
thing is that you can actually use it multiple times thereafter. Here are
some spectra that Ive taken from my instrument.
Final Words:

If theres anything I can say that would sum up what building this
project has taught me its that you shouldnt underestimate your
abilities as long as you are persistent. Building an instrument can be
daunting but let me tell you the Arduino microcontroller is super user
friendly and there are tons of resources on the interwebs.

You might also like