U D CU
Usually, cars do not have a lamp to light the engine compartment. A hands-free, under- hood light source is useful when it is dark and you have to fix a problem inside the engine compartment.
Here is a small circuit that automatically switches on a light source (12V bulb) to light the engine when the bonnet is lifted. The control circuit comprises an Attiny13 microcontroller (IC1), a four-pin tilt sensor which consumes very little power, regulator 7805 (IC2) and a few discrete components. It is powered by the car battery.
Microcontroller Attiny13
The Attiny13 is an 8-pin, low-power CMOS 8-bit microcontroller based on the AVR enhanced RISC architecture. By executing powerful instructions in a single clock cycle, it achieves throughputs approaching 1 MIPS (million instructions per second) per MHZ, allowing the system designer to optimise power consumption versus processing speed.
The AVR core combines a rich instruction set with 32 general-purpose working registers. All 32 registers are directly connected to the arithmetic logic unit (ALU), allowing two independent registers to be accessed in one single instruction executed in one clock cycle.
The microcontroller has 1 kb of in- system programmable Flash memory, 64 bytes of EEPROM, 64 bytes of SRAM, six general-purpose input/output (I/O) lines, one 8-bit timer/counter with compare modes, internal and external interrupts, a 4-channel, 10-bit analogue-to-digital converter ( ADC), a programmable watchdog timer with internal oscillator, and three software-selectable power-saving modes. The idle mode stops the CPU while allowing the SRAM, timer/ counter, ADC, analogue comparator and interrupt system to continue functioning. The power-down mode saves the register contents, disabling all chip functions until the next interrupt or hardware reset. The ADC noise reduction mode stops the CPU and all I/O modules, except ADC, to minimise switching noise during ADC.
Tilt sensor
A tilt sensor is a device that detects orientation or inclination with angular movement. It is small, inexpensive, low-power and easy-to-use. If used properly, it will not wear out. Simplic- ity makes it popular for toys, gadgets and appliances. Sometimes it is referred to as mercury switch, tilt switch or rolling ball sensor.
Tilt switches transfer a change-ofstate to another device. The control device receives a signal from the tilt sensor whenever there is a change in motion or orientation. The signal activates the controller to turn the appliance either on or off. Tilt switches are made of non-conductive tubes that have two or more electrical contacts and a material which acts as a conductor between these electrical contacts.
There are two types of tilt switches: mercury switch and ball- in- cage switch.
Mercury switch. It uses a drop of mercury in the tube. The sensor is positioned with respect to gravity forces so that when mercury moves away