Silicon ChipRapidBrake - giving the guy behind extra stopping time - July 2017 SILICON CHIP
  1. Outer Front Cover
  2. Contents
  3. Publisher's Letter: Incat’s world-class ferries / LEDs now ubiquitous for domestic lighting
  4. Feature: We visit Incat - another Aussie success story by Ross Tester
  5. Feature: LED lights/downlights and dimmers by Leo Simpson
  6. Project: RapidBrake - giving the guy behind extra stopping time by John Clarke
  7. Project: Deluxe Touchscreen eFuse, Part 1 by Nicholas Vinen
  8. Review: Tecsun’s new S-8800 "AM listener’s receiver" by Ross Tester
  9. Feature: "Over-the-Top" rail-to-rail op amps by Nicholas Vinen
  10. Serviceman's Log: Perished belts stop a cassette deck by Dave Thompson
  11. Feature: The low-cost VS1053 Arduino audio playback shield by Nicholas Vinen
  12. Project: We put the VS1053 Arduino shield to work by Bao Smith
  13. Project: Completing our new Graphic Equaliser by John Clarke
  14. Vintage Radio: The DKE38 Deutscher Kleinempfanger by Ian Batty
  15. PartShop
  16. Market Centre
  17. Notes & Errata: Improved Tweeter Horn for the Majestic Loudspeaker / Spring Reverberation Unit / 6GHz+ RF Prescaler
  18. Advertising Index
  19. Outer Back Cover: Hare & Forbes Machineryhouse

This is only a preview of the July 2017 issue of Silicon Chip.

You can view 44 of the 104 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 "RapidBrake - giving the guy behind extra stopping time":
  • RapidBrake PCB [05105171] (AUD $10.00)
  • PIC16F88-I/P programmed for RapidBrake [0510517A.HEX] (Programmed Microcontroller, AUD $15.00)
  • Rapidbrake alignment jig pieces (PCB, AUD $5.00)
  • Firmware (ASM and HEX) files for RapidBrake [0510517A.HEX] (Software, Free)
  • RapidBrake PCB pattern (PDF download) [05105171] (Free)
  • RapidBrake lid panel artwork (PDF download) (Free)
Articles in this series:
  • RapidBrake - giving the guy behind extra stopping time (July 2017)
  • RapidBrake - giving the guy behind extra stopping time (July 2017)
  • Building and calibrating the RapidBrake (August 2017)
  • Building and calibrating the RapidBrake (August 2017)
Items relevant to "Deluxe Touchscreen eFuse, Part 1":
  • Deluxe Touchscreen eFuse PCB [18106171] (AUD $12.50)
  • PIC32MX170F256B-50I/SP programmed for the Deluxe Touchscreen eFuse [1810617A.HEX] (Programmed Microcontroller, AUD $15.00)
  • 2.8-inch TFT Touchscreen LCD module with SD card socket (Component, AUD $25.00)
  • IPP80P03P4L-07 high-current P-channel Mosfet (Component, AUD $2.50)
  • LT1490ACN8 dual "Over-the-Top" rail-to-rail op amp (Component, AUD $10.00)
  • IPP80N06S4L-07 high-current N-channel Mosfet (TO-220) (Component, AUD $2.00)
  • Matte Black UB1 Lid for the Deluxe Touchscreen eFuse (PCB, AUD $7.50)
  • Software for the Deluxe Touchscreen eFuse (Free)
  • Deluxe Touchscreen eFuse PCB pattern (PDF download) [18106171] (Free)
Articles in this series:
  • Deluxe Touchscreen eFuse, Part 1 (July 2017)
  • Deluxe Touchscreen eFuse, Part 1 (July 2017)
  • Deluxe Touchscreen eFuse, Part 2 (August 2017)
  • Deluxe Touchscreen eFuse, Part 2 (August 2017)
  • Deluxe eFuse, Part 3: using it! (October 2017)
  • Deluxe eFuse, Part 3: using it! (October 2017)
