13 Feb 2017, 13:13

# What You Could Do In An Hour: Teach Basic Circuit Theory So It Will Be Remembered

If your introduction to circuit theory was anything like mine, the main thing you remember about it was what a major snoozefest it was. My lessons registered as ‘desiccated’ on the ‘dryness & Crustiness’ meter. But it doesn’t have to be that way. The low-cost Arduino Starter Kit (761-7355), although aimed at introducing people to embedded computing, is also ideal for demonstrating electrical principles in fun and inspiring ways – all that is required is a little imagination on the part of those teaching to fire up the imaginations of those being taught.

## Potential to Divide

Potential dividers are ubiquitous in real-world electronics so it is an important circuit fragment to understand. To help a beginner apprehend the idea, I want to make practical use of the potential divider rule by making a simple alarm that reminds me to water my plants.

The idea that we are trying to demonstrate is simple: that whatever input voltage (Vin) we apply to the circuit, we will get a fixed fraction of that voltage at the output Vout:

As there is no load on the output (i.e. there isn’t anything connected across the output) the current (I) will be the same through both R1 and R2. We can work out this current with equation (1), which applies Ohms’s law to R1 and R2 simultaneously (i.e. we add their values and treat them as one big resistor).

Armed with that knowledge, we can work out what the output voltage will be by using the current value we just determined and applying Ohm’s law again: Vout = IR2.

We can then easily determine what fraction Vout will be of Vin by simply dividing Vout by Vin:

We are then left with a fixed fraction given by R2/(R1 + R2) to multiply by Vin to determine what Vout is going to be [shown by equation (2)].

So that’s the dry theory. Let’s see what it looks like in practice.

## Kit List

For this particular recipe, you will need:

• 1x Arduino Uno
• 1x 10KΩ resistor
• 1x LED
• 2x Galvanised nails (3”)
• 2x Long pieces of wire
• 3x jumper wires

You will find everything except the galvanised nails in the Arduino Starter Kit – though I also used some longer pieces of wire than those supplied with the kit to make sure the Arduino was comfortably separated from the possibility of accidental water spills.

## Building A Moisture Sensor

Our moisture sensor works by measuring the resistance between the two nails. When the resistance is high, there is very little moisture; when resistance is low (i.e. the conductivity is high), there is a lot of moisture.

To measure this, we simply strip the insulation on the long wires back about an inch and wrap the wire around the head of the nail. In our circuit the resistance between the two nails, when fixed in the soil of our plant pot, will become our R1.

Since the passing of the statute of Marlborough, it has been a legal requirement to have an LED included on all Arduino projects. To stay on the right side of the law, all we need to do is insert the long lead of the LED into the Arduino digital pin 13, while the short lead goes into the GND pin right next to pin 13.

## Build the Divider

This is done on the breadboard. The connector holes along the numbered rows are connected together on a breadboard so we can easily connect our circuit together as shown below:

## Program the Arduino

We then need to give our Arduino some instructions about what to do with our changing Vout signal line, which we fed into the Analog input A0. The analog to digital converter (ADC) changes our analog voltage to a digital value between 0 (0V) and 1023 (5V).

For this application, our code doesn’t need to be particularly elegant as we are dealing with a pretty slow changing measurement. All we are doing is comparing our input with a couple of fixed values that we have predetermined to be (1)Dry and (2)Very Dry. My experimentation with this gave us the values in the in the code of below 800 for dry and below 700 for very dry, which works well for my Cacti, but may need adjusting for your prize petunia.

I have included the code I wrote for this project to get you going.

## It’s All In The Presentation

If you are going to make your presentation follow the natural order, it is a good idea to start with an obviously dry plant and then add water. It is also a good idea to get your students thinking and ask them what they expect to see, before you get started. How do they expect the voltage to change as you water the plant?

Of course, if you need to, you can also artificially create ‘dryness’ by pulling one of the nails out of the soil.

## Conclusions

The Arduino Starter Kit is a great way to begin exploring electronics, right from the very basic concepts. It can make learning these concepts fun and therefore memorable. You may even find you can inspire some students who find everything boring!

Best wishes to educators everywhere.

Mark completed his Electronic Engineering degree in 1991 and went on to work in real-time digital signal processing applications engineering, later moving into technical marketing.

13 Feb 2017, 13:13

May 31, 2018 13:18

Unless you want people to learn that too much current makes LEDs burn out more quickly, you should include a current limiting resistor in series with your LED.
The Arduino UNO has 5 volt outputs, but most red LEDs are designed for 1.6 to 2.0 Vf.
A 220 ohm resistor will be sufficient (in series with the LED) to reduce the voltage and current to a value safe for the LED.

Redstone

June 1, 2018 07:55

@BradLevy You are, of course, entirely correct. For the sake of super-simplicity (in hopes of getting people to try it) and because I know both LED and Arduino will survive longer than a 20 minute demo (and we are using an extremely crude form of current-limiting PWM in flashing the LED) I have left the current limiting resistor out. In retrospect, I probably shouldn't have, as it is showing bad design rather than best practice.

TheElectronicDon

May 26, 2018 23:30

The statute of Marlborough and the requirement for an LED in every Arduino project ... Oh really ... ?