What is a Loop Detector?
Returning to the problem for this chapter, you are asked to build a loop detector. It would probably help if you knew what one was. These are the most common sen- sors that are buried in the road to detect the presence of an automobile in a particu- lar location. They are frequently used at traffic lights to detect if a car is waiting for the light to change. But they are also used on highways to gather data on conges- tion.
The principle is fairly simple. A coil of wire is buried in the road. A car passing over the coil interacts with the magnetic field, which slightly modifies the induc- tance. An electronic circuit detects this change. You may have noticed cuts in a road which were made to insert a loop detector.
For your inductor, you should wind 100 turns of 28 gauge magnet wire in an approximately 1” diameter loop. (A paper towel or toilet paper tube makes a good form for winding around.) Magnet wire uses a lacquer coating for insulation, which you will have to carefully scrape off the ends to make contact. This should give you an inductor with a value of approximately 1/2mH.
While you could use a simple R-L circuit, similar to the last lab, to measure the inductance, we would like you to use the L-C circuit shown below. A Stamp I/O pin is used to provide current to the L-C circuit. Set this pin to 5V for some time period, waiting for everything to settle out. This will result in some current flow through the inductor, but no voltage across the capacitor. Next, set this pin to an input. That has the same effect as disconnecting it. This will allow the L-C circuit to oscillate. The comparator will amplify these oscillations into valid logic levels. (Be sure to run the comparator off of the 5V supply this time to avoid protection circuits!) These can then be timed to get a relative measure of the change in inductance.
There is some simple analysis you can do on this circuit to understand its behavior. With the Stamp output delivering 5V for a long time, the current through the induc- tor should be 5mA. (Recall that in the long term, the inductor looks like a short!) Disconnecting this pin (by setting it to an input) leaves the L-C circuit hanging off of a voltage divider. The voltage at the divider will be 5/3V, and the other end of the L-C circuit will oscillate up and down relative to this. With all the energy initially
stored in the inductor, E = 1/2 LI2 = 6.25x10-9 joules. When this moves to the capacitor, it will generate a voltage:
Of course, with nonideal components, there will be losses, so this will quickly dis- sipate.
You should also calculate the period of the oscillation. This will be about 140µs. With 2µs timing resolution on the Stamp, you should be able to detect inductance changes on the order of 2%. This should be sufficient to detect a steel block placed on top of the inductor.
Stamp +5V L 1µf 2kΩ 1kΩ V 2E C --- 2 6.25 9 – ×10 × 1×10–6 ---≈0.1V = =
A Pragmatic Introduction to the Art of Electrical Engineering
85
What’s Next?
What’s Next?
Up until now, all of our circuits have been battery powered. And as you may have noticed, batteries do eventually go dead. Wouldn’t it be nice to be able to power your circuits from a standard 110V AC power line?
In the next chapter we will be exploring exactly that issue - how do you generate a 5V power supply from 110V AC? We will do this in several steps, and along the way, introduce some new components. This will include specially made inductor pairs which share a common magnetic field. These are called transformers. We will also be revisiting diodes and capacitors. So you may want to review your under- standing of those elements.
The Problem
Batteries are an incredibly expensive source of power. In 1998, electric utilities in the United States charge between 5 and 20 cents per kilowatt-hour. On the other hand, you would be hard pressed to find a 9V battery that could put out a watt for much more than an hour. And they cost a great deal more than 20 cents. Power out of the wall socket is at least several orders of magnitude cheaper than buying batter- ies.
Given this economic reality, we would like to be able to power our 5V circuitry from a standard 110VAC wall outlet. (Standard, at least, in the U.S.) But connecting the Stamp to such a high voltage produces only a momentarily spectacular display, ending with a depressing puff of smoke. How does one efficiently convert 110VAC to a suitable 5V supply?
Your goal for this chapter is to build an isolated, regulated, linear 5V power supply, which runs off of 110 VAC. Not only will this eliminate the need for batteries, but it has the side benefit of delivering significantly more current than the Stamp’s on- board 5V regulator which was limited to 50mA. This will allow you to use higher current devices such as relays, light bulbs, etc.
A Pragmatic Introduction to the Art of Electrical Engineering
87
What You Need to Know
What You Need to Know
In order to solve this problem, here are some things you need to know: