Powered by Blogger.

Saturday, 22 November 2014

Enhanced 4 Digit Alarm Keypad

by Unknown  |  in Alarms and Security at  Saturday, November 22, 2014
Circuit : Ron J
Email  :

Description
This is an enhanced 4 digit keypad which may be used with the Modular Alarm System.

4 digit keypad


Notes
The Keypad must be the kind with a common terminal and a separate connection for each key. On a 12-key pad, look for 13 terminals. The matrix type with 7 terminals will NOT do. The Alarm is set by pressing a single key. Choose the key you want to use and wire it to 'E'. Choose the four keys you want to use to switch the alarm off, and connect them to 'A B C & D'. 

Your code can include the non-numeric symbols. With a 12-key pad, over 10 000 different codes are available. Wire the common to R1 and all the remaining keys to 'F'. When 'E' is pressed, current through D2 and R9 switches Q5 on. The relay energises, and then holds itself on by providing base current for Q5 through R10. The 12-volt output is switched from the "off " to the "set " terminal, and the LED lights. To switch the Alarm off again it is necessary to press A, B, C & D in the right order. The IC is a quad 2-input AND gate, a Cmos 4081. These gates only produce a high output when both inputs are high. Pin 1 is held high by R5. 

This 'enables' gate 1, so that when 'A' is pressed, the output at pin 3 will go high. This output does two jobs. It locks itself high using R2 and it enables gate 2 by taking pin 5 high. The remaining gates operate in the same way, each locking itself on through a resistor and enabling its successor. If the correct code is entered, pin 10 will switch Q4 on and so connect the base of Q5 to ground. This causes Q5 to switch off and the relay to drop out. Any keys not wired to 'A B C D or E' are connected to the base of Q3 by R7. 

Whenever one of these 'wrong' keys is pressed, Q3 takes pin 1 low. This removes the 'enable' from gate 1, and the code entry process fails. If 'C' or 'D' is pressed out of sequence, Q1 or Q2 will also take pin 1 low, with the same result. You can change the code by altering the keypad connections. If you need a more secure code use a bigger keypad with more 'wrong' keys wired to 'F'. A 16-key pad gives over 40 000 different codes. All components are shown lying flat on the board; but some are actually mounted upright. The links are bare copper wires on the component side. Two of the links must be fitted before the IC. 

Veroboard Layout


The Support Material for this circuit includes a step-by-step guide to the construction of the circuit-board, a parts list, a detailed circuit description and more. 

Enhanced 5 Digit Alarm Keypad

by Unknown  |  in Alarms and Security at  Saturday, November 22, 2014
Circuit : Ron J
Email  :

Description
This is an enhanced 5 digit keypad which may be used with the Modular Alarm System 

Alarm Keypad


Circuit Notes
This switch will suit the Modular Burglar Alarm circuit. However, it also has other applications. The Keypad must be the kind with a common terminal and a separate connection for each key. 

On a 12-key pad, look for 13 terminals. The matrix type with 7 terminals will NOT do. Choose the five keys you want as your code, and connect them to 'A, B, C, D & E'. Wire the common to R1 and all the remaining keys to 'F'. Because your choice can include the non-numeric symbols, almost 100 000 different codes are available. The Alarm is set using the first four of your five chosen keys. 

When 'A, B, C & D' are pressed in the right order and within the time set by C1 and R2 (about 10 seconds), current through R11 switches Q6 on. The relay energizes, and then holds itself on by providing base current for Q6 through R12. The 12-volt output switches from the "off " to the "set " terminal, and the LED lights. To switch the Alarm off again it is necessary to press A, B, C, D & E in the right order. 

The IC is a quad 2-input AND gate, a Cmos 4081. These gates only produce a high output when both inputs are high. Pressing 'A' takes pin 1 high for a period of time set by C1 and R2. This 'enables' gate 1, so that when 'B' is pressed, the output at pin 3 will go high. This output does two jobs. It locks itself high using R3 and it enables gate 2 by taking pin 5 high. The remaining gates operate in the same way, each locking itself on through a resistor and enabling its successor. If the correct code is entered within the time allowed, pin 10 will switch Q5 on and so connect the base of Q6 to ground. 

