This is only a preview of the August 2017 issue of Silicon Chip. You can view 48 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 "An Arduino Data Logger with GPS":
Items relevant to "Mains Power Supply for Battery Valve Radio Sets":
Items relevant to "El Cheapo Modules: Li-ion & LiPo Chargers":
Items relevant to "Deluxe Touchscreen eFuse, Part 2":
Items relevant to "LTspice Part 2: Simulating and Testing Circuits":
Articles in this series:
Items relevant to "Building and calibrating the RapidBrake":
Purchase a printed copy of this issue for $10.00. |
RapidBrake
EMERGENCY STOP signalling for virtually any vehicle
Give the guy behind you
more time to pull up!
PART 2 –
by John Clarke
Last month we described how this project uses an accelerometer module to
detect heavy braking and then flash the brake lights or hazard lights. This will
give a dramatic warning to following drivers, so that they can avoid running
into you. This month we give the assembly details for the PCB, show the various
wiring permutations for brake and hazard lights in most vehicles and the set-up
procedure to make sure that the signalling is triggered under heavy braking.
A
ll the components for RapidBrake are assembled
onto a single PCB, coded 05105171 and measuring
106 x 58.5mm.
This is housed in a plastic utility box measuring 129 x 68
x 43mm (Jaycar HB-6023 or Altronics H0153). The 3-axis
accelerometer module (Jaycar XC-4478) is also mounted
on the PCB.
Follow the diagram of Fig.4 when installing the parts.
You can install the resistors first.
The colour codes for the resistors are shown in table on
page 38 of last month’s issue. A digital multimeter should
also be used to check the values of each resistor since some
of the codes can be hard to decipher.
Diodes D1, D2, D3
and ZD1 are the
next to be installed
and these need to
be inserted with
the correct polarity
with the striped end
(cathode, k) oriented as shown in the
overlay diagram.
We recommend
using an IC socket
for the PIC micro,
IC2. IC1 can be directly soldered to
82 Silicon Chip
the PCB or you can also use an IC socket. Take care with
orientation when installing the sockets and when inserting the ICs.
There are seven test points and you can install PC stakes
for these if you prefer. These test points are located at TP1TP5, GND & +5V. Install the two 3-way headers for JP1 and
JP3 and the two 2-way headers for JP2 and the shunt keeper.
The capacitors can be installed next. The electrolytic
types must be oriented as shown and note that a ceramic
100nF capacitor is located near the cathode of D2. The remaining 100nF capacitors are MKT polyester.
Then install Mosfets Q1 & Q2 and also REG1 and take
care not to mix them up as they each use the same package.
Trimpots VR1 to VR4 are next.
VR1, VR2 and VR4 are 10kΩ and
may be marked as 103. VR3 is a 1kΩ
trimpot that may be marked as 102.
These are oriented with the adjusting screw as shown.
Install the
XC-4478 accelerometer module by passing its five header
pins through the allocated holes
on the PCB. Then solder the
header pins while ensuring the
module is close to and parallel
with the PCB.
siliconchip.com.au
Fig.4 (below): the same-size component
overlay for the RapidBrake with its
connections shown – use these in conjunction
with Figs.6-8 overleaf, depending on which
wiring you choose. A same-size matching
photo (at left) will also guide you with
construction. We recommend the use of
sockets to mount both ICs – just make sure
the orientation is correct! Incidentally, there
are some minor differences between the
prototype photograph and the final version.
This step is most important because we rely on the fact
that the horizontal axis of the accelerometer is parallel to
the PCB – so don’t mount it crookedly!
CON1 to CON5 can now be installed. CON1-CON3 are
3-way types and CON4 and CON5 are 2-way. CON1-CON4
are firstly connected together by using the dovetail mouldings on the side of each connector to slide the parts together. Install them with the wire entry closest to the edge
of the PCB.
The optional CON5 (for an external LED, if required) is
Fig.5: these diagrams have the correct angles for the
6m/s2 slope adjustment (below) and the 2.5m/s2
slope adjustment (below right). Our original
idea was for readers to photocopy these
and use them as a template (which you
can still do if you wish) but we then
made a laser-cut jig which
makes the whole
/s
operation much
6m
easier (see
overleaf).
2
also installed with the wire entry to the outside edge of the
PCB, as shown in the photos and Fig.4.
Finally, LED1, RLY1 & RLY2 can be installed. LED1 is
placed with the top of its lens no higher than the top of
the relays.
Carefully check that all components are correctly installed and soldered.
Testing & setting up
Make sure IC2 is out of circuit and connect a 12V supply
to the CON4 terminals. Check that there is close to 5V between the GND and +5V test points (left side of PCB). The
voltage should be between +4.925V to +5.075V.
If all is correct, switch off power and install IC2. If the
voltage is incorrect, check that the LP2950ACZ-5.0 regulator is placed in REG1’s position and that the leads are
soldered in correctly.
You need to install the PCB in the plastic box before you
can set it up. Insert the PCB into the box and mark out the
mounting hole positions on the base. Drill them to 3mm.
t
on
Fr
2
/s
2.5m
9.81m/s2
=1g
37.71
siliconchip.com.au
Upper Threshold slope
Front
14.76
9.81m/s2
=1g
Lower
Threshold slope
August 2017 83
Fitting the
completed PCB
inside the case.
It must be in the
case before the
compensation
and calibration
procedure can
be commenced.
Attach the PCB to the box using four 6.3mm tapped spacers.
One or two holes are also required at one end of the box
for the cable glands. If you are wiring to the brake switch,
only one cable gland will be required. For wiring to the
hazard lamps you will find it easier to use
two cable glands to allow for the extra
wiring.
Initially, you need only the wires
for +12V and 0V (GND) connected
to CON4.
The first step is to select the X or
Y output of the accelerometer module to be monitored by the RapidBrake
circuit. This gives you the option of having the long axis of the PCB (box) aligned
with the long axis of the vehicle if you use the X output or
having the long axis of the PCB aligned across the vehicle
(ie, the short axis).
So you should place the shunt in the X or Y position of
JP1 accordingly.
Power up the PCB and LED1 should light for about one
second. Then wait several seconds (with the box sitting
on a horizontal surface) and adjust VR1 so that voltage be-
tween GND and TP1 is around 4V. Similarly, adjust VR2
for about 2.5V at TP2.
These voltages are not critical but should be set to within
about 200mV of the stated values.
Compensation/calibration jig
To do the adjustments for compensation and calibration,
you will need two templates which match the angled slopes
shown in Fig.5: one for the 6m/s2 upper adjustment and
the other for the 2.5m/s2 adjustment.
These can be photocopied and glued or taped to cardboard and cut to shape to make the sloped templates.
However, as we went through the process for doing these
adjustments, it became obvious that manipulating the plastic case and template and adjusting trimpots while monitoring voltages on the PCB with a multimeter was well-nigh
impossible – you need four hands!
Since none of the SILICON CHIP staff actually have four
hands, we decided to design and laser-cut a jig which
would making holding the box at the required angles easy.
We have included pictures of the components of the jig,
the jig in assembled form and how the jig is used for the
various measurements.
To make our life a little easier, we designed this jig for adjustments on the X-axis, and laser-cut it from polycarbonate. The
cut sections are shown at left with the assembled jig at right (see the photos which explain how we used it). We figured it
would also make our readers’ lives easier – so we’ve made it available from the SILICON CHIP online shop. (Cat SC4345).
84 Silicon Chip
siliconchip.com.au
The parts for the jig are available at low cost (just $5.00
plus p&p) from the SILICON CHIP on-line shop and they
just clip together.
Quiescent output adjustment
OK. So connect a 12V supply and monitor TP1 again
with your DMM. We now need to find the angle of tilt for
the Z-axis reading where the voltage is at its maximum.
Ideally, this should be when the box is on a horizontal
surface but it may be very slightly off from horizontal due
to slight misalignment of the accelerometer PCB and/or
the accelerometer IC.
Step 1: If the jumper at JP1 is set for the Y-axis, go to step
2. If the jumper is set for the X-axis, as before, slightly
angle the box up a little at the CON1-CON4 end and then
up a little at the IC1 end to find the angle
where TP1 shows maximum voltage.
You can use a piece of thin plastic
to prop the PCB at this angle (we
used the lid of the box as it was
handy). Now go to Step 3.
Step 2: If the jumper at JP1 is set for the Y-axis, again using
the box lid or something similar, tilt the PCB slightly at
the trimpot side and then at the CON5
side to find the angle where the TP1
voltage is at maximum.
siliconchip.com.au
Step 3: Now, making sure the PCB is kept very still, insert
a shorting jumper at JP2. You have one second before
the voltages at TP2 and TP1 are stored
inside IC2. These are the quiescent
voltages for the accelerometer.
LED1 will light up once the
values are stored and the jumper link can then be removed. If
you need to measure and store
the quiescent voltages again, reinstall the jumper.
Tilt compensation
Step 4: Compensation for tilt is done with a
jumper shunt in the UP/DN position of JP3. This allows
the gain of the compensation to be adjusted while angling the PCB to simulate a sloped road.
If JP1 is set for the X-axis, the case
is angled up at the CON1-CON4
end and then up at the IC1 end
by about 15° each way from horizontal.
If JP1 is set for the y-axis, angle the case up at the trimpot side and then up at the CON5 side by about 15° from
horizontal in each direction.
The first photo shows the case sitting on the low level
of the jig, corresponding to an angle of very close to 15°
(14.76° to be precise).
Use your multimeter to check if the voltage at TP5
remains relatively constant for the ±15° range. Trimpot
VR3 is adjusted to give the required compensation gain.
Set VR3 so the variation in voltage over the ±15° range
is less than 100mV in each direction.
There shouldn’t be a variation of much more than
August 2017 85
Fig.6: shows the wiring for positive (left) and negative (right) brake lamp switching arrangements. The common
(COM) and normally closed (NC) contacts of RLY2 are connected in series with the brake switch in both cases.
100mV in each slope direction over
the full 37.71° range (corresponding to the 6ms/s2 slope in the diagram of Fig.5).
Note however, that you will need
to change the angle of the case very
slowly, since the Z output reading
is averaged out and so will not provide an immediate compensation of
the X or Y output.
When the adjustment is satisfactory, remove the jumper from
the UP/DN position. The compensation gain value will be stored in
memory. Readjustment of VR3 in
the next calibration step will not
alter the compensation.
Deceleration calibration
Step 5: This step sets the 6m/s2 and
2.5m/s2 deceleration thresholds.
Initially set TP3 to 3.3V, by adjusting VR3. Similarly, set TP4 to 2.8V,
using VR4.
Place the shorting shunt for JP3
in the Calibrate position. In this
position, the TP5 output shows the
measured voltage of the X or Y signal and this is without any slope
compensation.
This voltage is compared against
the VR3 and VR4 trimpot settings
that provide the upper and lower
braking thresholds. When the TP5
voltage is above TP3,
this will initiate the
emergency brake
signalling.
The emergency brake signalling will cease
once the TP5
voltage drops below TP4.
86 Silicon Chip
In practice, RapidBrake is placed
on the sloping planes of the test jig
to set the upper and lower thresholds, as shown in our photos.
In each case, the little arrow for
the X-axis (or Y-axis if that it what
you have selected) needs to point
up the slope. Hence, when you install the RapidBrake in the vehicle,
that arrow should point to the back
of the vehicle.
Step 6: VR3 is adjusted so the LED
starts flashing when RapidBrake is
raised just a little higher than the
slope for 6m/s2.
Step 7: adjust VR4 so the LEDs stop
flashing just before RapidBrake is
placed on the lower slope that is
equivalent to 2.5m/s2 deceleration.
That completes the calibration for
RapidBrake. The jumper can be removed and placed in its keeper position located above JP3.
Installation & lamp wiring
Regardless of whether you have
selected JP1 for monitoring the X or
Y-axis of the accelerometer, the case
must installed parallel to the floor of
the vehicle.
You can install a red, orange or green
LED for the emergency brake indication on your vehicle’s dash, wired to
CON5 so it that connects in parallel
with LED1.
LED1 is a blue LED and has a nominal 3.3V drop across it when lit. A red,
orange or green LED has a voltage drop
of 1.8 to 2V drop and it will effectively
disable the blue LED. Make sure the
LED polarity is correct. The longer lead
on the LED is the anode.
The +12V terminal should be con-
nect to the switched side of the ignition
so that power is only supplied when
the ignition is switched on. The GND
wire should be terminated to an eyelet for the screw connection to chassis.
As previously noted, you can connect either the brake lamps or hazard
lamps for emergency brake indication.
The brake lamp option is the easiest to do but it does not have the same
dramatic impact as having the hazard
lamps flash repeatedly when the brake
lamps light up.
Fig.6 shows the wiring for positive
and negative brake lamp switching
arrangements. The common (Com)
and normally closed (NC) contacts of
RLY2 are connected in series with the
brake switch.
That way, the brake lamps will be
switched on normally with the brake
pedal switch, but will flash when RLY2
is switched on and off during emergency stop signalling.
Use 5A-rated automotive wire for
the connections.
Fig.7(a) shows the wiring for the hazard lamps for negative side switching
(ie, all lamps are connected to +12V).
Fig.7(b) shows the detail for for positive
switched lamps. In both cases, RLY1
isolates the connection to the indicator and hazard lamp flasher unit during emergency stop signalling.
For the negatively switched version
RLY1 intercepts the connection from
the + terminal of the flasher and the
common of the indicator switch. For
the positive switched lamps (Fig.7(b))
wiring diagram, RLY1 intercepts the C
connection of the flasher to the Common of the indicator switch.
When RLY1 is switched on, the hazard lamps are temporarily prevented
siliconchip.com.au
Fig.7(a): wiring for hazard lamps switched on the negative side
Fig.7(b): similarly, wiring for hazard lamps switched on the
positive side
from operating and RLY2 then flashes
them independently of traffic indicator operation. The double pole contacts
for RLY2, switch the left and right side
indicator lamps separately.
Note that some vehicles may drive
their indicators in a different manner, eg, with individual lines from the
siliconchip.com.au
body computer driving the lamps on
each side or even controlling them via
CANbus. So before you go to wire your
vehicle up, check its service manual.
If the two sides are driven independently, you will need to drive a DPDT
relay with the RLY1 outputs to disconSC
nect both at the same time.
August 2017 87
|