Doorknob touch alarm 28

Posted by Matthew Tue, 25 Apr 2006 10:14:00 GMT

I recently found a doorknob touch alarm schematic while browsing Discover Circuits’ archives. The project was originally intended as a present for my brother’s dorm room, but a bad capacitor and the lack of a proper oscilloscope caused delays. It has not made it off the breadboard, and it probably will not until his next semester. The circuit contains a few basic elements, an flip-flop based oscillator, a set of delays, a flip-flop as a sensor, and the audible alarm.

Close-up

The schematic

Download the schematic

Doorknob touch alarm schematic

The oscillator

The first section of the circuit is an oscillator based on a flip-flop. Clock and D are both grounded while Reset is tied high. Hence, the output Q will only be high if Set (node 6) is high. When the output is low, the transistor Q1* is cutoff. This allows *node 6 to be charged with a delay relating to the system of impedances R1*, *R2, R3*, and *C3. Once the voltage at node 6 triggers Set, the output changes to high and Q1* is opened. *Node 6 then discharges out through the capacitor. Once node 6 is low enough, Set is no longer triggered and the output is automatically reset (because R is tied high) to low and the process is repeated.

The screen capture below shows node 6 charging and discharging as the blue trace. The yellow trace is the output at node 1. You can see that the output turns high when node 6 reaches the switching threshold of the flip-flop (about 1.8 volts). Right afterwards it spikes up due to feedback through C2*, but quickly starts discharging. The oscillator switches off when *node 6 returns below the 1.8volt switching voltage. Feedback through C2* draws *node 6 to ground before the process repeats itself.

Charging and discharging of the oscillator

In order to change the period of oscillation, adjust the value at C3*. If you would like to make the pulses longer, adjust *C2. The circuit works best right where it is at, though.

The delay and ‘sensor’

The output of the oscillator is divided down two paths. The time constants of the two delays are nearly equal and can be adjusted with the sensitivity potentiometer. The path to node 11 is the Clock input of the flip-flop, and the path to node 9 determines if there is an alarm or not.

A perfectly calibrated sensor

In the capture above, node 9 high than the the clock. Hence, the flip-flop stays high when the leading clock edge triggers it to lock. When the doorknob is touched, your body absorbs some of the charge and node 9 charges slower. This can be seen in the capture below. When the clock edge rises, node 9 is not high yet and low value is locked into the flip-flop.

When the doorknob is touched

The alarm

The designer uses an audible buzzer in order to relay the alarm. This is also my intent for the circuit, but I use a LED in my photos because you cannot see sound. They are both attached to the inverting output of the second op-amp (Q-bar) because it is high when the alarm is triggered.

The sensor being tripped

There is an endless number of uses for this circuit, but I will just name a few crazy ideas:

  1. Using the intended buzzer for your hotel or dorm room. (This is a bit more impressive than the old sock trick.)
  2. Connecting the output to a relay that triggers the doorbell for you house. Just make sure to put it in parallel with your standard doorbell switch. That way you can still hear the Fed-Ex man. (This one has a major cool factor when someone opens your door.)
  3. Tying the output into a security or home automation system. You could have the lights turn on as soon as you touch the door handle to scare the dog away from laying on the door.

Photo Gallery

Close-up The Oscillator Oscillator charging Uncalibrated Calibrated Alarm touched Connected to handle Alarm tripped 1 Alarm tripped 2 Alarm tripped 3

Measuring the speed of light with Chocolate Chips 21

Posted by Matthew Fri, 10 Mar 2006 07:41:00 GMT

Over the past week, I’ve been really busy with exams and projects. Trying to save time by finding the speed of light on Google, I stumbled upon an extremely interesting article on measuring the speed of light with a microwave. As any decent cook knows, microwaves do not heat evenly. In fact, this article explains their heating patterns are relative to the speed of light!

Understanding how a microwave heats

As we all know, microwaves heat using electromagnetic waves. These waves are at a frequency perfect for rotating water molecules (f = 2.5 GHz). The rotating water molecules create friction and thereby heat.

Two types of electromagnetic waves

Although there are two types of electromagnetic waves, we typically only consider traveling waves. The amplitude of the wave travels forward in position over times. The following animation demonstrates the amplitude of a wave over space and time.

A traveling wave
    Chocolate chips

The waves in a microwave are not traveling. If they were, it would be nearly impossible to distinguish any uneven heating patterns!

Standing waves in a microwave

The waves in a microwave oven are standing waves. These waves are stationary in space with an amplitude changing over time.

A standing wave
    Chocolate chips

With this demonstration, it is obvious that particular sections of the chips are heated more than others. In fact, these locations are located half of the wave’s length apart.

The physics of waves

