If you aware that my previous tutorials, you may already know that I have made an Automatic Car Window Roll Up unit for vehicles. In that project I found some lapses that the

  1. Window always operates when the car lock key is pressed even the door is already locked.
  2. Window operates based on a timer.
  3. Even the door is locked inside. The unit start to work.
  4. No One touch window open/close function.

Therefore, I designed a new unit with premier functions to automatic window system. This unit can identify the window is closed or interrupted to the operation, and one touch window open and close function, only security key can activate the unit etc.

If you want you can do more upgrades with this unit but, I have designed this only for 2 windows.



 Following is given the chart of the project.
The circuit diagram as follows.

The circuit for relays as follows

When you give the power to motor, it must be gone through a current sensor. 
I have use 30A sensor
Watch more about current sensor




How to use current sensor with motors







The current censor can detect the current level. Therefore you must do the following.
Use a multi meter and check the current need for the operation of the motor. 

Then once the window is closed/opened fully, again check the current level of the motor. As an example, when the motor is operating it may be consumed less than 6A and when the window is opened/closed the current level may be about 10A.


Connect pin 5 to the + pin of Car security unit's LED bulb

You can use following PCBs for this project


MOTOR UNIT


Car Window Switch Wiring








Operation of the Unit.

If you want to Auto Roll up the window by Security key,
  1. Engine must be off position
  2. All the doors should be closed.

Then press the lock key.

You will hear car horn one time, then the windows will be roll up.

One touch open/close window

Auto switch in diagram
Auto Switch in practice




  • When the car is in ON mode, Switch on the "Auto" Switch. Then press up window key and drop, the window will be closed.
  • If you press down the window key the window will be opened automatically.
If you interrupted the operation by pressing again, the window will be stopped.



Tuning the Unit.


If you watch carefully, when the car is locked by key, the security led blink in a speed than unlocked. Then count the intervals and you have to change the interval level in the code.

Get the Amperage of the motor when the window is fully opened/closed and put it in to the code.

I have assumed that,
  • Car horn is from Ground on/off
  • Car Door signal is from ground
  • Car security LED power 12V
  • Window operates when car is ON mode.
  • Direct power 12v come though the window switch to Motor


    
        /*PROGRAMME : CAR WINDOW AUTO RALL UP
PROGRAMMED BY : EASY MADES
WEBSITE : HTTP://WWW.EASYMADES.COM
******************************************************************
THIS PROGRAMME IS FOR THE VEHICLES WITH FOLLOWING SETTINGS
1.CAR DOOR LIGHT ON/OFF BY NEGATIVE 
2.CAR HORN NEGATIVE
3.POWER WINDOW SYSTEM
AUTO RALL UP WILL WORK WHEN
1.THE CAR IS OFF, THE DOORS ARE CLOSED THEN SECURITY KEY PRESS LOCK, THE FRONT
TWO WINDOWS WILL BE SHUT AUTOMATICALLY.
2.THE CAR IS STARTED AND IF THE AUTO SWITCH ON, IF YOU PRESS WINDOW UP
ONCE THE DRIVER SIDE WINDOW WILL GO UP AUTOMATICALLY*/

int UpSwitch = 0;
int DwnSwitch = 0;
int UpSwitch_Pin = 11;
int DwnSwitch_Pin = 12;

int RMotorUp = 0;
int RMotorDwn = 0;
int LMotorUp = 0;
int RMotorUp_Pin = 10;
int RMotorDwn_Pin = 9;
int LMotorUp_Pin = 8;


int CarDoor =0;
int Sensor = 0;
int Acc = 0;
int Btt = 0;
int CarDoor_Pin =7;
int Acc_Pin = 6;
int Sensor_Pin = 5;

int Btt_Pin = 4; 

int CarHorn=0;
int Reset = 0;
int Reset_Pin = 3;
int CarHorn_Pin=A0; // To car horn


int LED = 13;

int DataUpR = 0;
int DataDwnR = 0;
int DataUpL = 0;
int DataUpR_Pin = A1; // To control the unit using external commands
//int DataDwnR_Pin = A1;
//int DataUpL_Pin = A2;

int Active = 0;
int Cancel = 0;
int Window = 0; //
int Interrupt = 0;
float OldMillis;
float NewMillis;
float Balancemillis;
int Timmer = 6000; // Average time to close/Open a window (6s)