This causes Q6 to switch off and the relay to drop out. Any keys not wired to 'A, B, C, D or E ' are connected to the base of Q4 by R9. Whenever one of these 'wrong' keys is pressed, Q4 takes pin 1 low. This removes the 'enable' from gate 1, and the code entry process fails. If C, D or E is pressed out of sequence, Q1, Q2 or Q3 will also take pin 1 low, with the same result. You can change the code by altering the keypad connections. 

If you make a mistake entering the code, just start again. If you need a more secure code you can use a bigger keypad with more 'wrong' keys wired to 'F'. A 16-key pad gives over half a million different codes. All components are shown lying flat on the board; but some are actually mounted upright. The links are bare copper wires on the component side. Two of the links must be fitted before the IC.

Veroboard Layout
vero layout


The Support Material for this circuit includes a step-by-step guide to the construction of the circuit-board, a parts list, a detailed circuit description and more. 

Motorcycle Alarm

by Unknown  |  in Alarms and Security at  Saturday, November 22, 2014
Circuit : Ron J
Email  :

motorcycle alarm


Circuit Notes
Any number of normally open switches may be used. Fit the mercury switches so that they close when the steering is moved or when the bike is lifted off its side-stand or pushed forward off its centre-stand. Use micro-switches to protect removable panels and the lids of panniers etc. While at least one switch remains closed, the siren will sound. About two minutes after the switches have been opened again, the alarm will reset. How long it takes to switch off depends on the characteristics of the actual components used. But, up to a point, you can adjust the time to suit your requirements by changing the value of C1.

The circuit board and switches must be protected from the elements. Dampness or condensation will cause malfunction. Without its terminal blocks, the board is small. Ideally, you should try to find a siren with enough spare space inside to accommodate it. Fit a 1-amp in-line fuse close to the power source. This protects the wiring. Instead of using a key-switch you can use a hidden switch; or you could use the normally closed contacts of a small relay. Wire the relay coil so that it is energized while the ignition is on. Then every time you turn the ignition off, the alarm will set itself.

When it's not sounding, the circuit uses virtually no current. This should make it useful in other circumstances. For example, powered by dry batteries and with the relay and siren voltages to suit, it could be fitted inside a computer or anything else that's in danger of being picked up and carried away. The low standby current and automatic reset means that for this sort of application an external on/off switch may not be necessary.

The Support Material for this alarm includes a detailed guide to the construction of the circuit-board, a parts list, a complete circuit description and more.

Water Level Alarm

by Unknown  |  in Alarms and Security at  Saturday, November 22, 2014
Circuit : Andy Collinson
Email  :

Description:
A circuit that offers visual indication of fluid level in a vessel, with a switchable audible alarm. Example uses would be to monitor the level of water in a bath or cold storage tank.

water level alarm


The Conductance of Fluids
Conductance is the reciprocal of resistance. The conductance of fluids vary with temperature, volume and separation distance ofthe measurement probes. Tap water has a conductance of about 50 uS / cm measured at 25°C. This is 20k/cm at 25°C. See this site for more details about the conductance of fluids.

Circuit Notes
This circuit will trigger with any fluid with a resistance under 900K between the maximum separation distance of the probes. Let me explain further. The circuit uses a 4050B CMOS hex buffer working on a 5 volt supply. All gates are biased off by the 10M resistors connected between ground and buffer input. The "common" probe the topmost probe above probe 1 in the diagram above is onnected to the positive 5 volt supply. If probe 1 is spaced 1 cm away from the common probe and tap water at 25 C is detected between the probes (a resistance of 20k) then the top gate is activated and the LED 1 will light. Similarly if probe 2 at 2 cm distance from the common probe detects water, LED 2 will light and so on. Switch 1 is used to select which output from the hex buffer will trigger the audible oscillator made from the gates of a CMOS 4011B IC.