We now know the frequency of the microwave and can presumably measure the length of the wave, but how are they related to the speed of light? Simple. Electromagnetic waves propagate through free space (like that in a microwave) at the speed of light. Therefore, their length is related directly to the speed of light by λ = c / f where λ is the wavelength, c is the speed of light, and f is the frequency of the microwave. Solving for the speed of light, c = λ * f.

Where do the chocolate chips come in?

Chocolate chips are perfect for measuring the distance between melted spots. The heat does not spread as quickly through them because they are not uniform. This means the melted spots will be smaller and you will have more time to measure before they all start to melt.

Melted chocolate chips

It is hard to tell from the photos, but there were distinct melting spots almost exactly 6cm apart. Remember, this is only half of the wavelength, so λ = 12cm. Plugging all the known variables into our equation, we get c = 12x10-2 * 2.5x109 = 3x108. Not bad! The true speed of light is 2.9987x108.

Notes if you replicate this experiment

  • The chocolate chips only take 20-30 seconds to melt. The longer you have them in, the bigger the melted spots will be and the less time you will have to measure.
  • This will not work in a microwave with a spinning carousel. In fact, the microwave spins to counteract these effects. Usually, you can just flip the carousel upside down to stop it from spinning. (Thanks Ryan)
  • If you plan on putting the chips back in the bag, simply refrigerate them. Freezing causes them to stick to the plate.
  • You can microwave anything that melts. (Cheese or a chocolate bar) However, chips work particularly well.

Photo gallery

Microwave data sheet. Melting the chips. Measuring. Measuring. Measuring.

A low power, long life LED flashlight circuit 16

Posted by Matthew Fri, 03 Mar 2006 04:17:00 GMT

Scouring the Internet for information on LEDs, I accidentally stumbled upon a PDF detailing a flashlight made from PVC. For the torch, he biases ultra-bright LEDs with ballast resistors as described in my LED lighting guide. This is a simple solution, but a with a slightly more complicated circuit we can extend battery life by over ten times!

Download PDF instructions for the inefficient version

PVC flashlight LEDs

Electrical losses in the flashlight

In this flashlight, each LED/resistor combination consumes 4.5volts at 30mA or about 135mWatts. The ballast resistor alone consumes 1.1volts at 30mA or about 33mWatts. Therefore, 25% of the power being drained from the batteries is lost in the resistor of each LED chain!!

Battery life

The ‘C’ size batteries in the PVC flashlight have a capacity of around 4 500mAh. If you build your flashlight with seven LEDs, there is a constant current drain of 7 * 30mA or 210mA. Dividing this into our battery capacity, it becomes obvious this flashlight will only stay lit for about a day. This is a far cry from the 50-100 hours claimed by commercial flashlights running on smaller ‘AA’ batteries.

Cutting your losses

As mentioned above, the ballast resistors are wasting 25% of our battery power. Electronic Design proposed a simple circuit to resolve this in a recent article. The front end of their circuit draws less than a milliamp of extra current.

LED Boost Controller

The circuit is best described in two parts: one, the boost circuit function of Q1 and Q2, and two, the control circuit of Q3 and JFET1. Assume Q1 is off. With the battery voltage slightly above Q2’s VVB, a positive Q2 base current [iB = (battery voltage VBE)/RJET1] would flow. Q2 turns on, which switches inductor L1 to ground.

The end result is a 23volt pulse (as shown in Figure 2) across the series of ultra-bright LEDs. At 278kHz, the human eye cannot distinguish the difference between these pulses and a constantly lit LED. This saves even more battery power.

As the battery voltage decreases, the pulses become further apart. The brightness remains indistinguishable until the voltage falls near 2volts. (The circuit does not function well below 2volts) I doubt the PVC flashlight has this efficiency near the end of its life.

The extended battery life

According to Electronic Design, this circuit consumes an current equivalent to about 17mA. Powered by our ‘C’ cell in the PVC, this circuit could run for 265 hours! This is ten times the original PVC design.

Powering LEDs costs mere pennies 33

Posted by Matthew Tue, 07 Feb 2006 22:07:00 GMT

Lately the hoopla concerning LED lighting has been overwhelming. Everyone claims this costs mere pennies to power. I decided to put a new twist on a classic science experiment to prove that LEDs do cost pennies to power. Literally.

An LED powered by pennies.

Creating a battery from pennies

In order to turn pennies into batteries, another electrode and an electrolyte are needed. In this case, dimes (zinc) are used as the positive electrodes and salt water is used an electrolyte. Copper wire, galvanized nails, and lemon juice are also popular and cheaper solutions. Such a battery produces a differential of about 0.5 volts.

One penny battery in an ice cube try.

Finding ample power for an LED