int x = 0; //if the door is locked by key, value will be  = 1.
int y;

long a = 0;// time push and hold the button.
int aUp = 0;// window up pressed
int aDwn = 0;//window down pressed
int Clicked = 0;// button was pressed when =1

//Current sensor Unit
int CrntPin = A2;
float Anval = 0.0;
float Vlt = 0.0;
float Dflt = 66; // Default value of 30A current sensor
float Amps = 0.0;
int Svolt = 2500; // Default voltage of the sensor 2.5v
int Limit = 6; // This is by amps (10 A)
int limiton = 7 ; //limit for normal operation
int Motor = 0;
int ux = 0;
int uy = 0;


//Roll uo timing

int upx = 0;
int upy = 0;



void setup() {
  Serial.begin(9600);
 
pinMode(UpSwitch_Pin,INPUT);
pinMode(DwnSwitch_Pin,INPUT);
pinMode(RMotorUp_Pin,OUTPUT);
pinMode(RMotorDwn_Pin,OUTPUT);
pinMode(LMotorUp_Pin,OUTPUT);
pinMode(CarDoor_Pin,INPUT);
pinMode(Sensor_Pin,INPUT);
pinMode(Acc_Pin,INPUT);
pinMode(Btt_Pin,INPUT);
pinMode(CarHorn_Pin,OUTPUT);
pinMode(Reset_Pin,OUTPUT);
pinMode(DataUpR_Pin,INPUT);
pinMode(CrntPin,INPUT);
pinMode(LED,OUTPUT);
 //****************************************************************
CarDoor =digitalRead(CarDoor_Pin);
Sensor=digitalRead(Sensor_Pin);
Acc =digitalRead(Acc_Pin);
Btt =digitalRead(Btt_Pin);



//-------------------------------------------------------------------
//------------CHECK THAT THE CAR LOCKED BY REMOTE KEY OR DOOR--------
//-------------------------------------------------------------------
/* IF THE CAR IS LOCKED BY REMOTE KEY, THEN SECURITY LED START TO BLINK
 *  BUT IT IS LOCKED BY DOOR LOCK, NOTHING LIGHT
 */

int cnt = 1;

do{
  Sensor = digitalRead(Sensor_Pin);
  digitalWrite(LED,HIGH);
  delay(30);
  cnt = cnt +1;
  if (Sensor ==1){x = 1;cnt = 120;Serial.print("KEY LOCKED");}
  digitalWrite(LED,LOW);
}while (cnt < 100);

//------------------------------------------------------------------
// If the door is locked by door, reset the unit
//------------------------------------------------------------------
if (x == 0){//If the door is locked not by remote key
digitalWrite(Reset_Pin,HIGH); // Activate Reset relay
delay(500);
digitalWrite(Reset_Pin,LOW);
}//-----------------------------------------------------------------

 
//****************************************************************
//================CAR LOCK Shutter
//****************************************************************
if ((Acc ==0)&&(CarDoor ==1)&&(Btt==1)&&(x==1)){ //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  Serial.println("Key lock Shutter 01");
   digitalWrite(LED,HIGH);
  delay(1000); 
carhorn();
delay(2000);
 digitalWrite(LED,LOW);
 
do {
CurrentSensor();  
digitalWrite(LED,HIGH);
delay(100);
digitalWrite(RMotorUp_Pin,HIGH); // roll up window
Serial.print("UPR : ");
Serial.println(upx);
Serial.print("MOTOR : ");
Serial.println(Motor);

digitalWrite(LED,LOW);
delay(100);
upx++;
if ((Motor == 0)&&(upy < 35)){ux = 0;} else { ux = 1;}
}while(ux ==0);
digitalWrite(RMotorUp_Pin,LOW); // roll up window STOP!
Serial.println("STEP  1");
delay(500);
CurrentSensor(); 
delay(50);

do {
CurrentSensor();  
digitalWrite(LED,HIGH);
delay(100);
digitalWrite(LMotorUp_Pin,HIGH);
Serial.print("UPY : ");
Serial.println(upy);
Serial.print("MOTOR : ");
Serial.println(Motor);
digitalWrite(LED,LOW);
delay(100);
upy++;

if ((Motor == 0)&&(upy < 35)){uy = 0;} else { uy = 1;}

}while(uy == 0);
digitalWrite(LMotorUp_Pin,LOW);
delay(500);
CurrentSensor(); 
delay(50);
//----------------------------------------------------------------
digitalWrite(Reset_Pin,HIGH);
delay(500);
digitalWrite(Reset_Pin,LOW);

}//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

digitalWrite(LED,HIGH);
delay(500);
digitalWrite(LED,LOW);
} //************** END VOID SETUP************************



