Silicon ChipSimple Alcohol Level Meter - October 2005 SILICON CHIP
  1. Outer Front Cover
  2. Contents
  3. Publisher's Letter: Valve amplifiers and self-delusion
  4. Feature: Google Earth by Ross Tester
  5. Review: NetComm NP210: Ethernet Over Power by Ross Tester
  6. Project: Dead Simple USB Breakout “Box” by Stan Swan
  7. Project: Studio Series Stereo Preamplifier by Peter Smith
  8. Project: Video Reading Aid For Vision Impaired People by Jim Rowe
  9. Project: Simple Alcohol Level Meter by John Clarke
  10. Project: Ceiling Fan Timer by John Clarke
  11. Feature: The iButton – A Hard “Nut” To Crack by Clive Seager
  12. Feature: The DS1921 iButton Datalogger by Clive Seager
  13. Salvage It: A $5 2-channel vibration sensor by Julian Edgar
  14. Book Store
  15. Vintage Radio: The Harbros 12/54B transceiver by Rodney Champness
  16. Advertising Index
  17. Outer Back Cover

This is only a preview of the October 2005 issue of Silicon Chip.

You can view 41 of the 112 pages in the full issue, including the advertisments.

For full access, purchase the issue for $10.00 or subscribe for access to the latest issues.

Items relevant to "Studio Series Stereo Preamplifier":
  • 4-Output Universal Regulator PCB [18105151] (AUD $5.00)
  • PCB pattern for the Studio Series Preamplifier power supply (PDF download) [01109052] (Free)
  • Studio Series Stereo Preamplifier main PCB [01109051] (AUD $20.00)
  • Studio Series Stereo Preamplifier Main PCB pattern (PDF download) [01109051] (Free)
Articles in this series:
  • Studio Series Stereo Preamplifier (October 2005)
  • Studio Series Stereo Preamplifier (October 2005)
  • Studio Series Stereo Headphone Amplifier (November 2005)
  • Studio Series Stereo Headphone Amplifier (November 2005)
  • Studio Series Remote Control Module (April 2006)
  • Studio Series Remote Control Module (April 2006)
Items relevant to "Video Reading Aid For Vision Impaired People":
  • Video Reading Aid PCB pattern (PDF download) [02110051] (Free)
  • Video Reading Aid front panel artwork (PDF download) (Free)
Items relevant to "Simple Alcohol Level Meter":
  • Bilge Sniffer/Alcohol Meter PCB [05109051] (AUD $10.00)
  • RBT BAC Checker/Bilge Sniffer PCB pattern (PDF download) [05109051] (Free)
Items relevant to "Ceiling Fan Timer":
  • PIC16F88 firmware and source code for the Fan Timer [fantimer.hex] (Software, Free)
  • Fan Timer PCB pattern (PDF download) [10110051] (Free)
  • Fan Timer front panel artwork (PDF download) (Free)
Items relevant to "The iButton – A Hard “Nut” To Crack":
  • PICAXE-08M BASIC source code for the iButton reader (Software, Free)

Purchase a printed copy of this issue for $10.00.

