Doorknob touch alarm

by tomthewombat. 39 Comments

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.

Cicuit 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 capacitor

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.

The calibrated response

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.

Door knob 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.

Alarm tripped 1

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


The future of Job Interviewing?

by tomthewombat. 0 Comments

The Four Dees of Analog is a story written by ADI Fellow Barrie Gilbert about a job interview circa 2025. It is crazy to imagine being interviewed over live HDTV quality teleconference with noncontact stress monitors live at the site. The story goes on to describe the differences between simply collecting information and aquiring knowledge by relating and applying that information.

Of course, this is an article in Analog Devices’ Analog Dialogue so the Sci-Fi aura quickly fades into an advertisement for analog design. In the surrounding of a digital world, the story is a great reminder that analog instrumentation is still all around us. Additionally, it highlights the benefits and challenges of analog circuitry.

Getting started with the Atmel AVR

by tomthewombat. 9 Comments

There are two major microcontrollers in the hobby domain, the popular PIC and Atmel’s AVR line. PICs are tried and true in both commercial and hobby implementations, but the Atmel AVR offers affordable programming solutions, a free development environment, a free assembler and a stable gcc toolkit that work across the entire AVR line.

Various AVR microcontrollers

Affordable Programmers

The AVR is well known for how simple it is to program. To start, you only need a few resistors and a parallel port. This will burn your code onto the microchip, but if you plan on pursuing larger projects you will need a more complex programmer with ISP support. This will enable the extra features and debugging support.

  1. The ultra low-cost AVR programmer uses an LPT port and a few resistors, but requires special software.
  2. A simple serial programmer for Linux uses several resistors and two LEDs. Programming is done with uisp.
  3. More complex schematics for ISP programmers that can be programmed via AVR Studio or AVR-Dude.
  4. A usb programmer that supports ISP.

A simple serial programmer

A free development environment

AVR Studio is available directly from Atmel at no cost. It has an integrated simulator and programming software. However, there is only an assembler available. You will have to purchase more software for high level languages.

The gcc-toolkit

If you want to use C/C++, then the gcc-toolkit is available for the AVR, free. WinAVR comes loaded with a gcc, binutils, the avrdude programmer, simulavr, and more. On Linux, you will need to download the packages for your specific distribution or compile your own cross-compiler.

A great community

AVR Freaks is a site dedicated to the AVR line of microcontrollers. There is a large archive of tutorials and a very helpful forum.

Charging batteries with Solar energy

by tomthewombat. 4 Comments

Depending on the application, charging batteries can be complex process. Charging methods range from constant voltage to pulsed and random charging. Once power is being delivered back into the battery, you have to know when to stop charging!

Once a battery is fully charged, the charging current has to be dissipated somehow. The result is the generation of heat and gasses both of which are bad for batteries. The essence of good charging is to be able to detect when the reconstitution of the active chemicals is complete and to stop the charging process before any damage is done.

Typically, common household batteries are charged with a current that is kept constant and relieved when the batteries reach a predetermined potential. However, solar cells typically generate a constant voltage of 0.5V and a varying current that depends on the amount of collected light. As such, a consant voltage charging model is easier to implement. I found two respectable tutorials on building your own charger:

  1. AA Battery Solar Charger
  2. Clean Power’s Solar battery project charger

Solar cell array

The first solution uses a diode to stop the batteries from discharging when there is no sunlight. I highly reccomend including this protection. Unfortunately, neither project implements a charge limit. You have to remove the batteries and test their charge with a multimeter. A shunt regulator is the simplest way to regulate the upper limit.

Solar battery charger schematic

New Oscilloscope: Instek GDS-820C

by tomthewombat. 6 Comments

If you know me on a more personal basis, then you know that I have been experiencing some issues with several projects/articles in the works for this site. Up until now, I did not have my own oscilloscope. Usually I am able to make due, but recently it has been making things harder than it is worth.

After some research I happened to find a deal on a new Instek GDS-820C DSO. The offer was impossible to refuse and cheaper than the GDS-805C. Besides the obvious increase in sample rate, the GDS-820C comes standard with USB and parallel ports along with the RS-232 port, but GBIP is still only an option. These digital storage options will allow me to post pretty pictures on the blog!

The Instek GDS-820C

This oscilloscope samples at 100MSamp/sec and is capable of 150mHz operation. They claim an ‘effective’ sampling rate of 25GSamp/sec when viewing repetitive signals. In comparison, Tektronix base model samples at rates up to 1GSamp/sec.

At 150mHz it will be hard to see much if the signals are not repetitive! If you know anything about Shannon’s Sampling Theorem, the effective sampling rate makes 150mHz operation seem… possible. Without this hack, the scope would be limited to half the sampling frequency or 50mHz. I could have paid more for a Tektronix scope, but the hardware would have been limited to 40mHz, mono anyway. This will suit my needs.

Update: If you view a signal sampled at over 100MSamp/sec, then you can tell it is making due with the effective sampling rate. I am not sure if this really matters because I do not have access to signal over a MHz at the moment.

Vex Robotics Starter Kit – $179.99

by tomthewombat. 4 Comments

The Vex Robotics Starter Kit is currently on sale cheap at Woot.com. If you are interested, then you better buy impulsively. Their deals last 24 hours, tops. It is exclusive to RadioShack and normally retails for $299.99. There is also a large assortment of Vex Robotics Kits & Accessories at RadioShack.com..

PC Magazine has a review along with the infamous Myth Busters. Their main gripes were a lack of accessories and motors that were geared for speed instead of power. Combined with the weight of a steel frame, this hindered a their stair climbing application.

A rich system of hardware, software, and powerful sensors, along with documentation that doesn’t skimp, makes this a terrific first experience with robotics for anyone. Well-machined. Expertly documented. Quite powerful. Tremendous fun. – From PC Magazine’s Review

Vex Robotics, detailed

Compared to other robotics kits in its class, the Vex system is capable of creating some rather large robots.

Vex Robotics, huge