void loop() {

UpSwitch = digitalRead(UpSwitch_Pin);
DwnSwitch = digitalRead(DwnSwitch_Pin);
CarDoor =digitalRead(CarDoor_Pin);
Sensor=digitalRead(Sensor_Pin);
Acc =digitalRead(Acc_Pin);
Btt =digitalRead(Btt_Pin);


CurrentSensor(); // GEt current sensor value
delay(50);

//-------------------------------------------------------
//Reset if key lock inside the car when engine is started
//-------------------------------------------------------
if ((Acc==1)&&(Btt==1)){
  Serial.println("key lock inside the car when engine is started");
  digitalWrite(Reset_Pin,HIGH);
  delay(500);
  digitalWrite(Reset_Pin,LOW);
}
//-------------------------------------------------------




//Inturrupted to the current process
if ((Active == 1)&&(Interrupt == 0)){
if (digitalRead(UpSwitch_Pin)==1){Window = 1;Interrupt=1;Serial.print("UpSwitch : ");
Serial.println(digitalRead(UpSwitch_Pin));}

if (digitalRead(DwnSwitch_Pin)==1){Window = 2;Interrupt=1;Serial.print("DwnSwitch : ");
Serial.println(digitalRead(DwnSwitch_Pin));}


}
//Stop When Interrupt
if (Interrupt == 1){digitalWrite(RMotorUp_Pin,LOW); digitalWrite(RMotorDwn_Pin,LOW);Serial.println("STEP  05");Window = 0;Active =0; Balancemillis=0; OldMillis = 0;LedBlink();Serial.println("Interrupted");delay(2000);Interrupt =0;}

/*/testing----------------------------
if ((UpSwitch ==1)||(DwnSwitch ==1)){
 if (UpSwitch ==1){aUp = 1; aDwn =0;}
 if (DwnSwitch ==1){aUp = 0; aDwn =1;} 
 Clicked = 1; //BUTTON PRESSED
  delay(10);
  a = a + 1;
}

//FIND THE DURATION TO RELEASE THE BUTTON
if (Clicked ==1){
  delay(10);
  a = a + 1;
  
}*/






//-----------------------------------------
//Auto Up the window
if ((UpSwitch ==1)||(DwnSwitch ==1)){
  delay(200);
  Serial.print("TOUCHED");
if ((Active == 0)&&(Interrupt == 0)){
if ((UpSwitch ==1)&&(digitalRead(UpSwitch_Pin)==0)){Window = 1;Active=1; OldMillis = millis();}
if ((DwnSwitch ==1)&&(digitalRead(DwnSwitch_Pin)==0)){Window = 2;Active=1;OldMillis = millis();}
}
Serial.println(Window);
}

//-----------------------------------------

//***********************************************************
//WINDOW RALL UP
//***********************************************************
if ((Window == 1)&&(Active==1)&&(Interrupt == 0)&&(BalancemillisTimmer)||(Amps >limiton)){
   digitalWrite(RMotorUp_Pin,LOW);
   digitalWrite(RMotorDwn_Pin,LOW);
   Serial.println("STEP  01");
   digitalWrite(LED,LOW);
Active=0; Balancemillis=0; OldMillis = 0;Window = 0;Interrupt =0;Serial.println("WINDOW STOP");delay(500);}
}
//------------------------------------------------------------


