Week -2
Aim- 1. To make simulation for a door-bell
2. Sense the temperature of heater and control the fan using given condition
## 1. Simulink model of Doorbell ##

Elements for simulation:
1. For doorbell simulation
- Pulse Generator

Pulse Generator is used for to generate pulses as per the required amplitude, frequency and phase delay. In the simulation the pulse generator is used to operate the switch for a time period of 4 sec and pulse width of 50%.
- Simulink - PS converter and PS- simulink converter

Simulink to Physical converter helps to connect simulink block to the physical system blocks, as they are from the different tool box.

Similarly the PS- Simulink block converter helps to connect the pysical system block to Simulink block. They generally act as a medium between physical system and simulink blocks.
- Switch

This is the switch to control the any device according to our need. In this simulink the switch is used for the controlling the magnetization of the solenoid connected to it.
- Electrical Reference

Electrical reference is nothing but a ground which has zero potential. It is used in circuit to provide the elctrons return path or to provide the zero potential in the circuit.
- Battery

Battery is the most important part in that work. It provide the power to the solenoid to pull the plunger connected to it.
Whenever the switch is turned by the control signal through the pulse generator it act as a source of magnetizarion. In simulation battery has 15 volt value.
- Mechanical Translatio reference

Mechanical reference is somewhat similar to the electrical reference. It provide the reference in the translation. It can be considered as the zero point in the translation or the actual physical ground reference.
- Solenoid

This solenoid which has a winding and plunger arrangement. Whever the winding erergies the through the battery it pulls the plunger. In the simulation it is taken as a doorbell arrangement.
- Scope

This is the scope used for see the results. It takes the readings and plot them with respect to time.
- Solver Configuration

Solver Configuration block is used to configure the various parameter like solver type, sample time for the given simulation.
2. Elements used for the Heater-fan system
- Ideal Hear source

Ideal heat source is taken as a heat generator. It can be considered as heater.
This block take input in kelvin so input should be converted into kelvin.
- Thermistor

Thermistor is generally a temperature dependent reistance. It is used to sens the temperature by using the it's resistance. Generally it has NTC, means negative temperature coefficient. With increase in temperature the resistance is decreases.
- Voltage sensor

Volage sensor is used for to sens the voltage accross the resistance. In simulation it is used for to sens the voltage accross the resistance which is in the series of the Thermistor.
- Resistor

The resistance is a basic element of the circuit which is used to oppose the current flow from it. In the simulation it is used for have a voltage drop on it in order to give the voltage drop.
In simulation the value for the resistance is 500 ohm.
- Multiport switch

Multiport switch is a conditional based switch. The output is given as per the applied thresold value. In simulation the switch has the thresold value as per the condition given for turn on the fan i.e,ON if the temperature above 25 °C, OFF otherwise.
## Simulation And It's Results##
#1. Door-bell system#

This is the simulation model for the doorbell system. Here the battery is connected to a solenoid-plinger system through a switch which. Switch is contrallable though the pulse generator.

The setting of the pulse generators has amplitude of 1 and the time periods of 4 sec with 50% duty cycle so thate it cantrigger the solenoid ecery 2 sec. There is a phase delay of 2 sec is also included so that it can be start after the 2 sec of time.
The output of the pulse generator is shown as below

Now , whenever the solenoid gets the voltages accross it energies and the pulls the plunger.
To see the what happens to the plunger the ideal translation motion sensoer is used.
The output of translation motion sensor is given as below.

The above scope output shows the physical movement of the plunger. Initially switvh is off and hence xero translation motion. after 2 sec the solenoid energises and pulls the plunger and at the end of pulling it experiance the oscillation on the plunger and after that it stays on the stead state position. Similarly while releasing the plunger it experiance the oscillation.
## 2. sense the temperature of a heater & turn on or turn off the fan as per conditions##
the ideal heating source is used for the heating purpose and taken as a heater in the simulation.
The Thermistor is used to sense the temperature by sensing the voltage accross the another resistance connected to the series of it.
The multiport switch is used for, as a condition to turn off and on the fan.
There is one condition which can be taken as a thresild value which is Fan conditions: ON if the temperature above 25 °C, OFF otherwise.
So to decide the value of the thresold the voltage accross the resistor is observed. And that voltage valklue can be set as the thresild valur
The below figure is exactly doing this.

The above model is for the thresold value. It is clearly observed that the voltage accross the resistor is 4.97 V, for the 25 degree celcius condition. Hence it is the thresold value.

Now, thresold is decided based on first run on the simulation.
It's time to connect the multiport switch for the fan.

And whener the heater try to cross the thresold value the fan will be turn on.

Now above image is from the signal builder block as per the condition
first interval 0 to 10 sec- 20 + 273 =293 K
second interval 10 to 30 sec- 27+273 =300 K
and final third interval 30 to 50 sec- 23+273 = 296 K
Now as per given condition for the fan the second interval is the only one, in which switch has to be turned on.

The above figure represent that the fan is turned on only for second interval which is correct. Because only in tha interval the condition for the turning on the fan is satisfied.