Items relevant to ""Over-the-Top" rail-to-rail op amps":
  • LT1490ACN8 dual "Over-the-Top" rail-to-rail op amp (Component, AUD $10.00)
  • LT1638CN8 dual "Over-the-Top" rail-to-rail op amp (Component, AUD $7.50)
Items relevant to "The low-cost VS1053 Arduino audio playback shield":
  • Geeetech VS1053B MP3/audio shield for Arduino (Component, AUD $10.00)
Items relevant to "We put the VS1053 Arduino shield to work":
  • 20x4 Alphanumeric serial (I²C) LCD module with blue backlight (Component, AUD $15.00)
  • Geeetech VS1053B MP3/audio shield for Arduino (Component, AUD $10.00)
  • Firmware (Arduino sketch) for the VS1053 Music Player (Mega Box) (Software, Free)
  • Firmware (Arduino sketch) file for the Arduino Music Player (Software, Free)
Items relevant to "Completing our new Graphic Equaliser":
  • 10-Octave Stereo Graphic Equaliser PCB [01105171] (AUD $12.50)
  • Front panel for the 10-Octave Stereo Graphic Equaliser [01105172] RevB (PCB, AUD $15.00)
  • 10-Octave Stereo Graphic Equaliser acrylic case pieces (PCB, AUD $15.00)
  • 10-Octave Stereo Graphic Equaliser PCB pattern (PDF download) [01105171] (Free)
  • 10-Octave Stereo Graphic Equaliser front panel artwork (PDF download) (Free)
Articles in this series:
  • All-new 10-Octave Stereo Graphic Equaliser, Part 1 (June 2017)
  • All-new 10-Octave Stereo Graphic Equaliser, Part 1 (June 2017)
  • Completing our new Graphic Equaliser (July 2017)
  • Completing our new Graphic Equaliser (July 2017)

Purchase a printed copy of this issue for $10.00.