//---------------------------------------------------------------
// External Conrol wire
//---------------------------------------------------------------
DataUpR = analogRead(DataUpR_Pin);
Serial.print("DataUpR : ");
Serial.println(DataUpR);
if ((DataUpR>200)&&(DataUpR<600 ataupr="" if="">400)&&(DataUpR<600 02="" ataupr="" delay="" digitalwrite="" else="" erial.println="" if="" limiton="" mps="" otorup_pin="">300)&&(DataUpR<380 03="" ataupr="" delay="" digitalwrite="" else="" erial.println="" if="" limiton="" mps="" otordwn_pin="">200)&&(DataUpR<280 ---="" -1="" -="" 04="" 0="" amps="" anval="analogRead(CrntPin);" arhorn_pin="" carhorn="" convert="" current="" currentsensor="" delay="" digitalwrite="" else="" erial.println="" et="" flt="" gives="" gnd="" if="" it="" k="" ledblink="" limiton="" loop="" motor---------------------="" motor="" mps="" negative="" of="" otordwn_pin="" otorup_pin="" positive.="" resistors="" svolt="" the="" to="" usage="" vlt="(Anval/1024.0)*5000;" void="" windowdwn="" windowupl="" windowupr=""> Limit){Motor = 1;} else {Motor = 0;} // value "0" is motor is rotating and "1" is blocked.
Serial.print("AMPS : ");
Serial.println(Amps);

//**************************************************************************************
}

    
  If you have any doubt do not forget to put it as a comment.
Stay with Easy Mades 




If you make electronic projects, you always use power supply to operate them. If it is not an experiment, your project will be a part of your home, warehouse or any ware. The problem always come is that how to give the power to the projects.


The souse of power is more important to operate the devices. If you use batteries you have to change it frequently when the battery is dry out.


I know, you are always willing to give a power supply without interruption to your device as well as less maintenance cost.
This lesson and the practical work from Easy Mades is giving you a solution for that matter.

Watch This



Following circuit diagrammed is very simple and more practical one. If you make it, you must aware about the Direct Current because it is caused to injure you.

  • C1 = 474pf (400V)
  • C2 = 270uf (25v)
  • R1 = 470k(1/4W)
  • ZD1 = 3v, 5v, 6v, 9v or 12v Zener Diode
  • D1 = 4 x N4007 Diodes


Operation of the Circuit.
C1 capacitor work as a current reducing capacitor and interconnected R1 resistor discharge the current loaded in the capacitor. Then 1N4007 diodes make rectify the current from AC to DC and also C2 electrolytic capacitor help to smooth the current. The main part of voltage regulating is the zener diode.
Zener diode control the voltage and the voltage over the value of the zener diode will be discharged.

If you want to get more current , you can use .22Uf, 1 uf, 2.2uf or 3 uf capacitors  and also if you want to change the voltage you can change Z1 diode as 3v, 5v, 6v, 8v, 9v, 12v etc.
 
Be careful not to touch any part of the circuit when the AC power is connected. And if you have not experience working with AC, please ask from your elders or put it in the comments.





Most of electronic beginners are very much interested to make circuits to control device remotely. If you see the devices such as TV, radio etc. you me feel that, if you can control other devices as well with the remote controller.

The problem is, making circuits with programming need additional knowledge as weal as high cost. This makes you disappointing the interest.

However, In this tutorial i am going to show you how to make a remote controller unit without programming.

You need the following items,


  1. Infrared Detector
2. CD 4017 IC

3. 2N2222 Transistor
4. 104k ceramic capacitor


5. 22uf capacitor


6. 1k resister

7. 220k resister


8. 1.5k Resister



9. 9V Relay


10. LED Bulb


11. 1N4007 Diode



Tools and other needs

1. Soldering Iron



2. Lead


3. Multi meter



4. Vero Board





IMPORTANT : USE THE SAME CAPACITORS AND RESISTORS.

Making the Project










Circuit Diagram.



Watch the video for more details





If you follow my previous tutorial, now you know how to shrink Arduino circuits using ATTINY 13a. However, as usually you have to burn the Bootloader before start programming. The interesting part is, wiring for burning bot loader and wiring for uploading codes are same. I have already done a tutorial about burning bootoader to arduino Chips. This process is also similar to that process, but you have to do the following settings to do so.

Make a shield



Step 01.
Go to File > Preference


STEP 02 : Enter the following url in the box "Additional Boards manager URLs

https://raw.githubusercontent.com/sleemanj/optiboot/master/dists/package_gogo_diy_attiny_index.json



STEP 03: Tools > Boards > Boards Manager


STEP 04 : Search ATtiny



STEP 05 : Click Install button and wait......



STEP 06 : Tools > Boards > Attiny13 or your board as per the chip number


Since I am using Attiny13a,



Now the setting part is completed. You can follow the steps as my previous tutorial for burning the chip.

http://www.easymades.com/2019/03/arduino-bootloader-burning.html


If you have ant doubt, please put it in the comments below.

STAY WITH EASY MADES

-->
Copyright © 2013 Easy Mades