WEEK 8


Title of activity

Circuit Simulation on ISIS Proteus based on Arduino MicroController

Objective


  • Test Arduino Coding on Proteus
  • Integrate Software and Hardware by Simulation 

Introduction 

First of all, there's a slight change when conducted simulation compare to the real project. It is due to the sensor part. In real project the sensor will detect water, but in simulation there is no water. So,the sensor would be change to Potentiometer where if the voltage is high the motor will run and likewise. But the main objective is to test the coding and integrate it with the hardware. The hardware part is still using relay circuit like in the project, the only difference is the type of motor.

First, Construct the relay circuit, arduino and the sensor part(potentiometer) on ISIS Proteus.
Constructed Circuit on ISIS Proteus
 
From this circuit there is 3 part:
  1. Arduino in the centre as Mictocontroller Unit
  2. Sensor Part (Potentiometer) below Arduino
  3. Relay Circuit (TWO motor for OUTLET and INLET)
The sensor part been connected to analog input of Arduino Pin A1 and A2 and the output part; OUTLET connect to Pin 13 and INLET connect to Pin12.



Next, after construct the circuit we can start design the coding on Arduino software.

coding in snippet below,



int sensorLOW = A1;    //
int sensorHIGH = A2;
int LowValue, HighValue;
int OUTLET = 13;      // select the pin for
int INLET = 12;  // variable to store the value coming from the sensor
int x=1;
int y=1;

void setup() {
  // declare the ledPin as an OUTPUT:
  pinMode(OUTLET, OUTPUT);
  pinMode(INLET, OUTPUT); 
}

void loop() {
  
  while(x!=0){
    // read the value from the sensor:
    LowValue = analogRead(sensorLOW);
     
    // turn the ledPin on
    if (LowValue<500){
      digitalWrite(OUTLET, LOW);
      delay(1000);
      x=0;
    }
     
    else{
      digitalWrite(OUTLET, HIGH);
      delay(1000);
    }    
  }
 
  while(y!=0){
    // read the value from the sensor:
    HighValue = analogRead(sensorHIGH); 
    // turn the ledPin on
    if (HighValue>500){
      digitalWrite(INLET, LOW);
      delay(1000);
      x=0;
    }
   
    else{
      digitalWrite(INLET, HIGH); } 
      delay(1000); 
    }
}



So how the coding Works?

First, Arduino will check the potentiometer at LowLevel......IF the voltage level below than half the OUTLET motor will stop, else the OUTLET motor will running.

Then, After the OUTLET motor stop.....Arduino will check the potentiometer at HighLevel...... 
IF the voltage level above than half the INLET motor will stop
else the INLET motor will continue running.


After compile the coding the HEX file can be found in here,

Compiled coding on Arduino




Get the HEX file

After uploading the HEX file to Proteus, before start the simulation notice that the motor in stop condition (see above picture) because the relay circuit is OPEN

When START the simulation, the OUTLET motor is running because LowLevel voltage is above than half

Outlet motor START

the OUTLET motor is stop because LowLevel voltage is below than half

OUTLET motor STOP


After that, the INLET motor start running because the HighLevel voltage is below than half

INLET motor Start

the INLET motor will stop when HighLevel voltage is above than half

INLET motor Stop


 Conclusion

From the simulation above there are things that can be verified
  1. Relay Circuit is working
  2. Hardware and Software can be integrated
  3. Although the simulation are not exactly as the project, but the concept is still the same. The sensor are detect analog voltage, maybe in real project the value are not stable, therefore the only thing need to adjust is in the software part (coding).
Finally, the simulation is succeed and proved that software and hardware for this project can be integrated.

Next we will start on design PCB for our project...

No comments:

Post a Comment