Give the guy behind you more time to pull up! by John Clarke RapidBrake EMERGENCY STOP signalling for virtually any vehicle Every time you need to brake heavily to avoid an obstruction there is a risk that a following vehicle will crash into you. But you can significantly reduce the risk of that happening with the RapidBrake. Normal brake lights won’t necessarily give other drivers sufficient warning but this easy-to-build unit will flash your hazard lights during heavy braking to give following drivers a more dramatic warning. Y ou may have noticed that some lights indicate to others that you are grab other drivers’ attention in the way modern vehicles, when braking braking but they don’t indicate how that RapidBrake will. Around 23% of all vehicle collisions heavily, will flash their brake hard you are braking – so they won’t are nose-to-tail collisions. or hazard lights at a fast rate. These collisions are more It’s called “vehicle emerlikely to happen during gency stop signalling” and rapid braking where the serves as a visual warning • Detects hard braking and warns other drivers by flashing the driver of the vehicle befor following vehicles where brake or hazard lamps hind is too close and/or they may need to quickly • Complies with Australian Design Rules 13/00 and 31/02 unaware of how hard the slow down to avoid running vehicle standards vehicle is braking. into the car in front. • Adjustable deceleration thresholds Flashing the brake or Does your car have emer• Test points and diagnostic output provided for calibration hazard lamps clearly exgency stop signalling? Prob• Onboard/off-board LED to indicate when the unit is triggered presses the sense of urably not. But you can add it • Uses a 3-axis accelerometer gency to the applied brakwith the RapidBrake and re• Compensation for up-hill and down-hill road conditions ing and may snap the duce the risk of a nose-to-tail • Can be mounted in two different orientations driver behind out of their collision. • Suitable for cars and trucks but not motorcycles trance and get them to apRemember, your brake Features 32  Silicon Chip siliconchip.com.au ply their brakes with the same vigour. RapidBrake details RapidBrake is presented as a PCB module that is housed in a small plastic case. The PCB includes an accelerometer module, processing circuitry and relays for connecting to the hazard or brake lamps. RapidBrake is intended to be installed under the dashboard, with connecting wires made to the ignition switch and chassis for power and to the brake switch or hazard lamps. Under normal braking, the brake lights will light normally and the hazard lights will not flash unless intentionally switched on using the normally dash-mounted switch. RapidBrake only starts to rapidly flash the brake lights or the hazard lights when it detects heavy braking. Whether RapidBrake flashes the brake lights or the hazard lights is your choice and is determined by how you wire it into the vehicle. Australian Design Rules RapidBrake follows the Australian Design Rules (ADR) for vehicle emergency stop signalling. These standards set the flash rate and how the rapid braking rate is detected. The permissible flashing rate is defined by “Vehicle Standard (Australian Design Rule 13/00 – Installation of Lighting and Light Signalling Devices on other than L-Group Vehicles) 2005”. The RapidBrake can be mounted in a 129 x 68 x 43mm Jiffy box – no holes are required except for a cable gland at the end and, if desired, a single “operate” LED mounted on the lid (this LED can also be externally mounted). Power is supplied via the vehicle’s switched “ignition” line. Section 6.23.7.1. of ADR 13/00 states that “all the lamps of the emergency stop signal shall flash in phase at a frequency of 4.0±1.0Hz.” However, section 6.23.7.1.1. states that “if any of the lamps of the emergency stop signal to the rear of the vehicle are filament types, the frequency shall be 4.0+0.0/-1.0Hz.” RapidBrake uses a 3.85Hz flash rate and that’s just under the 4Hz maximum for filament lamps. We chose this frequency to suit both LED and filament lamps. There are options for how rapid braking is detected. “ADR 31/02 – Brake Systems for Passenger Cars”. Section 5.2.23.1. states that “emergency stop signalling shall be activated by the application of the service braking system at a deceleration of or above 6m/s2 and de-activated at the latest when the deceleration has fallen below 2.5m/s2.” Alternatively, section 5.2.23.2. of ADR 13/00 says “the emergency stop signalling may also be activated when brakes are applied at a speed above 50km/h and the anti-lock braking system (ABS) is fully cycling. It shall be deactivated when the ABS is no longer fully cycling.” We opted not to use this alternative method as it would preclude RapidBrake from being used in a vehicle that does not have ABS. This method also requires access to digital signals that may not be available in an older vehicle. Accelerometer RapidBrake activates signalling based on detecting deceleration rates as detailed in the first option, by using a 3-axis accelerometer. This means that RapidBrake can be used in any vehicle. An accelerometer will measure the acceleration and deceleration of the vehicle together with the force of gravity. You can read more details about QuickBrake We published a related project, the Quickbrake, in January 2016. This detects if you rapidly lift your foot from the accelerator pedal and activates the brake lights well before you have time to place your foot on the brake. Quickbrake can typically provide an extra half-second of brake lights indication for the driver of the vehicle following you to take appropriate action. See: www.siliconchip.com.au/Article/9772 You could incorporate both QuickBrake and RapidBrake into the same vehicle for maximum safety. Alternatively, you can just use RapidBrake on its own if QuickBrake is not suitable for your vehicle or you prefer not to have Quickbrake. siliconchip.com.au July 2017  33 +3V VS ADXL335 OUTPUT AMPLIFIER 3-AXIS SENSOR AC AMPLIFIERS C DC DEMOD OUTPUT AMPLIFIER OUTPUT AMPLIFIER COM ~32k XOUT CX ~32k YOUT CY ~32k Z OUT CZ ST © SC 2017 Fig.1: the internals of the ADXL335 accelerometer IC. The outputs of the three MEMS capacitive linear accelerometers are amplified and demodulated, to remove the capacitor switching frequency. The resulting DC is then further amplified and fed to the output pins via nominal 32kΩ internal impedances, so that external capacitors can be used to determine the bandwidth. this in the panel opposite titled “Accelerometers”. The accelerometer we are using is a 3-axis module designed for use with Arduino (but not limited to such). It is available from Jaycar with catalog code XC4478. The module incorporates a 3V regulator and an Analog Devices ADXL335 3-axis accelerometer IC. 100nF output capacitors (CX, CY and CZ) filter the separate analog outputs for the X, Y and Z axes. Fig.1 shows the block diagram of the ADXL335 accelerometer IC. The accelerometer outputs indicate the separate components of deceleration or acceleration along the X, Y and Z axes. The readings are a result of gravity and acceleration due to changes in velocity. We only use two outputs from the accelerometer module for the RapidBrake; the Z output and either the X or Y-axis output. You get to choose which output (X or Y) is used and that depends upon the orientation of the RapidBrake unit when installed in your vehicle. The Z-axis is always used and is oriented in the up/down direction, sensing gravity and vertical acceleration. The X or Y-axis output is selected to be the one that’s oriented fore and aft inside the vehicle. Fig.2 shows the orientation of the accelerometer within a vehicle with either the X or Y outputs. The following description assumes Z VE W H IC H E LE N OR Y AX IEN T A IS IS T IO US N ED Y VEHICLE ORIENTATION WHEN X AXIS IS USED –X X Fig.2: how the X, Y and Z axes correspond to the Jaycar XC4478 accelerometer module. The Z-axis is the one perpendicular to the PCB itself. The X-axis is the is aligned with the pin header, while the Y-axis is at right angles to the other two. –Y © SC 2017 34  Silicon Chip –Z the X output is used but it works basically the same way if the Y output is used. The accelerometer X-axis is arranged to be parallel with the floor of the vehicle. On a flat road, this axis is horizontal and the accelerometer’s X output sits at a half supply voltage, indicating no acceleration/force. With the XC4478 module oriented inside the vehicle as shown, the output increases above this half supply with deceleration (slowing down) and decreases below the half supply rail under acceleration (increasing speed). Detecting the deceleration rate Detecting deceleration seems like it should be should be simple: just measure the X output voltage that is produced when braking and at a deceleration of 6m/s2, activate the emergency stop signalling. Then when deceleration has fallen below 2.5m/s2, stop the emergency stop signalling. That would be valid if the vehicle is travelling along a horizontal road, but with undulating terrain, it is not quite as easy. When the vehicle starts to go up or down a hill at a constant speed, the X output changes (even with no acceleration or deceleration). That is because the X-axis is no longer horizontal and so there is a gravity component incorporated into the X-axis reading. The X output will increase when pointed down hill and decrease when pointed up hill. That will a major effect on the X output voltage level when the vehicle is accelerating or decelerating up hill or down hill. The amount that the X output changes with angle is quite significant. If the vehicle is facing down a 37.71° hill, the 6m/s2 threshold will be reached without any braking. That would be an impossibly steep hill; for example, Sydney’s steepest hill, Attunga Street in Double Bay, has a slope of 14°. But it does indicate the magnitude of the problem; coasting down Attunga Street would still give an X output equivalent to a deceleration of 2.5m/s2. So in that case, it would only require an extra 3.5m/s2 of braking deceleration will start the emergency stop signalling. Even if the vehicle comes to a halt on that hill, the lower 2.5m/s2 threshold will not be reached and the emersiliconchip.com.au Accelerometers An accelerometer is a device that measures static and dynamic acceleration forces. Static forces are generally due to gravity while dynamic forces are due to movement. The term “accelerometer” is arguably a misnomer since it need not be accelerating or even moving to make a non-zero measurement. An accelerometer actually measures force but is calibrated in such a way that its own mass is eliminated from the reading, hence the measurements are in units of acceleration (m/s2). This is termed “proper acceleration” and is defined as the “acceleration relative to a free-fall, or inertial, observer who is momentarily at rest relative to the object being measured”; see https://en.wikipedia.org/wiki/ Proper_acceleration Consider that standing on the ground, you experience the downward force of gravity but you are not actually accelerating because the ground is pushing up on you with the exact same force, cancelling it out. But an accelerometer will still measure this gravitational force. Accelerometer output is normally calibrated to show acceleration forces in “g” units where 1g is the gravitational force experienced by an object near the Earth’s surface and equates to 9.81m/s2. Accelerometer readings can be from one of several sources. One is due to the change in speed along a straight line. So an accelerometer can, for example, measure a vehicle’s acceleration as it moves off from a standing start. It can also measure deceleration of a vehicle under braking. Note that we use the word deceleration although this is just acceleration in the opposite direction. An object moving at a constant speed but changing direction also experiences a sideways cornering force and an accelerometer can measure this too. The third measurement from an accelerometer is that due to gravity, as described above. Accelerometer measurement is along one axis only so if there is acceleration at right angles to the axis, then there will be no measurement. Many accelerometers include gency stop signalling will not cease. These would both result in the violation of ADR 31/02. The way around this problem is to also utilise the reading from the Z-axis. On a horizontal roadway, the Z-axis output will be reading the full effect due to gravity. As the angle moves off from horizontal, the Z output reading reduces in value. This reduction follows a cosine curve where the output is at its maximum (measuring the full acceleration due to gravity) for a 0° slope and the output is zero (ie, at half supply) for a 90° slope. The output is reduced by 3% for a siliconchip.com.au three separate measuring elements, so that acceleration in any direction can be measured. A 3-axis accelerometer has X, Y and Z axis outputs. The actual acceleration vector can be determined by making a vector sum of the acceleration measurements along each individual axis. So if, for example, the acceleration is along the X axis, then only the X output will show a change in reading. The Y and Z outputs will read zero. But an acceleration within the Z-plane could give a reading on both the X and Y outputs. For the RapidBrake, we use an accelerometer module available from Jaycar with catalog code XC4478. This incorporates an ADXL335 3-axis accelerometer IC. This is a MEMS (Micro-Electro-Mechanical Systems) device. It contains very small electromechanical components to make up the accelerometer sensors. A MEMS accelerometer can be imagined as a small mass attached to a spring. Added circuitry detects movement of the mass that either compresses or expands the spring, depending on the force of acceleration. The electromechanical components comprise a polysilicon sensor suspended on polysilicon springs for each of the three X, Y and Z planes. When the accelerometer sensor moves, the change in the mass position alters sensor capacitance and so provides a measurement of acceleration. For a more detailed description see www.instrumentationtoday.com/memsaccelerometer/2011/08/ We also described the operation of an accelerometer in our August 2011 article on the Digital Spirit Level project; see www.siliconchip.com.au/Article/1122 Fig.2 (opposite) shows the three axis orientations for the XC4478 module containing the ADXL335 accelerometer IC. Acceleration in the positive axis direction or deceleration in the negative axis direction produces an increasing output for that axis. 14° slope, ie, (1 – cos(14°)) x 100. Similarly, for the X output, the increase or decrease with slope follows a sine curve. The change in output is zero for a 0° slope and sees an increase of 24% for a 14° slope, ie, sin(14°) x 100. It is measuring the full acceleration due to gravity for a 90° slope (also known as a “cliff”). Although the change in the Z output for normal road slopes is small, by amplifying the Z output and doing some calculations, we can use the Z output to compensate for changes in the X output that are due to slope. So effectively, we can compute a compensated X output value that does not change with slope over a range of slope angles. This compensation does not affect the readings caused due to the vehicle’s own acceleration or deceleration. That’s because the acceleration and deceleration occurs along the Xaxis only. The Z-axis is perpendicular to the acceleration and deceleration along the X-axis and so it is not affected. We store the “quiescent” accelerometer X and Y output values, from when the accelerometer is in a horizontal position, in the microcontroller’s non-volatile memory (EEPROM). July 2017  35 These values are set during calibration. Whether the vehicle is going up or down hill is determined by comparing the X reading with the stored horizontal quiescent X value. If the X reading is greater in value compared to the quiescent, then the vehicle is facing down hill. If the X reading is less than the quiescent then the vehicle is facing uphill. The Z reading due to gravity will always be less than the quiescent horizontal Z value if the unit is not perfectly level. Since we know whether the vehicle is going up or down hill, the compensated reading is produced by reducing the X axis reading if the vehicle is going downhill or increasing it when going uphill. The amount of compensation applied is non-linear, in accordance with the fact that the Z output changes following a cosine curve and the X output following a sine curve with respect to the slope angle. In practice, a lookup table in the software is used to calculate the required compensation amount, with an adjustment included for compensation gain. The result is an acceleration/deceleration value which does not change depending on slope angle. Gain compensation is determined by the calibration procedure. This is required to account for the fact that the X output voltage at 1g may not be exactly the same as the Z output voltage at 1g. This is due to manufacturer tolerances in the accelerometer as well as differences in gain in the op amp circuits. It is the compensated value that’s compared against the upper and lower deceleration thresholds for braking, to determine whether or not to activate the emergency flashers. By the way, the fact that the X output will be using a wider part of its output range due to the effect of gravity on the readings does not affect accuracy. Linearity of the sensor is within 0.3% from 0 to 3g (3 x 9.81m/s2 or 29.4m/s2) which more than covers the range the sensor will experience during driving. Note that we don’t use the Y output to compensate for any changes in the Z-axis gravity reading output due to road camber. That’s because the accelerometer in the Y axis cannot distinguish between gravitational changes due to a slope and acceleration caused by corner36  Silicon Chip 47 +5V 100 F 10 F 100 F X OR Y SELECT JP1 +5V IC1: LMC6482AIN X X XC4478 ACCELEROMETER Y MODULE 5 Y Z 1 F 0V IC1b 6 +5V 10k X OR Y OFFSET GND TP+5V OUT VR1 10k 7 TP2 VR2 10k LP2950 IN 8 43k TP1 Z OFFSET 2 IC1a 3 2N7000 1 4 10 F D G S TP3 LED VR3 UPPER 1k K A TP GND 1N4004 A SC 20 1 7 THRESHOLD ADJUST 2 (6m/s ) K RAPIDBRAKE VR4 LOWER 10k THRESHOLD ADJUST 2 (2.5m/s ) 100nF 100nF TP4 (EMERGENCY STOP SIGNALLING) ing. While there is very little change in readings due to camber (because camber is rarely more than a few degrees), the cornering acceleration can be much higher. So using the Y output for compensation of readings could result in severe errors. Circuit details The full circuit for the RapidBrake is shown in Fig.3. The circuit comprises the accelerometer module, dual operational amplifier (IC1), microcontroller (IC2) plus a regulator, relays and associated components. The XC4478 accelerometer module is powered from a 5V supply via a series 47Ω resistor and decoupled using a 10µF capacitor, forming a low-pass filter which rejects supply noise. The module contains its own 3.3V lowdropout regulator. The Z output is filtered using a 10µF capacitor that effectively gives the output a one-second response to variations in acceleration, in combination with the 32kΩ resistance built into each of the accelerometer IC’s outputs. Amplifier IC1a provides gain for the module’s Z-axis output signal, with VR1 allowing its DC offset voltage to be adjusted. Gain is typically around 9 times and is dependent upon the 43kΩ feedback resistor and the setting of VR1. JP1 is used to select which of the X or Y output is fed to the microcontroller from the accelerometer module. The selected output is output is filtered using a 1µF capacitor that effectively gives a 100ms response to variations in acceleration. Amplifier IC1b provides gain for this signal with VR2 setting the DC offset and adjusting the gain all at once. Gain is typically around 3 times and is dependent upon the 10kΩ resistor value and the VR2 setting. The acceleration signals are monitored at the analog inputs AN2 and AN3 of microcontroller IC2. IC2’s firmware uses its internal analog-todigital converter (ADC) to convert siliconchip.com.au REG1 LP2950ACZ-5.0 +5V OUT IN D3 1N4004 V+ K CON4 A +12V IGN K GND 100nF 47 ZD1 100 F 16V 1W A 100 F 100nF 0V 10k 3 2 1 Vdd RA5/MCLR RB4 RA4 RB3 AN3/RA3 RA1 10 LED1 AN2/RA2 470 6 COM K NC D1 1N4004 RA0 RB5 RB1 AN6/RB6 K RELAY 1 A TP5 D 47 16 IC2 RA7 PIC16F88 PIC1 6F8 8 15 –I/P OSC2 12 NO A MONITOR RB0/PWM 13  K 9 18 CON1 CON5 G S RELAY 2a CON2 47 17 NO COM 11 7 JP2 QUIESCENT SET JP3 NC K D2 1N4004 A NC UP/DOWN AN5/RB7 RB2 Q1 2N7000 RLY2 4 A RLY1 14 8 D CALIBRATE Vss 5 G S COM NO Q2 CON3 2N7000 RELAY 2b Fig.3: complete circuit for the RapidBrake. Two of the analog outputs of the accelerometer module are fed to dual op amp IC1a and IC1b which amplifies them and those amplified signals are then fed to two analog inputs of microcontroller IC2. Trimpots VR3 and VR4 feed two other analog inputs, to set the upper and lower deceleration trigger thresholds respectively. If triggered, output pins RA0, RA1 and RA7 combine to flash LED1, switch on RLY1 and switch RLY2 on and off at just under 4Hz. the voltages at these inputs to digital values. After compensating the X or Y signal at the AN3 input using the Z signal at the AN2 input, the resulting value is compared against the settings from VR3 and VR4. VR4 sets the upper 6m/s2 threshold for braking, while VR4 sets the 2.5m/s2 lower braking threshold. VR3’s wiper connects to the AN6 analog input of IC2, while VR4’s wiper connects to the AN5 input. The voltages at these inputs are converted to digital values in a similar way as for the AN2 and AN3 inputs. Note that VR4 connects between the wiper of VR3 and the 0V supply rail. This means the wiper of VR4 can only range between 0V and up to the wiper voltage set by VR3. This is done so it is impossible to have the lower threshold set by VR4 any higher in voltage than the upper threshold set by VR3. During emergency stop signalling (after the upper threshold is reached), siliconchip.com.au the RA1 output is switched low (toward 0V) and high (toward 5V) at 3.85Hz to flash LED1 which is blue. Note that an off-board LED can be used instead, connected via CON5. If an external red or yellow LED is used, Where do you get those HARD-TO-GET PARTS? Many of the components used in SILICON CHIP projects are cutting-edge technology and not worth your normal parts suppliers either sourcing or stocking in relatively low quantities. Where we can, the SILICON CHIP PartShop stocks those hard-to-get parts, along with PC boards, programmed micros, panels and the other bits and pieces to enable you to complete your SILICON CHIP project. SILICON CHIP PARTSHOP www.siliconchip.com.au/shop it will shunt LED1’s current and so the external LED will light but LED1 will not, because a red or yellow LED has a lower forward voltage than a blue type. Or alternatively, simply omit LED1 and use whatever colour of external LED you want. Output RA0 is driven identically to RA1, to drive the gate of Mosfet Q2 which switches RLY2 on and off at The RapidBrake circuitry (including the accelerometer) is all mounted on a single PCB measuring 106 x 58.5mm (shown here about life size). All connections are made via the terminal blocks on the right side. Complete constructional details and setup will be presented next month. July 2017  37 3.85Hz. At the same time, output RA7 goes high while RA0 and RA1 are being pulsed. RA7 drives Mosfet Q1 to switch on RLY1. RLY1 is therefore latched for the entire duration of the emergency stop signalling period; it does not switch on and off at 3.85Hz. So why have two relays? Relay RLY1 is used when the hazard lights are used for emergency stop signalling. It’s used to disconnect the normal control signals from the indicator lamps, so that they do not interfere with the RapidBrake’s use of those same lamps. While RLY1 disconnects those lamps from the vehicle, RLY2 then switches them on and off at 3.85Hz. Alternatively, if the brake lights are being flashed, RLY1 is not used and RLY2 flashes the brake lights at 3.85Hz; they will have already been switched by the brake pedal switch. When deceleration drops below the lower threshold, output RA1 goes high to switch off LED1 and outputs output RA0 & RA7 go low to switch off the two relays. Diodes D1 and D2 quench the voltage spike that occurs when the relay coils are switched off. Calibration circuitry Parts list – RapidBrake 1 1 1 1 1 3 2 1 1 2 1 2 4 4 4 7 double-sided PCB coded 05105171, 106 x 58.5mm UB3 plastic utility Jiffy box, 129 x 68 x 43mm (Jaycar HB-6023, Altronics H0153) 3-axis accelerometer module (Jaycar XC-4478) 12V SPDT 10A relay (Jaycar SY-4050, Altronics S4197) (RLY1) 12V DPDT 5A relay (Jaycar SY-4052, Altronics S4270A) (RLY2) 3-way screw terminals with 5.08mm spacing (CON1-CON3) 2-way screw terminals with 5.08mm spacing (CON4,CON5) 18-pin DIL IC socket 8-pin DIL IC socket (optional) cable glands for 6mm diameter wiring snappable 10-way pin header (JP1-JP3) 2-pin shorting plugs 6.3mm long M3 tapped Nylon spacers M3 x 6mm machine screws M3 x 5mm machine screws PC stakes (TP1-TP5,GND & +5V) Semiconductors 1 LMC6482AIN dual CMOS op amp (IC1; Jaycar ZL3482) 1 PIC16F88-I/P microcontroller programmed with 0510517A.hex (IC2) 1 LP2950ACZ-5.0 5V low drop out regulator (REG1; Jaycar ZV1645) 2 2N7000 NPN Mosfets (Q1,Q2; Jaycar ZT2400) 3 1N4004 1A diodes (D1-D3) 1 16V 1W zener diode (ZD1) 1 3mm blue LED (LED1) Capacitors 4 100µF 16V PC electrolytic 2 10µF 16V PC electrolytic 1 1µF 16V PC electrolytic 3 100nF MKT polyester 1 100nF ceramic There are several jumper links to provide for calibration. JP2, for example, is used to set the quiescent voltage reading at AN2 and AN3, with the accelerometer module on a level surface. This provides the reference voltages against which the software calculates change in voltage from the Z output and the X or Y output for angles off horizontal. We’ll look at calibration in more detail once we have finished the construction details next month. REG1 is protected against transients (a vehicle supply is never “clean”!) using a 47Ω resistor from the V+ supply, a 100µF bypass capacitor and zener diode ZD1 that clamps its input voltage at 16V. Power supply Next month Power for the RapidBrake comes via the vehicle’s ignition switch and passes through diode D3 to provide the supply for the relay coils (V+). REG1 is used to provide a stable 5V rail for op amp IC1 and microcontroller IC2. This is important to maintain accelerometer accuracy since the output voltages of dual op amp IC1 are supply dependent, since VR1 and VR2 connect across the 5V supply. The ADC in IC2 also uses the 5V rail as a reference voltage. If you’re interested in building the RapidBrake, you can order the PCB from the SILICON CHIP online shop (catalog code SC4321) and start gathering 38  Silicon Chip Resistors (0.25W, 1%, through-hole) 1 43kΩ 2 10kΩ 1 470Ω 4 47Ω 3 10kΩ top adjust multi-turn trimpots (VR1,VR2,VR4) 1 1kΩ top adjust multi-turn trimpots (VR3) the parts, as laid out in the parts list in this issue. The programmed PIC is also available from the SILICON CHIP online shop (catalog code SC4322); all other components should be readily available from your normal suppliers. Next month we’ll go through the process of assembling the PCB, calibrating it, putting it in the case, mounting it in the vehicle, wiring it up and SC testing it. Resistor Colour Codes     No. 1 2 1 4 Value 43kΩ 10kΩ 470Ω 47Ω 4-Band Code (1%) yellow orange orange brown brown black orange brown yellow purple brown brown yellow purple black brown 5-Band Code (1%) yellow orange black red brown brown black black red brown yellow purple black black brown yellow purple black gold brown siliconchip.com.au