Check your blood alcohol level before you drive. RBT BAC Checker The courts are full of people who thought they were fit to drive after having “a couple of drinks”. This simple little project will give you a good indication of alcohol on your breath – and therefore your blood alcohol concentration (BAC). It’s up to you then to make the right decision and get a cab home instead! I Police. Therefore it must not be used Furthermore, this particular PC board f you drive when under the into make the decision to drive or not has been designed for more than one fluence of even a small amount to drive based on an “under .05” or project – it has already served us in of alcohol it is certain that your “over .05” reading. Our advice would the recent “Bilge Sniffer” (September driving will be impaired. be – if you drink, don’t drive! 2005). Reaction times will be extended and while you may feel confident to Our Alcohol Level Meter The sensor drive, anything that occurs requiring Housed in a small ABS case, the The alcohol sensor itself, which a judgement decision may lead to circuit consists of a proprietary alprotrudes through the case lid so that disastrous consequences. cohol sensor which drives a 10-LED it can be blown into, is encapsulated For Learner and Provisional drivers bargraph display. The higher the proin a plastic button-shaped housing in NSW at least, there is virtually zero portion of alcohol sensed, the higher with a stainless steel mesh covering tolerance for having any blood alcohol the display reads. over the open end. levels. With this in mind, being able Inside is a heater that is to detect small amounts of used to heat up an aluminium alcohol on your breath would oxide ceramic tube, itself be quite useful. coated with a tin dioxide senThe SILICON CHIP Alcohol not give a es do ter Me sitive layer. Resistance across Level Meter can be used l ve Le l ho This Alco the electrodes attached to the be to detect and display the ot nn ca d an reading sensitive layer decreases with presence of alcohol on your calibrated blood alcohol . ing rn wa t mi -li the increasing alcohol concentrabreath. And it operates with erov relied on to give an tion – that is, it is an inverse sufficient sensitivity to detect relationship. blood alcohol levels below the Don’t be The change in resistance from the critical 0.05% concentration. concerned about the relatively small sensor is converted to a voltage by a Before we go any further, though, number of components on the PC resistive voltage divider across the let’s get one thing straight: this unit board, nor the large number of unsupply voltage. This is then displayed does not and can not replace the used holes. This simple level meter using the LED bargraph, controlled by highly calibrated devices used by the doesn’t need any more components. Warning 66  Silicon Chip siliconchip.com.au by John Clarke The Alcohol Level Meter mounted inside its case, fitted with a suitable length of figure-8 cable and a cigarette lighter plug. Keep it in the glovebox – just in case! an LM3914 bargraph display driver. Fig.1 shows the internal arrangement of the LM3914. It comprises 10-comparators that monitor the voltage applied to pin 5. The comparator’s positive inputs are connected to 10 series-connected resistors between the RLO and RHI inputs. The idea is to connect the RHI input to a voltage source and RLO either to ground or a raised voltage if you wish to measure a range of voltage that starts above ground. The resistor string sets each comparator input at a different voltage. So for example, if RHI is at 1V, then the lower comparator will have 100mV at its positive input. The second comparator will have 200mV and so on until the top-most comparator will have the full 1V at its positive input. As the input voltage at pin 5 goes above the 100mV level, then LED1 will light. Above 200mV, LED2 will light and above 300mV, LED3 will light. This sequence will continue, with LED 10 lighting when pin 5 is at 1V. RHI can be set to a voltage using siliconchip.com.au Here’s what is inside the box: not much to it, is there? The alcohol sensor itself is on the bottom left, mounted high on PC stakes and wires so that it can peek through the case lid. The LED display is also mounted at the same height. October 2005  67 LM3914 LED V+ 10x COMPARATORS 6 RHI 11 12 13 14 – 15 16 3 λ LED3 1k 17 λ LED2 1k V+ λ LED4 1k REF ADJ R2* λ LED5 1k 8 λ LED6 1k R1* λ LED7 1k REF OUT λ LED8 1k 7 λ LED9 1k REFERENCE + VOLTAGE SOURCE 1.25V LED10 10 18 λ LED1 1k 1 λ FROM 1k 4 V+ PIN 11 RLO MODE SELECT AMPLIFIER SIGNAL IN 5 9 BAR/DOT SELECT 20k BUFFER V– 2 * R1+ R2 DETERMINE LED BRIGHTNESS Fig.1: inside (and outside) the LM39 14 LED bargraph driver. Its sole purpose is to drive a string of LEDs according to the level of the input signal. the 1.25V internal voltage reference provided between pins 7 and 8. The resistor placed between pin 7 and pin 8 sets the brightness of the LEDs. LED current through each LED will be approximately 10 times the current that flows through R1. This current also determines the voltage at pin 7 because it determines the voltage produced across R2. We set R1 at 2.7kW so that a 1.25/2.7kW or 463mA current flows through R1. LED current is therefore around 4.6mA. The 463mA also flows through R2 (3.9kW in our circuit). 68  Silicon Chip Voltage at pin 8 is therefore 463mA x 3.9kW or 1.8V. Adding this 1.8V to the 1.25V reference, we obtain 3.06V at pin 6. Therefore, our comparator resistive string is set to operate over a nominal 3.06V and with about 300mV divisions between comparators. Pin 9 of the LM3914 sets the LED mode to either dot or bar mode. It can be left open so that the LEDs light up individually, with the lower LED switching off as the higher LED switches on (dot mode). If pin 9 is connected to pin 3, then the display operates in bar mode where the lower LEDs remain lit. The circuit The circuit for the Alcohol Level Meter is shown in Fig.2. There is not too much to the circuit, with IC1 used to drive the LEDs as described above and the voltage from the alcohol sensor applied to pin 5. One of the electrodes from the sensor connects to the 5V supply and the other to the VR1 calibration resistor and series 100kW resistor. In operation, the sensor electrodes present a certain resistance at various alcohol concentrations and this resistance sets a voltage due to the divider action of VR1 and the 100kW resistor. Typically, the voltage is around 2V at the now-standard 0.05% blood alcohol concentration. The sensor is heated via the 5V supply passing current through the heater coil. The coil has a 33W resistance and so current draw is around 150mA. Combine this with the LED current of up to around 50mA (in bar mode) and there is a current requirement of up to 200mA. So battery operation is not a good idea. Power for the circuit is provided from a 12V supply. This can be from a car’s cigarette lighter socket, a 12V bench supply or a 12VDC 500mA plugpack. The supply is reverse polarity protected using diode D1 and protected from transient voltages using a series 10W resistor and the 16V zener diode, ZD1. The 100mF capacitor filters the incoming voltage. REG1 regulates the voltage down to 5V for the sensor and IC1 supply. Two 10uF decoupling capacitors are included for the output of REG1 and the LM3914. Construction The Alcohol Level Meter is constructed onto a PC board coded 05109051 and measuring 123 x 60mm. This is housed into a plastic UB3 box measuring 130 x 67 x 44mm. The board is held in place on indents in the side wall guides – no screws are used. For this reason, the corners of the PC board have to be shaped (“concaved”) so that the PC board can fit into the box. Power is connected via a figure-8 lead that either attaches to a cigarette lighter plug or a DC line socket. Begin construction by checking the PC board for any defects. siliconchip.com.au Solder in the resistors first, making sure the correct value is placed in the shown position. You can use the accompanying resistor colour code table to check values or use a multimeter. When installing the regulator and IC, make sure they are oriented correctly. A heatsink attaches to the regulator using an M3 x 10mm screw and nut. The heatsink flanges protrude toward the edge of the PC board. When mounting the electrolytic capacitors and diodes, these too must be oriented with the correct polarity – refer to the overlay diagram. Terminals for the power connection and trimpot (VR1) can also be installed now. The sensor itself can be mounted either way around, as the pin connections are symmetrical. It is mounted so that the top of the sensor is 30mm above the PC board, on PC stakes and lengths of tinned copper wire (resistor lead offcuts are ideal). The LED bargraph has long leads and can mount directly on the PC board with the top of the display also at 30mm above the PC board. Drill a hole in the box lid for the sensor and make the rectangular slot for the LED display using a series of holes along the required area, filed to shape. Also drill out a hole in the side of the box suitable for the wiring entry to the power screw connector. We used a length of figure-8 wire and a cigarette lighter plug to supply power. Alternatively, a DC line socket could be mounted on the side of the case and either a plugpack (for mains operation) or a power lead fitted with a matching DC plug could be used to connect to a source of 12V DC. REG1 7805 +5V OUT IN 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 ZD1 16V 1W 100 µF 16V GND 6 K ZD1 7 K 2.7k K 8 A IC1 LM3914 3.9k K K A 4 H A H K 5 K LED2 A λ 1 K 2 LED3 A λ 18 VR1 500k CALIBRATE LED4 A λ 17 1k B H K A LED5 A λ 16 B LED6 A λ 15 MG-3 LED7 A λ 14 K LED8 A λ 13 LEDS LED9 A λ 12 + LED10 A λ 11 K B +12V 0V K IN4004 SENSOR1 MG-3 ALCOHOL H SENSOR A 0.5W λ 10 – K – 3 OUT A D1 1N4004 +11.4V 7805 IN LED1 A 9 LINK FOR "BAR" DISPLAY; OPEN FOR “DOT” DISPLAY 100k 10 µF 16V ALCOHOL LEVEL METER SC 2005 Fig.2: it’s easy to build because there is so little in it. But it does a good job at detecting the amount of alcohol on your breath. Testing Connect power to the Alcohol Level Meter and adjust VR1 so that all the LEDs light up. If you cannot see 45kg 55kg 65kg 75kg 80kg 90kg. .05 .10 .15 .20 .25 .30 .36 .41 .46 .51 .56 .61 .66 .71 .76 .04 .08 .13 .17 .21 .26 .30 .33 .38 .42 .46 .50 .55 .59 .63 .04 .07 .11 .15 .18 .22 .26 .29 .33 .36 .40 .43 .47 .51 .55 .03 .06 .10 .13 .16 .19 .22 .26 .29 .32 .35 .37 .40 .43 .46 .03 .06 .08 .11 .14 .17 .20 .23 .26 .28 .31 .33 .36 .39 .42 .03 .05 .08 .10 .13 .15 .18 .20 .23 .25 .27 .30 .32 .35 .37 the LEDs light, check that the power supply polarity is correct. You should have 5V at the output of REG1 with respect to the ground. This 5V should BAC versus weight for MEN Weight siliconchip.com.au + GND 10 µF BAC versus weight for WOMEN No. of drinks in one hour 10Ω 100kg 110kg .02 .05 .07 .09 .12 .14 .16 .19 .21 .23 .25 .28 .30 .32 .35 .02 .04 .06 .09 .11 .13 .15 .17 .19 .21 .23 .25 .27 .29 .32 No. of drinks in one hour 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 Weight 45kg 55kg 65kg 75kg 80kg 90kg .04 .09 .13 .17 .22 .26 .30 .35 .37 .39 .48 .53 .57 .62 .66 .04 .07 .11 .15 .18 .22 .25 .29 .32 .35 .40 .43 .47 .50 .54 .03 .06 .09 .13 .16 .19 .22 .25 .26 .28 .34 .37 .40 .43 .47 .03 .05 .08 .11 .14 .16 .19 .22 .24 .25 .30 .32 .35 .37 .40 .02 .05 .07 .10 .12 .15 .17 .19 .20 .22 .26 .29 .31 .34 .36 .02 .04 .07 .09 .11 .13 .15 .17 .19 .20 .24 .26 .29 .31 .34 100kg 110kg .02 .04 .06 .08 .10 .12 .14 .16 .17 .18 .22 .24 .26 .28 .30 .02 .04 .05 .07 .09 .11 .13 .14 .15 .16 .20 .21 .23 .25 .27 October 2005  69 K LED10 LED1 K 10Ω LINK FOR BAR DISPLAY REG1 10 µF IC1 LM3914 ZD1 100 µF H 1k ON C 2.7k 10 µF CN 3.9k A CALIBRATE VR1 SENSOR1 H rab/tod B R OS NES GPL/L O H O CLA A A CN D1 C ON also be at pin 3 of IC1. Check that pin 8 of IC1 is around 1.8V and pins 6 & 7 are at around 3.1V. Before further use, the meter should be left pow- +12V ered up for about 24 hours. 0V This allows the heater inside the alcohol sensor to burn off impurities that may have collected on the sensing element during manufacture and while in storage. In fact, one of the lower green LEDs will probably remain lit for some time until the sensor has purged off sufficient impurities to raise the sensor resistance. The sensor can be tested after a few minutes of purging by waving an open bottle of methylated spirits over the sensor. Since methylated spirits is virtually pure ethanol (an alcohol), the display should immediately light the top red LED. Never drink methylated spirits, as the added methyl alcohol is poisonous. 500k 15090150 100k Fig.3: construction should be a breeze with this overlay diagram and the photo below. Note the dot/bar link pads (immediate bottom right of the IC). You should short these pads if you want a bargraph; leave them open for a dot display. Calibration The Alcohol Level Meter is calibrated by adjusting VR1 when the sensor is exposed to a concentration of alcohol in air. Calibration is not accurate and we suggest you read the WHERE can you buy A NO C NC You can get your copy of SILICON CHIP every month from your newsagent: in most it’s on sale on the last Wednesday of the month prior to cover date. You can ask your newsagent to reserve your copy for you. If they do not have SILICON CHIP or it has run out, ask them to contact Network Distribution Company in your state. K ALCOHOL/LPG SENSOR SILICON CHIP NO C NC SILICON CHIP is also on sale in all stores . . . again, you can ask the store manager to reserve a copy for you. Or, to be sure that you never miss an issue and save money into the bargain, why not take out a subscription? The annual cost is just $83 within Australia or $89 (by airmail) to New Zealand. Subscribers also get further discounts on books, and other products we sell. 70  Silicon Chip dot/bar 05109051 Fig.4: same-size PC board pattern for those who wish to make their own boards. Resistor Colour Codes 1 1 1 1 1 No. 1 1 1 1 1 Value 100kW 3.9kW 2.7kW 1kW 10W 4-band Code (1%) brown black yellow brown orange white red brown red violet red brown brown black red brown brown black black brown 5-band Code (1%) brown black black orange brown orange white black brown brown red violet black brown brown brown black black brown brown brown black black gold brown siliconchip.com.au Why does it work? How does measuring the amount of alcohol on the breath determine the amount of alcohol in the bloodstream? It’s all tied up with the way the body obtains oxygen from the air in the lungs. Once drunk (no pun intended), alcohol is absorbed into the bloodstream over the next 15-20 minutes (it actually dissolves in the water of the blood) via the stomach and small intestine – and it is neither digested (ie, like a food) nor chemically changed. The alcohol is carried by the blood and pumped around the body by the heart. All of this blood must pass through the lungs to be replenished with oxygen. Here, literally millions of tiny bloodladen vessels, called alveoli, are responsible for grabbing passing oxygen and absorbing it into the bloodstream. But if there is alcohol in the bloodstream, it is just as happy about going the other way – that is, some passes through the alveoli and evaporates into the air in the lungs. It’s not a huge amount (otherwise the lungs would fill up with alcohol!) – the ratio of alcohol on the breath to alcohol in the bloodstream is a relatively constant 2100:1. But even this tiny amount can be measured and gives a reliable indication of blood alcohol level. There are many common myths about the ability to “mask” or reduce the alcohol in the breath so that you will not fail a breath analysis. The popular TV show “Mythbusters” recently busted all of the following wide open – nothing decreased the amount of breath alcohol detected and some accompanying warning panel. You can calibrate the meter by drinking “standard drinks” as shown in the accompanying tables. You will need to drink sufficient standard drinks in one hour in order to raise the blood alcohol level to 0.05% or close to it. For example if you are an 80kg man then you will need to drink two standard drinks in an hour to raise your blood alcohol level to 0.05%. A standard drink contains 10g of alcohol such as in a 285ml glass of full strength beer, or a 30ml measure of spirits. You should wait about 15 minutes after the hour’s drinking to ensure the alcohol has entered the bloodstream. By this time, the alcohol will also be present on your breath. Blow into the alcohol sensor and adjust VR1 so that the red LED just lights. This calibrates approximately to the 0.05% level. However, actual levels really depend on many factors including how much food is also present in the stomach at the time of drinking. It is also true that this level of alcohol will have vastly different effects between individuals. Blood Alcohol Level (or BAL) (also known as Blood Alcohol Concentration, BAC) is the amount of alcohol present in the blood and is calculated by determining how many milligrams of alcohol are present in 100ml of blood. The tables earlier in this article show the expected BAL from a person who metabolises or breaks down one standard drink per hour. SC The assembled PC board mounts in the box by clicking it into the indents in the vertical guides, moulded in the sides of the case. This puts the PC board 30mm below the case lid height – coincidentally the same height we mount both the alcohol sensor and the LEDs. siliconchip.com.au actually increased it! • Fresh breath mints (no effect) • Mouthwash (increased the reading, probably due to the alcohol it contains) • Hyperventilation (either no change or increased the reading) • Placing a battery in the mouth (!) – no change • Eating a raw onion (no change – except for the breath of the eater!) • Denture cream (no change) • Placing copper coins in the mouth (dare we say it – no change for small change!) You might like to check some of these out (and other “sure-fire” methods you might hear about) with your own SILICON CHIP Alcohol Level Meter (not too sure about the battery or coins in the mouth, though . . .) Parts List – Alcohol Level Meter 1 PC board coded 05090051, 123 x 60mm 1 UB3 box, 130 x 67 x 44mm 1 MQ-3 alcohol fume sensor (Jaycar RS-5605) (Sensor 1) 1 cigarette lighter plug 1 mini heatsink, 19 x 19 x 10mm 1 2-way PC mount screw terminal block 1 M3 x 10mm screw and nut 6 PC stakes 1 200mm length of light-duty figure-8 polarised wire 1 150mm length of 0.8mm tinned copper wire Semiconductors 1 LM3914 10-LED bargraph display driver (IC1) 1 7805 5V regulator (REG1) 1 10-LED bargraph (LED1-LED10) 1 1N4004 1A diode (D1) 1 16V 1W zener diode (ZD1) Capacitors 1 100mF 16V electrolytic 2 10mF 16V electrolytic Resistors (0.25W, 1%) 1 100kW 1 3.9kW 1 2.7kW 1 1kW 1 10W 1/2W 1 500kW horizontal trimpot (code 504) (VR1) October 2005  71