Unfortunately, this battery is not enough to light an LED. In order to string eight of these cells in series, an ice cube tray is used. Metal paperclips hang the pennies and dimes into the electrolyte banks. Because the paperclips are conductive, the eight cells are automatically connected in series forming a more powerful battery. This provides a differential of about two volts.

As you may notice, 0.5 volts * 8 != 2 volts. Not all of the banks produced a reliable voltage. In fact, one bank seemed to be working against me.

8 battery banks connected in series.

Lighting a LED with pennies

Generally, LEDs require a resistor to prevent excessive current flow from blowing them out. This project does not require a resistor because the battery simply cannot provide that amount of current.

Connecting the short end of the LED to the penny and the long end to the dime lights up the LED! Everything works as planned. The penny batteries provide about 110 micro-amps of current in series. At two volts, this is only about 220 micro-watts of power!

It does in fact ‘cost’ pennies to power an LED.

Project Photo Gallery

Cleaning the pennies before hand. Drying the pennies. One penny battery in an ice cube try. 8 battery banks connected in series. Voltage difference over a single battery bank. Total differential voltage over all 8 penny batteries. The current lighting the LED. The LED powered by the pennies. The LED is fairly bright in the dark. Night vision even though the lights are out.

Sound card based signal generators 4

Posted by Matthew Wed, 25 Jan 2006 05:40:00 GMT

Previously, E-DSP visited the possibility of using your sound card as a signal/function generator. I was curious about the results, but did not have a Windows machine close by to test it. After some searching, I found a Linux alternative and was able to test the limitations of my Sound Blaster Live!

SigGEN: A Linux signal generator

SigGEN for Linux Screenshot

SigGEN is a fairly advanced signal generator designed specifically for Linux. It is able to generate sine, cosine, triangle, sawtooth, square, and pulse waves as well as white noise and frequency sweeps. It also supports separate waves on each stereo channel and setting phase differences between them.

Digital Signal Generator (Windows)

Digital Signal Generator Screenshot

I was also able to find a Windows-based solution more advanced than E-DSP’s. It is able to generate sine, square, and triangle waves as well as chirp signals and noise.

Reproduced wave accuracy

Modern computers have no problem accurately calculating a reproducing small signals. Therefore, any limitations will lie in the sound cards specs. Most modern sound cards have a 16-bit digital to analog converter (DAC), and 24-bit DACs are becoming more popular. Even 16 bits of accuracy is far better than the 10 bits common on most embedded microcontrollers.

The major limiting factor in wave reproduction is the sound cards sampling frequency. It is limited to 48kHz. Hence, any frequencies near or above 24kHz are extremely hard (if not impossible) to reproduce without additional hardware. This limit is rather low and limits the generator usefulness as a high frequency signal generator.

Maximum deliverable voltage

Testing the maximum voltage delivered

I am sure that different sound cards are capable of delivering different voltages. My Sound Blaster Live! card was able to deliver four volts as seen above.

Maximum current and power

A sound card is also limited in the amount of power it can deliver. Once a voltage source reaches its power limit, it begins acting as a constant current source. It simply delivers less voltage to compensate for the limited current.

In order to test the sound card’s limit, a potentiometer is connected between the generated signal and ground. The resistance is then decreased until the current peaks and the voltage starts to decrease.

Finding the maximum power

Once we find the point of maximum power, the potentiometer’s resistance is measured, and Ohm’s Law is used to find the current delivered. In this case, the resistance is 24.8K ohms. V = I*R tells us 0.16mA is being delivered. P = V*I = 0.6mW maximum power.

This is not a lot of current or power. This is why E-DSP reccommends an amplifier.

Project photo gallery

DIY Lie detectors

Posted by Matthew Fri, 20 Jan 2006 14:10:00 GMT

Makezine recently posted a diy lie detector kit that uses your skin resistance (aka sweat) to detect a lie. The kit is well explained and consists of two probes you place on your palm with a red/green led readout.

Multimeter based feedback

This is all well and good, but sometimes a little more feedback is a bit more intuitive. We are trying to learn here.

Some time ago, Jason Bradbury created his own lie detector using only a resistor, a transistor, an led, and a multimeter. The led lights up if you are lying, but the multimeter provides more precise feedback of the skin’s resistance.

If you are really desperate, you can just clip the leads of your multimeter straight to your subjects palm. The ‘scary’ device may cause them to sweat and ruin the experiment, though. Just don’t tell your girlfriend you will shock her if she does not love you.

Finger straps and the LEGO RCX

The galvanic skin response sensor uses a LEGO RCX brick to detect lies and also has numeric feedback. The finger straps are the best part of this project. Your subject will know you mean business when you clip these puppies to your multimeter.

Galvanic skin response finger straps