One-touch turn signal module (PN version)

From E31Wiki
Jump to: navigation, search
Turn signal diagram (PN version)

The one-touch turn signal (OTTS) module enhances the functionality of the turn signal lever by adding a mode where a single touch makes the indicators blink for a certain number of times. This behavior is also known as lane change turn signal or comfort blinker. This sub-article describes one of the variants of the OTTS module, the PN version. This variant is for electrical systems where the shared contact of the turn signal lever switch is connected to the positive terminal and the flasher relay switches the turn signal lamps between lamp and negative terminal. For more information or other variants refer to the one-touch turn signal module main article.

Hardware

Circuit diagram

As is the case with many microcontroller based projects the circuit diagram is rather simple. Since all logic is inside the controller's program memory, the diagram does not reveal much of the working.

Circuit diagram (PN version)

The heart of the diagram is IC1 – the microcontroller. The OTTS module is built around an Atmel ATtiny24, an inexpensive yet versatile microcontroller. IC2 is a LM2931Z-5 low-dropout voltage regulator and supplies the Atmel microcontroller with a stabilized 5 V. This isolates the sensitive controller from the hostile power environment of the car and ensures stable operation. The rest of the circuit is less critical and operates directly at the 12 V battery voltage.

Left from the controller are the inputs. Four-way DIP switch S1 is used to select the presets for the comfort mode and the canceling. Inputs IN_LEFT and IN_RIGHT are connected to the turn signal lever switch, and IN_LEFT_INDICATOR and IN_RIGHT_INDICATOR are connected to the output of the car's flasher relay. Unlike most other comfort blinker modules the OTTS module does not solely rely on the microcontroller's internal clock or an external crystal clock for the timing, but also uses the car's flasher relay output to the indicators to provide exact blink count and full flash functionality. Where all other inputs and outputs are usually easily accessible in the vehicle's steering column, the two indicator signals may be difficult to get to.

On the right side of the controller are both output stages – the bottom half is the same as the upper half but drawn mirrored. Switching is performed by P-channel MOSFETs T3 and T4. MOSFETs are reliable and inexpensive solid state devices that can switch large currents. To switch small currents MOSFETs may be overkill but the module is designed to be universally applicable. For this virtually every modern MOSFET can be used. Just make sure to use P-channel MOSFETs in a TO-220 package with a maximum gate-source voltage VGS of over -15 V. Pick whatever is cheap and available. The parts list further down shows a few popular types.

If the module has to switch heavy loads, the MOSFET internal resistance RDSon plays an important factor in the choice of MOSFET. The higher RDSon the more heat is dissipated in the MOSFET for a given current. The TO-220 package can dissipate up to 2 W without heat sink, but it is recommended to stay below 1 W when the module is mounted in a small closed box. For example for a current of 5 A the maximum RDSon at 1 W can be calculated as follows:

OTTS00.png

Where:

  • RDSon: MOSFET internal drain-source resistance [Ω]
  • PF: MOSFET power dissipation [W]
  • ID: Current [A]

Thus to switch the 5 A load, MOSFETs with RDSon of 0.04 Ω or lower must be chosen – for example the International Rectifier IRF4905PBF P-channel MOSFET with RDSon of 0.02 Ω.

The efficiency of most MOSFETs is best when the gate-source voltage VGS is 10 V or more but the Atmel microcontroller operates at only 5 V. Therefore each MOSFET is driven by a simple common emitter circuit around transistors T1 and T2. When the output stage gets a high signal from the microcontroller, current flows through the base of the transistor, driving it into saturation and making it conduct. This pulls the MOSFET gate to the ground. Since the MOSFET source is connected to the 12 V battery voltage, the voltage over gate and source (VGS) is now 12 V. The MOSFET conducts and current can flow through the load. When the microcontroller outputs a low signal, the transistor does not conduct and the MOSFET gate and source are both at 12 V. VGS is then 0 V and the MOSFET does not conduct.