Placement of Probes
As 7 wires are needed for the probe I reccommend the use of 8 way computer ribbon cable. The first two wires may be doubled and act as the common probe wire. Each subsequent wire may be cut to required length, if required a couple of millimetres of insulation may be stripped back, though the open "cut off" wire end should be sufficient to act as the probe. The fluid and distance between probe 6 and the common probe wire must be less than 900k. This is because any voltage below 0.5 Volt is detected by the CMOS IC as logic 0. A quick potential check using a 900k resistance and the divider formed with the 10M resistor at the input proves this point: 

5 x (0.9 / (0.9+10) = 0.41 Volt

As this voltage is below 0.5 volt it is interpreted as a logic 0 and the LED will light. If measuring tap water at 25 C then the distance between top probe and common may be up to 45 cm apart. For other temperatures and fluids, it is advisable to use an ohmmeter first. When placing the probes the common probe must be the lowest placed probe, as the water level rises, it will first pass probe 1, then 2 and finally probe 6.

Perimeter Monitor

by Unknown  |  in Alarms and Security at  Saturday, November 22, 2014
This circuit is intended for audio surveillance of an unattended area, examples being a back garden or open space. It can be used to listen for wildlife or just as an extra pair of ears.

Notes
Using a single cable such as speaker wire or doorbell cable, this circuit can be remotely positioned, for example, at the bottom of a garden or garage, and used to detect all sound in that area.  

The cable can be buried in a hosepipe or duct and is concealed out of sight. The mic is an ordinary dynamic mic insert and should be housed in a waterproof enclosure with the rest of the circuit. 

The mic output is amplified by the two transistors, the output is fed down the cable via the 220u capacitor. Here, it has a dual purpose of preventing the DC supply from upsetting the bias of the circuit, and also allowing the smaller ac audio output to pass down the line. 

At the power supply, the audio is recovered by the 10k preset and 220u capacitor. It is used to feed a small audio amplifier (such as the 2watt design) shown earlier on this site. 

Digital Combination Lock Circuit Diagram

by Unknown  |  in Alarms and Security at  Saturday, November 22, 2014
A multiple input combination loack using CMOS counter IC's. Flexibility and code change is allowed by changing output connections.



Notes
The circuit above above makes use of the CMOS 4017 decade counter IC. Each depression of a switch steps the output through 0 - 9. By coupling the output via an AND gate to the next IC, a predefined code has to be input to create the output. 

Each PBS switch is debounced by two gates of a CMOS4001 quad 2-input NOR gate. This ensures a clean pulse to the input of each CMOS 4017 counter. Only when the correct number of presses at PBS A will allow PBS B to become active. 

This is similar for PBS C and PBS D. At IC4, PBS D must be pressed 7 times. Then PBS C is again pressed 7 times, stepping from output 1 to output 8. The AND gate formed around CMOS4081 then goes high, lighting the LED. The Reset switch can be pressed at any time. 

Power on reset is provided by the 100n capacitor near the reset switch. Below is a picture of one that I made about 15 years ago:

Lock PCB


Unfortunately, this board was part of a much larger project containing multiple power supplies. One day whilst working on another circuit , I slipped with a wire and splashed 24 volts DC onto this board. 

There was a small spark, and puff of smoke before all this chips were cooked! If anyone does consider building such a circuit, then my advice would be to stop and look in your local electronic parts catalogue. 

There are now dedicated combination lock IC's with combinations many times greater than this circuit. Incidentally the numberof combinations offered here is 10 x 10 x 10 x 10 x 9 = 90,000. 

Waterpump Safety Guard for Fish Pond / Fish Tank

by Unknown  |  in Alarms and Security at  Saturday, November 22, 2014
The circuit below was developed to guard the fish pond. In this case to prevent that the pump sucks just air when the waterlevel get below the pump. When the waterfilters get saturated and dirty, the water level behind the filter gets to an unacceptable level. You can see this when the pump also produces airbubbles in the water.


Because you are not all day peeking if this is the case, I connected the pump via a Solid State Relais, which acts as a power switch mounted in one of the AC wires and is controlled by the circuitry below.

fishpond guard



The sensor is fabricated using two sturdy solid *copperwires which are mounted approximately 1cm () apart in the water after the waterfilter. The conductivity of the water is sufficient to pull the input of the first IC (IC1c) high. The output of IC1d will then also be high. (* see note)
This output signals the R-S Flip-Flop formed by IC1a and IC1b.

Often the condition is correct when you power up, which is indicated by the green led. However, if the red led is lit, just press the Reset switch to put the circuit in the proper operational condition. The current flowing through the green led is also fed through the diode in the Solid State Relay, activating the relays and the starting the pump.


If for some reason the water level is getting low and the copper wires no longer touch the water, the input of the first IC is pulled low and consequently also the ouput of the IC behind that. The R-S Flip-Flop flips to the other condition and the green led goes out and also the pump and the red led will be lit to indicate 'something' is wrong. In this case the waterlevel.

When you're ready after the filters have been cleaned, the only you have to do is press the Reset button to activate the pump again. This way unnecessary damage to the pump is prevented.
The copper wires will need regular cleaning to make sure they conduct.

If you have questions about this circuit, please direct them to Jan Hamer or visit his website in the Netherlands (if you can read Dutch).
Published & Translated from Dutch into English with permission of Jan Hamer, The Netherlands.

RF Pad - Combination-Controlled, Fully Customizable Radio Frequency Remote Control

by Unknown  |  in Alarms and Security at  Saturday, November 22, 2014

RF pad (doubles as serial-pad)

combination-controlled, fully customizable radio frequency remote control
  • 2 years operation from a 9V battery (8uA in standby)
  • up to 16 keys in a 4 by 4 matrix, fully configurable
  • key-bleep on every key
  • three separate combinations, expandable
  • full source code provided (GNU C vompiler for AVR)
  • replaces remote controls based on MM53200, UM3750 and UM86409
  • 433.92 MHz output (other frequencies changing module)
  • ASCII serial output for using as serial keyboard with PC or Basic Stamps

Perfect as a remote replacement for access control and for switching on/off burglar alarms, it emits an RF code every time you digit the correct combination on its keyboard.
Three different combinations for three different actions can be entered at program-time. The keyboard layout is configurable, too: you can use any matrix up to 4 rows by 4 columns, assigning your own ASCII codes to each key.
The code is compatible with popular remote controls as well as Nut chips (see also the Nut-based burglar alarm project).
Alternatively, you can drop off the RF part and use it as serial keyboard. Keypresses are available as ASCII codes at pin 3, allowing direct connection to aBasic Stamp and similar controllers. Connecting to a PC requires a polarity inversion (the Nut chip interface is suitable for that job).

my prototype uses only 12 keys out of the 16 theoretically available

The circuit (full schematic here)

I don't like to reinvent the wheel, but I was surprised by the number of components involved in the "Wake up on keypress" application note from the Atmel's web site. You know, I like simplicity, so I dropped off almost everything.
  • With appropriate use of the internal pullups, only two diodes (D1 and D2) are necessary to excite the wake-up interrupt with a 4x4 keyboard. Each time you press a key, the chip wakes up, the buzzer bleeps, the key is decoded, and if it completes a valid combination the corresponding code is transmitted.
  • The transmitter is a 433.92 MHz hybrid module by Mipot: it is specified for a 5 volt power supply and consumes almost nothing when no data is applied. It can be replaced with similar modules according to your country's frequencies (e.g. 300 Mhz).
  • Pin 13 drives a 5 volt buzzer directly. Use a buzzer drawing not more than 10 mA
  • The oscillator is made from a 4MHz, three pin ceramic resonator: at wake-up, it restarts faster than a crystal based one
  • The reset is of the R-C type: being powered on once every two years, this is perfectly adequate, and there is no eeprom data that could be corrupt by improper reset.

 

The software

RF pad is written in GNU C. The good news is that this is is an excellent free compiler, ANSI compliant, with legendary portability between many platforms. The bad news is that it is difficult to set up and master at first time (this may be due to the fact it is developed by very clever people). If you have never seen a command-line compiler before and you are unfamiliar with commands like make and compiler flags be prepared for an hard work.
Fortunately, you don't need the compiler to make an RF-pad, and you can customize your RF pad without recompiling the code, just editing a few bytes at program time.

 

The prototype

I built my prototype from a perf board (veroboard). With so few components involved, a PCB is not really necessary. The board is big enough to host the battery, put in place with biadhesive tape. On the solder side, a 10 cm. long wire forms the antenna.
The keyboard is a surplus one from a telephone, using only 12 of the 16 keys theoretically available.
The big black buzzer is a 9 volt type instead of 5 volt, but it works as well at lower voltages.
The AVR micro is placed on a socket: it could be reprogrammed in-system, but in practice I found faster to remove it and place into the programmer instead of wiring an appropriate connector.

The whole circuit is housed in a nice plastic console: the hard part is cutting the keyboard hole. It needs a good shaw, a set of files, a firm vice, and lots, lots, lots of patience to get a clean result.

my prototype, opened

 

Files available:

Download or view on-line the RF pad schematic (28kB .GIF file)
Download the RF pad sources, executables, schematic in one .ZIP file (53 kB).


Customizing RF pad

Customizing the key matrix

The key matrix of my prototype comes from a surplus telephone and it is like this:
1 2 34 5 67 8 9 * 0 #
It's a 4 rows by 3 columns keybaord, so it uses only 12 of the 16 keys handled by RF pad.However, the code is pre-programmed for a layout like this:
1 2 3 A
4 5 6 B
7 8 9 C
 * 0 # D
You can choose any layout you wish as long as it fits in a 4 by 4 matrix. You can simply omit any key without changing the software. You can assign any ASCII code to your keys based on key's position. The only ASCII code you can't assign is NULL, that evaluates to zero.

If you have the GNU C compiler you modify the keyboard matrix initialization:

//keyboard ASCII matrix, replace your own characters here
//DON'T USE 0x00 as it breaks string compare
const unsigned char keys[MAX_ROWS][MAX_COLUMNS] =
{ {'1', '2', '3', 'A' },
  {'4', '5', '6', 'B' }, 
  {'7', '8', '9', 'C' },
  {'*', '0', '#', 'D' } };
The following code changes the keyboard from "telephone" (with 1 at top-left) to "calculator" layout(with 7 top-left).
const unsigned char keys[MAX_ROWS][MAX_COLUMNS] =
{ {'7', '8', '9', 'A' },
  {'4', '5', '6', 'B' }, 
  {'1', '2', '3', 'C' },
  {'*', '0', '#', 'D' } };
(Note that you must initialize all 16 keys even if you don't use them all.)
If you don't have the compiler (or you don't want to recompile) then modify the executable prior to programming the chip. The following example shows how to do the same modifications with Pony Prog.
  1. Select the AT90S2313 and load the rf_pad.rom file. Scroll the hex window until you see the keyboard matrix (It is located near the end of the program, address is $34E). Here I highlighted it in yellow:
  2. Select "Edit buffer enabled" from the "Edit" menu. This allows you to change the hex or alpha codes by clicking them.
  3. Change the codes to get the following:

 

Changing combinations and RF codes

If you have the GNU C compiler, it is simply a matter of changing some #defines:
//replace here your own ASCII key combination / 12 bit rf codes pairs
//very important: the combination must be the same length as 
//the key_combination[] (see below)
#define COMBINATION_1 "111111"
#define RF_CODE_1 0xAAA    //will be AA 0A in code dump
#define COMBINATION_2 "222222"
#define RF_CODE_2 0xBBB    //will be BB 0B in code dump
#define COMBINATION_3 "333333"
#define RF_CODE_3 0xCCC    //will be CC 0C in code dump
If you don't have the compiler, you can "hack" the executable as explained above:
  • The codes are 12 bits long and default to $AAA, $BBB and $CCC respectively.
    You can find them on the hex dump (left half screen) starting at address $348.
    Note that the codes are stored with low byte first, so e.g. $AAA becomes AA-0A, $427 becomes 27-04, $15B becomes 5B-01 etc.
  • The three combinations default to 111111, 222222 and 333333 respectively.
    They are stored in ASCII form, so it's easier to modify them in ASCII clicking on the right pane. Combinations must be 6 keypresses long.

Smartcard controlled relay circuit based around Nutchip microcontroller

by Unknown  |  in Alarms and Security at  Saturday, November 22, 2014
From a designer's perspective, there are no "good" or "bad" circuits. This article will show how to transform a "pirate" smart card (cheaply available almost everywhere nowadays , as consequence of digital TV piracy plague) into a legal and pacific electronic key application.
Opposite to popular belief, most TV smartcards are not clones of the original and trusted ones. Instead, they often are minature versions of general purpose microcontrollers - well known to the electronics enthusiasts - like PICs from Microchip or AVR from Atmel.

The relay triggers exclusively with the mating card

This design uses a smart card to enable a relay. A Nutchip recognizes its mating smart card among thousand similar ones, because you choose the code to be programmed in the card's memory. No speacilized knowledge is necessary, as we supply the card program and codes. Nutchip truth table is simple as well, so you should be able to adapt it to your needs (e.g., adding more than one card, or timing the relay). Even in its actual form, the board is ready to work in many useful applications:
  • open gates e.g. for park lots...
  • access control to gyms, swimming pools, tennis play fields...
  • switch on central heating or showers, or the football field lights...
  • enable TV viewing, photocopyng, faxing, coffe machine use, telephones etc.
Smartcards are very handy as they are compact, lightweight, and require no batteries. Cards are tough compared to remote controls, are resistant to dirt and wet, and don't break apart falling from a tabletop. If a card gets lost or stolen, you can reprogram the Nutchip in minutes, discarding the old code in favour of a new one, therefore making the old card useless.
      
AT A GLANCE
  • It's a board which fires a relaywhen a card with the correct code is inserted
  • The Smarcard sends a digitalcode among thousands different codes
HOW IT WORKS
Thanks to a nice trick:
  • The card provides a digital code which is virtuallyindistinguishible from a standard remote control code
  • The Nutchip senses the signal through its REMOTE input pin, and interpretes it as if it came from an ordinary remote control!

Schematic diagram

This card-activated realy requires just an handful of parts and is very simple. The active components in addition to the Nutchip are a 74HC00, a reset generator (IC3) and a transistor for relay switching.
Thereset integrated circuit IC3, an MC34064 from Motorola, guarantees a clean Nutchip RESET even in presence of electric noise coming from the power network. Its duty consists of discharging the capacitor C2 as fast as possible when a power drop is detected.
The Nutchip (IC1) is the heart of the device. Nutchip output OUT1 drives an LED (LD1) which is in series to a current-limiting resistor (R3). A separate output is used for dirving the relay (RELAY1) through a transistorized relay driver stage (TR1, R2, D1). The transistor works as an electronic switch, amplifying Nutchip output current from tenths of mA to tens of mA - a level suitable for driving the relay coil. Diode D1 protects the circuits from high voltages that are induced on the coil during switchoff.
schema elettrico

Schematic diagram. For simplicity's sake, card is depicted as viewed from top:
the actual connection is provided by means of a special slot connector.

But let's introduce the smartcard. We choose a "Funcard Purple": this is the usual name for a card embedding a powerful processor, an Atmel AT90S8515, and a serial EEPROM memory. Other "Funcards" similar to the "Purple" are the "Funcard Prussian" and "Funcard Prussian 256": these should be theoretically compatible, although more expensive. However, please note that we have not tried them, so take our word at your own risk.
As the Funcard Purple embeds a microcontroller, you must load it with a program written for this specific task before using it in our circuit. The program is a free download from the file "card_1234.hex", and we supply it ready made so you need only a programmer to get up and running. Once programmed, the Funcard's microcontroller will act as a remote control, generating a pulse train undistinguishible from a radio (RF) remote control. The resulting waveform is output on the smartcard pad labelled "OUT, which connects -though a suitable slot connector- to the Nutchip remote control input (REMOTE, pin 6). We placed a series resistor, R4, in order to protect the Nutchip from noise and spike pulses that can be generated during card insertion and extraction.

For semplicity's sake, the schematic diagram does not show the smartcard connector: instead, the smartcard picture is shown as it appears looking at it from the golden pads side.
  • Card power is 5 volts and must be connected to the pads labelled as +5V (positive) e GND (negative).
  • Card output signal is available on the OUT pad, ready to be decoded by the REMOTE input of the Nutchip. Don't omit a current-limiting resistor, R4, as it limits peaks that may happen while moving the card.
  • As every processor, also the microcontroller embedded in the card needs a clock source. We provide a 4 MHz clock borrowing it from Nutchip's main clock, which is available on pin 4 (XTAL2). The clock passes through one of the 4 NAND gates from IC2 (a fast-CMOS logic circuit type 74HC00), which is connected in a classic inverter configuration. This logic gateadapts clock impedance, and decouples Nutchip clock from the external world. Decoupling is required to protect the citrcuit and to prevent the main clock from being stopped should a wrong memory card be inserted.
We suggest to connect free gates inputs (there are 3 unused gates left from IC2, corresponding to input pins 4,5,9,10,12,13) to the negative power rail. This gates are high-impedance and should not be allowed to "float": caonnecting to GND avoids any floating.

Truth table

The truth table which implements our smartcard-controlled relay counts just a few rows. It is very similar to any truth table implementing a remote control with a Nutchip;
  • When idle the device sits on state st00 - which is also the power-on status. This status waits for one condition: remote control key 1 to be pressed. The Nutchip cannot tell whether a "true" remote control or a smartcard replica is connected to its REMOTE pin.
    From truth-table first row, you can easily see that as long as the Nutchip stays in st00, all outputs are low (0). As soon a the key1 code is received, Nutchip passes to state st01.
  • State st01 is the active state: all outputs are logic 1 (high), causing the LED (powered from output 1) to lit and the relay (driven by output 4) to energize. Notably, this state includes a condition on key1 which states st01 itself as next state. This is a trick to restart the 100 mS timeout as long as the key1 code is received, so the output is continuously excited when the card is inserted. Removing the card allows the timeout to expire, bringing the Nutchip back to state st00.

tavola della verità

You can type in the truth table or load it from file card.nut: it is just a starting point. It is easy to change it to get -for example- a longer timeout after removing the card, on to implement an on/off relay behaviour, so that a first card insertion causes the relay to switch on, a second one switches the relay off, and so on.. Another useful addition could be a second relay, with different timings: examples of this can be found on parking lot gates, when a first output opens the gate and an auxiliary one switches on the light. Well, more experienced users will now begin to see how to include a photocell in order to get the light on only at night... This is the beauty of Nutchips: start simple, and grow gradually adding more features!
Stop dreaming, let's continue with our description, and don't forget to set the remote control type to "Custom RF" and to input the correct key1 code. The code must be the same as the one programmed on the smartcard. Default code for our file card_1234.hex is 1234; instructions to chage this code are included in the same .zip file.

Prototype

We assembled a quick prototype on a breadboard. Despite the small component count, a great deal of care and attention is required. The photo show a simplified version of the circuit, which does not include the relay, the associated transistor driver, the RESET circuitry. This is perfectly OK in order to perform many lab experiments before going for a more definitive implementation, like preparing a printed circuit boards and soldering parts (note: PCB drawings not available).
Try to keep connections short, always less that 10 cm each, as shown by the photo. If possible, use a smartcard connector with all of the connection are clearly visible, like ours: this will help preventing errors. Always use colour-coded wiring: our example uses red for +%V, black for GND, light blue for 4 MHz buffered clock, green for unbuffered clock, orange for OUT.
Take care not to revert any part: LED, ICs (the photo shows both with pin 1 towards left side), power supply. In case of doubt, check the parts pinout page for details.
When you are finished with the circuit, and before applying power to the circuit, check once more all the connections. If everything corresponds to the schematic diagram, it is time for connecting the interface, switching on power, and programming the Nutchip.
Run Nutstation and load the truth table "card.nut", and select the "custom RF" remote control. From the remote control selection window click on key 1 and input "1234" as the key code. This applies if you are using the default .hex file for the smartcard, otherwise change it accordingly to the new code.Program the Nutchip.
Programming the smartcard with the file "card_1234.hex" is a separate task. You can ask your card supplier to do the job for you - it takes only a couple of minutes - or you can do it yourself with one of the many smartcard programmers commercially available.
Once the Nutchip and smartcard are programmed, you are ready for the conclusive test! Power the circuit, and slide the card in gently. Does the LED light up? Yes? Congratulations, everytihs works to the perfection!

foto montaggio sperimentale
Parts placement for a simplified lab experiment. We prefer a card connector whit all of the contact clearly visible, in order to prevent connection mistakes. This prototype omits relay and RESET circuitry (R2, TR1, D1, RELAY1, IC3, R1, C2).

Smartcards, connettors and programming

Smartcard, connectors and special programmers are sold online by may sites and often found in flea markets and ham fairs.
As this smartcard use is 100% legal, feel free to ask your supplier to program your card with the file "card_1234.hex" when you buy it.
You can also get a card programmer for a sum varying to less than the price for the connector itself to very expensive and fancy ones. We succesfully used the cheapest one, known as "Funcard Light", which costs a few euros and is made from just three resistors(!) other than the PC parallel port and card connectors.
Funcard Light schematic is available online from the following site:
http://www.funcard.net    
foto programmatore
The "funcard light" programmer is litlle more than three resistors
You need also a suitable software to drive the programmer. We used Funprom, that we have downloaded from the same web site. Although most softwares ask for THREE files to be loaded to the smartcard (flash, internal, external), our project needs only the "flash file" to by loaded, that is "card_1234.hex".
Parts list:
IC1: Nutchip NUT01-AK (buy it from Nutchip dealers)
IC3: reset generator IC type MC34064
IC2: CMOS logic gates IC type 74HC00
R1: 100 kiloohm 1/4W resistor
R2: 4700 ohm 1/4W resistor
R3: 390 ohm 1/4W resistor
R4: 1000 ohm 1/4W resistor
C1, C2: 100 nF capacitor (ceramic)
RELAY1: SPST relay , 5 Volt coil
CN1: programming interface connector
CN2 (non drawn on schematic): Smartcard "slot" connector
CARD1: "Funcard Purple" smartcard, programmed (see text)
OSC1: 4MHz, 3-pin ceramic resonator
D1: 1N4007 diode
DL1: LED (red)
TR1: NPN transistor type BC337
M1, M2: pcb mount,bipolar, screw clamps

you need also: 5 volt regulated power supply, 20-pin socket for Nutchip, 14-pin socket for IC2, prototype board or printed circuit board.

Lie Detector

by Unknown  |  in Medical and Health at  Saturday, November 22, 2014

Lie Detector



The circuit diagram of the Lie Detector is shown above. It consists of three transistors (TR1 to TR3), a capacitor (C1), two lights or LEDs (L1 & L2), five resistors (R1 to R5), and a variable resistor (VR1).
This circuit is based on the fact that a person's skin resistance changes when they sweat (sweating because they're lying). Dry skin has a resistance of about 1 million ohms, whereas the resistance of moist skin is reduced by a factor of ten or more.
Resistors R1 and R2 form a voltage divider. They have resistances of 1 000 000 ohms (1 mega ohms) and, because their values are equal, the voltage at the upper probe wire is half the battery voltage (about 4.5 volts).
A person holding the probe wires will change the voltage at the upper probe wire depending on their skin resistance. The skin resistance is in parallel with R2 and, because it is likely to be similar to or smaller than R2, the voltage at the probe wire will fall as skin resistance falls.
Capacitor C1 functions as a smoothing capacitor and removes the 50Hz induced mains hum that is found on a person's body.
TR1 and R3 form a buffer circuit (called an emitter-follower). The voltage at the emitter of TR1 follows the voltage at the probe wire and is now able to drive transistor TR2.
Transistors TR1 and TR2 act as a voltage comparator. If the voltage at the base of TR2 is higher than at the base of TR3 then the green LED (L1) will come on. If the reverse is true then the red LED (L2) will light.
To test the Lie Detector hold the probe wires. Adjust VR1 until the green LED is just on and the red LED is just off. This is the point at which the voltage at the base of TR2 is just greater than at the base of TR3. Now use moist fingers to hold the probes. This lowers the skin resistance and causes the voltage at the base of TR2 to fall. The voltage at the base of TR3 is now greater and the red LED comes on.

Proudly Powered by Blogger.