Thursday, June 5, 2014

A Crash Course in Basic Circuitry: How Flashlights Work

This post is all about the flashlight and uses it as an introduction to circuit terminology and some common conventions. For full comprehension, I recommend reading the whole article, but in the spirit of keeping it brief, here is how a flashlight works:


Cut to the Chase


When you put a battery or two into the end of your flashlight, you are completing a circuit that contains a switch, the lightbulb, and the batteries themselves. The energy in the batteries goes almost exclusively to the heating of the tungsten filament (in incandescent light bulbs) or mercury vapor (in fluorescent light bulbs); the purpose of the wire connecting all of the elements is to use up as little of the energy in the battery (or batteries) as possible. The switch and the battery are quite common to circuit drawings, called 'schematics', and have their own exclusive symbols (battery at left, switch at right). A light bulb falls under the umbrella term of 'resistor', which is represented by the squiggle in the middle, but since a light bulb is a very common form of resistor it also has its own symbol (the loop enclosed in a circle in the center).
When the flash light is off, the switch has not connected the two wire ends, which means the circuit is 'open' (the symbol above depicts a switch in the open position, as it's disconnecting the lines). When the switch is flipped, it connects the two ends of the wire, completing the circuit and lighting the lightbulb!
_________________________________________________________________________________


Digging Deeper


It doesn't do much good to know what's going on with inventions on the outside if we don't understand what's happening on the inside. Believe it or not, we can explain the functionality of a flashlight by analyzing one simple 'loop', or circuit. There are three basic electronic pieces (also called 'elements') that make up a flashlight circuit: the light bulb, the battery (or batteries), and the switch. 

These are all very common items to find in many different electric circuits. Because they are so common, a group of simple symbols was established to represent them so that circuit drawings (often called 'schematics') could be done more quickly and ideas communicated much faster.


A combination of these three circuit elements connected by lines representing electrical wires gives us the basic circuit schematic for a flashlight:

Source: http://bingo.cdyn.com/techno/readschem/flashlight.html

Some En-light-ening Elaboration: 

The Battery

At left, we have the symbol for a battery. Batteries might appear in any given circuit in more than one place, but in basic circuitry there will always be at least one. The longer line denotes the positively charged end of the battery, therefore the shorter line represents the negative end. Batteries are one of the most common ways that energy will flow through a circuit. In other words, if you have a flashlight, phone, laptop, car, etc. that doesn't have a battery inside it, it won't turn on. This is because energy that powers circuits is stored within batteries. The energy itself comes from a combination of chemical compounds or ions; when the reactions that occur within the battery reach equilibrium, the battery becomes 'dead' and must be switched out. (Check out this link for more information on different battery types!) Batteries can be thought of like a pump; they take electrons whose energy has been depleted from going through a circuit and replenish their energy to send them through again, just like a water pump shoots the same water repeatedly through a fountain.

If batteries are the pump in our analogy, then current is like water. The energy in the electrons that constitute the current is transferred to the light bulb when the electrons flow through the metal filament in the middle, leaving them in a low energy state before the battery 'pumps' them up again and they repeat the cycle. This can be thought of like a pump raising water above a water wheel, which then falls on the paddles to spin the wheel. Since the water has lost its height, it can't turn the water wheel, and must be again raised by the pump to repeat the cycle.

A convention among engineers mandates that current flows out of the positive end (called a 'terminal') of the battery, through all of the elements of a circuit, and back into the negative terminal; this is how the direction of the current in the diagram below was selected.

This represents a flashlight that is turned on, seen by the switch connecting both ends of the orange wire.

The Resistor

In the middle, we have the symbol for a resistor. The purpose of a resistor is to dissipate the energy flowing through the circuit in a useful way. The light bulb is an example of a resistor; it uses energy from the electrons to heat a tungsten filament (or mercury vapor, in fluorescent bulbs) which then releases the energy in heat  and light. The light bulb is a very common resistor and is very useful, which is why it has its own symbol. Other examples of resistors include stove-top elements, the glowing elements in a toaster, and hair curling irons. As a general rule: if an appliance gets warm when you plug it in, a resistor is at work dissipating energy as heat.


The Switch

On the right, we have the symbol for a switch. The pictured symbol is more specifically an open switch; a closed switch would simply connect the two dots in a straight line. The purpose of the switch is to control when the circuit is on ('live' or 'closed loop') or off ('dead' or 'open loop'). Current cannot flow through wires unless there is a continuous path, called a 'closed loop'. In the case of a flashlight: if the switch is open the circuit is called an 'open loop'; nothing will happen until the switch closes and completes the circuit. This is why your flashlight only turns on when you flip the switch a certain direction. When you flip it back, you're disconnecting the wires, creating an open loop, and turning off the circuit.

Another way to turn flashlights on and off is to rotate the part of the flashlight that contains the light bulb. This in itself is a switch! As you turn it to the left, the threads in the flashlight act like loosening a screw and the light bulb stops touching the battery, which creates an open loop and turns your flashlight off. Conversely, when you turn it clockwise, you are decreasing the distance between the light bulb and the battery--eventually they will touch and form a closed-loop circuit, which turns the flashlight on.
_________________________________________________________________________________

Thank you for reading! If you have any questions or comments about what I've covered here (or any ideas as to what I should cover next), feel free to post a comment below! Alternatively, send me an email at nghagler@ucdavis.edu and include 'Blog' in the subject line to let me know what you think. Thanks!

Thursday, May 29, 2014

The Magic of Magnetic Strips: Credit Card 101

In this example of commonplace electricity and magnetism applications, we have:

(Source: http://sayanythingblog.com/entry/price-caps-on-swipe
-fees-making-your-banking-more-expensive/)

Have you ever wondered how a credit card can keep track of the entirety of your financial life? Probably not. In 2012, about 26.2 billion credit card transactions and 47.0 debit card transactions were completed, with an overall non-cash transfer value* estimated at $79.0 trillion [1]. The average American held 1.96 active bankcards in 2012 [2], which has since increased to 2.19 in 2013 [3]. It is easy to see that most of us take credit cards for granted. 

*Note: this figure DOES include check transactions.

Cut to the Chase

The back of your credit card has a stripe on it, called a magnetic strip, which is filled with magnets of different strengths that represent 217 alphanumeric characters. These magnets identify your card and provide a variety of security features to protect your account [4]. When the card is scanned, the computer reads the security information and gains access to your account to deduct the proper amount of funds and complete your transaction.

The act of scanning the card is where the physics comes in. Credit card scanners also make use of induction, a phenomenon discussed in my earlier article about traffic light sensors. Faraday's Law describes the physical phenomenon by which credit cards work: a change of magnetic flux over a time interval induces a charge in a wire circuit. To further explain: the different strengths of magnets on the card cause a stronger or weaker voltage and current to travel through the wire. The voltage in the wire causes current to flow in the direction opposite of the card swipe. This resultant current is unique to every card because it reflects the sequence of magnets in the strip.
_________________________________________________________________________________

 A Bit More Detail...

The single most handy part of that piece of plastic that you take for granted is on the back; it's the strip that runs across the top of your card and might be silver or black. This is a magnetic strip, sometimes called a 'magstrip' for short. This space on your card is covered in tiny, iron-based magnets that make up three different sequences of information. The magstrip itself is divided into 3 distinct length-wise partitions called 'tracks', all of which are filled with identifying information about you and your bank account. 

The first track encodes a maximum of 76 alphanumeric digits constituting your account number, your name, your card's expiration date and security code, and some other security data specific to your card and account. The second track, with a maximum of 37 alphanumeric digits, contains more card security information, and the third track with 104 numeric characters contains information on your country and location, credit limit, and other miscellaneous card security features and codes. [4]

Magnetic strip technology works almost identically to the way in which a cassette tape is read: a moving magnetized source passes over the front of an electromagnet which then reads the data. The key here is movement. Magstrip card readers (and cassette tape readers) rely on induction to operate, which requires a change in magnetic field strength over time. The formal denotation of this is Faraday's Law, which reads as follows:
                                          

The Greek letter epsilon stands for emf--short for electromotive force--which is like a battery's voltage. The Greek letter phi in the equation signifies magnetic flux, which is discussed here, and the d/dt piece of the equation communicates that the emf/voltage changes as the quantity in the numerator (here it is phi) changes over time. Altogether, Faraday's Law outlines how a voltage can be generated from a magnetic source: the amount of flux must change with time.

Faraday's Law singlehandedly explains two important observations about the process of swiping a card:
1. The card must be moved across a sensor. This is because, as we just stated, the voltage in the wire circuitry of the card reader occurs because of a change in flux. If the credit card was statically held in the slot over the sensor, there is no change of flux because the same magnets are held over the sensor for extended periods of time. Once we slide the magnet through the slot, the different strengths of magnets within the magstrip pass over the electromagnet and generate a sequence of varying voltage strengths that are specific to your credit card.

2. The magnets have to be of different strengths for optimal combinations allowed (different patterns of flux change) All of those 217 alphanumeric digits in the three tracks within the magstrip that identify your card would not be possible if the magnets were all the same strength. To take an extreme example: let's say the magstrip is one continuous bar magnet that spans the length of the card. When scanned, two changes in flux would occur: an increase when the first end of the strip begins to pass over the card (change from reading air to reading magnet) and a decrease when the end of the strip passes over the magnet (change from reading magnet to reading air). There would be effectively no change in between because in our example, the same strength of magnet is read the entire time. How many different credit cards could be made with that pattern? Not very many. Having a large amount of small magnets of varying strengths drastically increases the number of different possible combinations.

A Bonus Question!

How do magnets 'erase' credit cards? What is it erasing?

The fact that magnets erase credit cards might (hopefully) be making more sense since we started this journey into the workings of magstrips.

We know that, on a basic level, the strip on the back of your credit card contains many small magnets. What happens when you put two magnets next to each other? They either attract or repel. Have you ever tried to push two repelling magnets together or hold two attracting magnets apart from each other at a very small distance? It's very hard to do, if not impossible! Those forces that your hands feel when you hold the magnets are the same forces that the magnetic particles feel when you put a magnet close enough to them. To some extent, you can control your hand because you have muscles that can exert a force to oppose the magnetic pull. The magnetic particles can do no such thing, and thus are relatively easy to move.

This is a big problem for the functionality of your credit card! Your card's electronic identity is precisely determined by the location of the magnets; the scanner generates a voltage and current sequence based on that pattern. Once you move some of those magnets around, you no longer have the same pattern (i.e. your pattern has been 'erased'). The generated voltage sequence does not match up to your correct information, which is why you can't process a transaction on your card.
_________________________________________________________________________________

Thank you for reading! If you have any questions or comments about what I've covered here (or any ideas as to what I should cover next), feel free to post a comment below! Alternatively, send me an email at nghagler@ucdavis.edu and include 'Blog' in the subject line to let me know what you think. Thanks!

Monday, May 12, 2014

Red Light, Green Light: The Science of Stoplights

Here's a classic example of electricity and magnetism principles at work:
(Source: Joey Rozier, http://mrjoro.org/blog/2005/01/photographic-frustration.html)

Have you ever wondered how stoplights sometimes seem to change in your favor just as you drive up to them? The answer lies in a particularly useful electromagnetic device called an inductor

Cut to the Chase

Underneath the asphalt roadbed lies a wire; it may be shaped in a rectangle, parallelogram, octagon, or any other shape with opposing parallel sides. The ends of this wire connect through pipe channels in the ground to the grey box that can be found next to any stop light; this forms a closed-loop circuit. When your car's steel chassis is over the loop in the road, the metal in the chassis disturbs the 'status quo' of the magnetic field surrounding the wire loop in the road. 

In other words, before your car approached the light there was a magnetic field of a certain value, and the sensor detecting the current flowing through the wire in the road was accustomed to that state. However, in driving up to the light you're changing the environment of the loop. The current within the wire reacts to that change through the fundamental law of physics known as Faraday's Law. This altered current that was spawned as a reaction to your car driving up travels through the wires to the sensor in the grey box, which then prompts the light to change and allows you to go on your way.

A Longer Explanation

Introduction to Inductors

An inductor is a coil of wire centered around a core. The core can be either magnetic (ferrous) or non-magnetic (nonferrous)--this includes air! Inductors are commonly either cylindrical or toroidal in shape--imagine a donut with wires wrapped around it (in this case, the edible part of the donut is the core). The wire may have space in between each revolution or be wound tightly adjacent to each other. The inductor must be wired into a circuit in order for electrical current can flow through an entire loop.

What do inductors do?

The chief behavior of an inductor is to oppose any change to the magnetic field that surrounds it by generating a 'voltage' like a battery. The field can be quantified in terms of the magnetic flux, which is a product of the strength of the magnetic field in the core region and the area of the wire loop encircling it. This concept is called Faraday's Law, after its creator, Michael Faraday, the British chemist and physicist. Magnetic flux can be described as a density of field lines inside the wire loop; a low number of field lines inside an area corresponds to a low magnetic flux, while conversely a tight packing of field lines within the same area is a high magnetic flux.
_________________________________________________________________________________

Let's deconstruct the effects of Faraday's Law. Think of each magnetic field line as a pool noodle, and imagine that you want to fit as many noodles as you can through a hula hoop. The easiest way to accomplish this task would be to hold the hula hoop perpendicular to the pool noodles so that the biggest possible area can be filled with pool noodles.

 Now imagine holding the hula hoop slanted, at an angle from vertical, but trying to still fit horizontal pool noodles through it. You won't be able to fit as many through because the effective cross-sectional area of the loop has shrunk! This example represents a decrease in magnetic flux; you still have the same number of pool noodles as before (i.e. the strength of the magnetic field is the same) but your hula hoop has effectively decreased in size and therefore can't fit as many noodles through it (i.e. the cross-sectional area of the loop has decreased).

There's one more aspect of inductance that is extremely important to consider: inductors depend on a change in magnetic flux to operate. In other words: if you had the same number of pool noodles within your hula hoop the entire time, to an inductor it would be equivalent to having no pool noodles inside the hoop the entire time. In order for inductance to work, the number of field lines within a loop has to change over time. In the first example, we kept the location of the field lines/pool noodles the same and changed the dimensions of the area we used to contain them. In the second example below, we will keep the size and location of the area/hula hoop the same and change the position of the field lines to acheive the same effect: a change in magnetic flux.

Here's a similar example, using field line location as the independent variable: If you place the hula hoop on the ground, hug a bunch of pool noodles, and run over the hula hoop while recording the whole thing with a video camera, you could pick out the frame where all the pool noodles you were holding were completely inside the loop. That instant in time corresponds to the greatest magnetic flux because the biggest number of pool noodles were inside the hula hoop. If you watched your video in slow motion, you could see increasingly more of your armful of pool noodles fitting into the loop until the moment that they were all inside.
_________________________________________________________________________________

They say good things come in threes....here, have a third example! Now, we are going to keep the position of our loop (the hula hoop) and our field lines (the pool noodles) the same the whole time. The element of change here is going to come from an increase or decrease in the amount of pool noodles you're holding in your arms. You stand inside the hula hoop on the ground and hold a couple of pool noodles vertically. Your trusty buddy whom you've recruited to help you explore physics has the rest of the pool noodles from before, and hands them to you one by one.

By the time they hand your the last noodle, your arms are stretched from holding all the pool noodles! As you have increased the number of pool noodles that you're holding, you've been increasing the magnetic flux through our hula hoop loop (like the analogy to magnetic flux being a 'density' of magnetic field lines). If you were to start the test initially holding all the pool noodles and giving them to your friend, you would be decreasing the magnetic flux through the loop.

These three examples, although somewhat silly, illustrate the necessity for some quantity to be changing in order for Faraday's Law--the principle governing the prompt response of stop lights--to act.

That's all fine, but how does this relate to cars?

When your car pulls up to a red light, it passes over a wire loop embedded within the road's surface, which is the equivalent of our hula hoop, to continue the analogy. There may be 1 or more turns (revolutions) in the wire loop which increases the strength of response by an amount proportional to how many turns exist in the loop. In other words, if you double the number of turns in the loop, you will double the change in magnetic flux as a result of any given magnetic field/area combination.

Here's how you know there's a loop in the road underneath you!
(Source: http://modernvespa.com/forum/wiki-trafficsignals)

Now, your car has a metal chassis, which makes it a good conductor of electricity. The ability of this electrical conductor to affect the magnetic field around the loop is equivalent to the number of pool noodles you can hug as you run across your backyard over your hula hoop. When there is no car over the loop in the road, the inductance is a baseline value. The gray box (often visible next to many stoplights) contains a sensor that reads the current through the loop in the road; it becomes accustomed to the current resulting from that baseline level of inductance. However, the sensor in the gray box is always testing the loop to see if the inductance changes. When your car pulls up to the light, the amount of field lines in the loop changes--it increases by a lot! The sensor no longer reads a baseline level of inductance; the addition of field lines caused by the addition of the car means that the inductance is now much higher. Once the sensor detects that difference, the computer in the grey box tells the light to change the signal, and off you go on your way.

Thanks for reading! If you have any questions or comments about what I've covered here (or any ideas as to what I should cover next), feel free to post a comment below! Alternatively, send me an email at nghagler@ucdavis.edu and include 'Blog' in the subject line to tell me what you think!

References
http://auto.howstuffworks.com/car-driving-safety/safety-regulatory-devices/question234.htm
https://www.youtube.com/watch?v=KvzJn09DqaM#t=376
http://modernvespa.com/forum/wiki-trafficsignals
http://www.ehow.com/about_5113181_metal-magnetic.html
Sears and Zemansky's University Physics, 13th edition

Wednesday, April 16, 2014

An Introduction

Hello, blog reader! This is my first foray into the Blogosphere, and I hope you enjoy what I will put forth in these next 8 or so weeks! I'm a second-year undergraduate student at UC Davis studying Mechanical Engineering, and I set up this blog as a sort of class project. Every week, I will select two inventions that are extremely common in modern life and write a post about each of them detailing how they work! My goal with this project is that you, the reader, learn something new or appreciate technology from a different perspective, or ideally you can brag to your friends that you know all about how credit cards work. Do you want to learn about how stuff works? Great, let's go!