Window closing module with current measurement for ACS712

Status
Not open for further replies.

Vermes

Advanced Member level 4
Joined
Aug 2, 2011
Messages
1,163
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,316
Activity points
22,318


In some vehicles, there are two electrically operated windows. When they are not working, there are masses on the both lines of the motors. Control of such a window is implemented using a single dual relay connected in the bridge.



Entering voltage on one of the coils results in switching one of the poles of the motor to 12V. At the other, the mass is still and the motor turns in either direction. In this device, two relays directly wired were used with a current of switching 25A.
Closing the window is disconnecting one of the motor poles from the original driver and connecting it to 12V. Specialized systems for measuring current were used. They act on the principle of magnetic field sensors ACS712ELCTR-20. The sensor has a 0-5V output, where at zero current it gives equal half the supply voltage (2,5V). The system enables the measurement of both sides.
The module has three inputs – two active mass serve to start closing and possibly stop the process, and one blocking 12V the ignition so that the system was not working when the ignition turned on. OC output of the module is switched on 30s after the closure of the other window and it is a signal for closing the sunroof. Linear stabilizer 7805 was applied in the board. Processor and ACS are powered with this voltage. 5V is a standard in automotive electronics. Outputs to the windows are two wires on each motor – one input from the original module and a second output of the motor. ACS has detachable power supply via P-MOSFET to reduce the current consumed by the system when not in use. Of course the processor is put to sleep and awakened every 100ms to check the input states. The whole system takes approximately 5mA in idle mode, about 25mA when measurement started and about 70mA with one of the relays activated. During the closing of windows, current flowing to the windows and the supply voltage are measured. Accumulator voltage cannot go below 10V because the system would exit. This prevent activating of the accumulator when it is fully discharged.
Current configuration, the maximum time of closing windows, monitoring the status of inputs and the measurement is carried out through the port RS232TTL and terminal (e.g. Putty).
Something like miniterminal was made:



After writing word “help”, a list of available commands appears. After modification of variables, data should be stored in EEPROM by writing “ewrite”. A short description:
cofset = offset voltage for ADC of the ACS sensor (theoretically 10bit/2 = 512, but it comes out differently – tolerance of components and supply voltage)
cutoff = current, at which the system closes the window and begins to open another – here set 8.0A
maxtime = the maximum time of closing the window (even if at overload does not occur at that time, the system stops closing the window – here 8.0 seconds)
service = takes the value 1 or 0 and means activation of monitoring of the current, voltage and state of the inputs by RS
It looks like in the following picture:



The system closes the windows in the following order: first window, second one and the sunroof.
The system was designed on a 2-sided PCB. The program was written in WinAVR and takes about 8kB of the processor.



The processor runs on 2MHz from an internal RC to lower the current consumption (difference 1-2MHz – imperceptible), watchdog on, timer1 interrupt every 100ms.
The whole device presents:




Link to original thread (attachment) – Moduł domykania szyb z pomiarem prądu na ACS712
 

Status
Not open for further replies.

Similar threads

Cookies are required to use this site. You must accept them to continue using the site. Learn more…