# First Arduino Steps – Selecting Resistors

Today, I learned about Arduino and I am amazed, again. I learned about circuits at the very beginning. After that we connected our simple circuit to an Arduino Leonardo and then we played around with analog and digital I/O. While programming for that little device is nothing extraordinary, learning about circuits (especially resistors and why we need them) is – at least for me. Here’s what caught my attention in particular.First of all I learned that all electricity flows from ground to the source (5V in our case). Then I learned that, allthough we need resistors to protect an LED, it is not necessary to place the resistors before the LED. It can also be placed afterwards. Then I learned about how to calculate which resistor is needed in a circuit with an LED.

## Select the right resistor for a simple LED Circuit

We need to know three things: How many mA (milliampere) does the LED want (15-20 I was told) and how many V does the LED tolerate (there’s a list telling us about – our red one tolerates 2V. Finally you want to know how many Volts go into your circuit (that depends on the powersupply – ours emits 5V. Keeping R = U/I in mind leads to this very simple equation: R = (5-2)/(20/1000) – solving it will tell us that we need a 333Ω resistor. Using anything else might result in a damaged LED.

Now we need to select a resistor. While we could test the resistor with a multimeter, we can also read the rings. Select the right one, place it somewhere in the circuit, connect a power supply. Done. Your LED will glow.

How about two LEDs? Well it’s very simple once you realize that the Voltage consumption in the whole circuit must equal the voltage of the powersupply. Let’s say we want two red LEDs, that would consume 4 Volts (2V + 2V). So our equation is now R = (5-2-2)/(20/1000) – 111Ω. It’s simple as that.

## Select the right resistor for a simple thermistor circuit

A thermistor is a variable resistor. Its resistance varies depending on the head imposed on the thermistor. A thermistor should come with a data sheet telling you the resistance it has depending on the temperature its surrounding has.

We want to determine temperatures between -5°C and +30°C with our thermistor and the data sheet tells us, that the minimum resistance would be 306000Ω and the maximum resistance would be 39710Ω. So we need to know which resistor we need in order to not blow our circuit. Here the Axel Benz Formula comes in handy!

The Axel Benz Formula easily tells you the right resistor for your circuit. R(Ref) = √(R(min)*R(max)) – So In our case we need R(Ref) = √(39710Ω*306000Ω) = 110232Ω – That means that in our circuit we must somewhere place 110232 resistor if we don’t want to harm the parts.

Also we learned about a potentiometer which does not change the resistance in a circuit but rather moves it to before or after the potentiometer.

I created a circuit using 3 potentiometers, a multi color LED and an Arduino Leonardo to practice. The wiring diagram and the Arduino Sketch are attached to this post. The wiring diagram was created using a very cool piece of software: Fritzing!

Those were my very first steps in electronics and Arduino. I’ll get more into it, that’s for sure!