LEDs D1 and D2, and their current-limiting resistors R13 and R14 are optional. The LEDs provide visual feedback of the outputs which may come in handy when diagnosing but are otherwise not needed. Zener diodes D3 and D4 protect the MOSFETs' gate (input) against overvoltages and diodes D5 and D6 protect the MOSFETs against reverse polarity kickback voltages from inductive loads like relays. In the BMW 8 Series the OTTS module doesn't drive relays but it's not recommended to omit D5 and D6. When the module has to drive large relays with nominal coil currents over 150 mA, it is recommended to use a 1N4007 diode or equivalent instead of the default 1N4148 for D5 and D6.

PCB layout

The OTTS module is designed on a piece of prototyping board with single islands and standard 0.1" pitch. As the name already implies, prototyping board is meant for circuits in development and not final designs. It doesn't look professional and is more time-consuming to solder because all traces must be soldered by bridging islands. However, prototyping board is readily available in electronic components stores and does not require special tools to develop printed circuit boards (PCB). If you have the means to develop PCBs you should also be able to route a neat PCB layout.

PCB layout (PN version). Caution: the solder side layout (left) is mirrored!

Parts list

  • R1, R2, R7..R10: Resistor 10 kΩ
  • R3..R6: Resistor 47 kΩ
  • R11, R12: Resistor 1 kΩ
  • R13, R14: Resistor 2k7 Ω (optional – see text)
  • C1, C3: Capacitor 100 nF
  • C2: Electrolytic capacitor 100 µF 25 V
  • D1, D2: LED 3 mm round (T1) (optional – see text)
  • D3, D4: Zener diode 15 V 500 mW or equivalent
  • D5, D6: Diode 1N4148 or equivalent (see text)
  • T1, T2: Transistor BC547 or equivalent
  • T3, T4: P-channel MOSFET Fairchild Semiconductor FQP7P06, International Rectifier IRF9520NPBF, International Rectifier IRF9530NPBF, International Rectifier IRF5305PBF or equivalent (see text)
  • IC1: Atmel ATtiny24-20PU
  • IC2: Voltage regulator LM2931Z-5
  • S1: 4-way DIP switch
  • J1..J3: Jumper wire
  • K1: 8-way screw terminal block 0.2" pitch 100 mm height (e.g. 2 x 3-way and 1 x 2-way) (see text)

Source code and binary

Download the source code and binary for the microcontroller:

One-touch turn signal module source code and binary (PN version)

A programmer, like the excellent low-cost Atmel AVR Dragon is required to upload the binary to the Atmel controller. The source code is written for the Atmel ATtiny24 microcontroller, but it can easily be adapted for other Atmel AVR series controllers – provided they have enough in- and outputs. The OTTS module requires two outputs, four inputs for the turn signal lever and indicators and an additional four inputs for the DIP switch. The ATtiny24 offers 12 in- and outputs. Those who route their own PCB can opt for a different Atmel AVR controller or the same controller in a smaller surface-mount technology (SMT) package. The source code is written in C. The Atmel AVR Studio coupled with WinAVR is a nice integrated development environment with C compiler for the Atmel AVR device series.

Installation

Put the OTTS module in a small plastic enclosure. Choose one that offers inner dimensions just slightly larger than the OTTS module. It's a good idea to pad the inside of the enclosure with foam to prevent the circuit board from rattling while driving. Be careful with padding when the MOSFETs switch large currents and become hot!

Wiring

The OTTS module has eight wires that need to be connected to the car's electrical system. Most of these wires can be connected in or near the steering column in most cars – usually easily accessible. The two indicator inputs may be more difficult to wire up. Disconnect the batteries before installing the module to avoid accidental short circuits!

Wiring of the OTTS module (PN version)

The OTTS module as shown here is built with screw terminal blocks for the wiring. This may not seem like a good choice in environments that are exposed to continuous vibrations and shocks, but a good screw terminal is very secure. Contrary to popular belief it is important not to tin the wires when using screw terminals. Tinning stranded wires in a screw terminal is a recipe for problems. It will come loose sooner or later – no matter how hard the screws are fastened! It is recommended to use wire ferrules for the most reliable connection. Alternatively the screw terminal blocks can be omitted for PCB terminal pins to which the wires can be soldered for a secure connection.