Week -2
1.Aim
- Make a Simulink model of Doorbell using solenoid block.
- To make a simulink model using thermistor to sense the temperature of a heater & turn on or turn off the fan.
2. To Make a Simulink model of Doorbell using solenoid block.
2.1 Objective:

To make a simulink of doorbell using solenoid block such that switch is closed for 2 sec and released and also the physical movement of the plunger should be observed.
2.2 Description.
The doorbell works on the principal of electromagnetism.Electromagnetics are coils of wrapped around a small piece of magnetic metal.When electricity passes through the wire, its creates a magnetic field around the wire. When switch is ON, the circuit becomes active and the solenoid activites the plunger that creates the doorbell sound. The basic components in the doorbell are a Battery, Switch,solenoid and a bell with plunger.

A doorbell uses electromagnet which is called a solenoid.A solenoid where is a electromagnet where the coiled wire surrounds a metal piece/block. A solenoid converts electrical energy into mechanical work. Here the coil is made of turns by the copper wire. When the current flows through a wire,strong wire,strong magnetic flux is generated. This solenoid activates and controlls the plunger that is attached to it and hence the bell rings.
2.3 Simulink Model:

2.4 Explanation:
The above model shows the complete circuit of a door bell. Main parts in the doorbell are switch , solenoid,battery,bell and a plunger.
Initial the solenoid block is considered in which it represents a actual solenoid. Along with this battery block is also used from the simscape library. The solenoid and battery are connected with the terminals.
In order to control the current flow between the battery block and the solenoid block,a switch block is placed. The switch block models as switch controlled by an external physical signal. If the physical signal PS is greater than than the value specified in the threshold parameter, then the switch is closed,otherwise the switch is open.
Now the battery block ,switch block and solenoid terminals are grouded with Electrical Reference.
Electrical Reference block is also called a electrical ground.In the above sytem htis is connected towards the negative terminal of the battery and the solenoid.
As the switch is controlled by the physical signal, the PS port in the switch block is connected with the pulse generator. By chnaging the parameters we can control the switch block. In this case the following settings we made in order to get the required criteria.
2.5 Settings of Pulse Generator:
- As per the settings in Pulse Generator -it is specified that Amplitude=1,Period(sec)=4, Pulse Width(% of period)=50, phase delay(sec)=2. Initially the pulse is at zero.
- As the phase delay is set to 2 sec ,untill 2 sec the pulse will be zero. After the 2 Sec the pulse will raise from 0 to 1 (as amplitude is set to - which means for next 2 sec the pulse will be at amplitude-1
- And at 4th second,it will come back to zero. For the next 2 sec it will at zero and hence the cycle completes the period of 4 sec. In this way the cycle continues.
- Now consider the solenoid block i.e we have two ports 'R' & 'C'. Where R represents the plunger operation and C is constant point.
- The Port R in solenoid is connected to the Port-R in the Ideal Translation Motion Sensor Block. This continously senses the postion of the plunger and gives the output.
- In the Ideal Translation Motion Sensor there are 3 different connections connections in the oputput side i.e connections 'C','V','P'. Where 'V' & 'P' are the physical signal output ports for velocity and the position.
- In this simulation, only the position of plunger is studied and recorded .Connection 'V' is left blank.
- The Port-C of solenoid is connected to the connection-C of the output of Ideal Translation Motion Sensor Block. Also both these connections are connected to the Mechanical Translational Reference.
- As connection-'P' indicates the position of plunger, it is connected to PS- Simulink Converter. This Converter,converts the physical signal to a simulink output signal.
- This PS-simulink Converter is then connected to a scope block which generates a plot/graph showing the position of plunger from port-P of Ideal Translation Motion Sensor.
- Solver configuration block is connected to the model.Each physical network represented by a connected simscape block diagram require solver settings information for Simulation.
- Finally the simulation is set to Run by setting the stop time for 10 Sec.
- Solver configuration block is connected to the model. Each physical network represented by a connected simscape block diagram require solver settings information for simulation.
- Finally the simulation is set Run by setting the stop time for 10 Sec.

2.6 Results:
- After succesfully running the simulation, the result can be visualized by using scope and also display block which shows the output value.
- From the simulink model, the Scope that is connected to the Pulse Generator displays the Amplitude vs Time Plot. i.e display the pulse behaviour.
- Based on the input data that is given Pulse Generator Block , the above shows the pulse Generation.
- This plot shows the situation where the switch is closed for 2 seconds and then released.
- As per the declared values,pulse generation has started after 2 Seconds.
- At 2 seconds the amplitude maintained is 1 and then again for next 2 seconds the pulse is maintained zero.

- From the plot it is cleared that, when amplitude is maintained at value 1 then the switch will be turned off and when it is zero the switch will Turn On.
- From the Simulink Model the 'Scope1' that is connected to the Ideal Translation Motion Sensor Block displays the Position of Plunger vs Time plot.
- The above plot shows the position of plunger at various time intervals.

- When we compare the Pulse Generator plot with the Position vs Time Plot, it is observed that for the given time intervals the bell rings. i.e. the bell start ringing at the interval of 2 Second with the given phase delay of 2 sec.
2.7 Conclusion:
A Simulink model of Doorbell using solenoid block is bulit. Using this model a physical bell phenomia is developed where the switch is closed for 2 seconds and then relased. Also the physical movement of the plunger is observed from the output plot.
3. To make a simulink model using thermister to sense the temperature of a heater and turn on or off the fan.
3.1 Objective:
To make a simulink model using a thermister to sense the temperature of a heater and turn On and turn Off the fan.
Conditions:
Temperature source to be maintained is 20°C from 0 to 10 seconds, 27°C from 0 to 10 seconds, 23°C from 30 to 50 Seconds and the fan conditions is kept ON if the temperature is above 25°C , otherwise OFF.
3.2 Description:
A thermister is defined as type of resistor whose resistance varies with changes in temperature.Generally,the resistance of thermistor measured using an ohmmeter.Mailnly there are two type of thermistors.They are Positive Temperature coefficient Thermistor.(PTC) and Negative Temperature Coefficient Thermistor(NTC). The PTC thermistors are the resistors with a positive temperature coefficient i.e the resistance with increase with increasing temperature.Whereas the NTC thermistors are the Negative temperature coefficient i.e. the resistance decreases with increasing the temperature.The type of material used in the thermistor will dictacte how much the resistance changes,which is changed with temperature.
3.3 Simulink Model:

3.4 EXPLANATION:-
- In order to create a Cooling Fan Model using a thermistor,we need a signal builder,controlled temperature source,thermal reference,thermistor,battery,resistor,voltage sensor,logical switch,electrical reference,constants,switch and scope blocks.
- In the above model the input signal is fed using Signal Builder Block.The data her is set using the initial conditions i.e. Temperature source to be maintained is
20°C from 0 to 10 seconds,
27°C from 10 to 30 seconds,
23°C from 30 to 50 seconds.
Fan is kept ON the temperature is above 25°C , otherwise OFF.

- Further, this singal is fed into the controlled Temperature Source Block by means of a Simulink PS converter .Scope Block is connected to the Signal Builder to Check the input signal.
- The Port-S of controlled Temperature Source Block is connected with Simulink PS converter and the Port-A is connected to the thermal resistance.
- The signal from the Singal Builder is Fed into Port-A of the thermistor.The positive side of thermistor is connected to the +ve terminal of the battery and the -ve side of the thermistor is connected to the Voltage sensor Block.
- In the thermistor block,in the Variable window the priority level is set to LOW.
- In between the terminals of the voltage sensor block the resistance block is placed and it is set to 1 Ohm.
- The Negative terminal of the battery and negative terminal of the voltage sensor are grounded with Electrical Reference.
- The Port-V from the sensor is connected to the Scope block by using PS-Simulink Block.This converts the physical signal to a simulink output signal.The value obtained is displayed in the Display Block.
- The PS-Simulink converter is used to connect the Switch(Connected to a centre terminal),for the other two terminals of switch Constants Block is connected.
- To give the threshold value in the Switch Block , it has 2 conditions i.e if the value is above the threshold value of the output will be 1 and if the value is below the threshold value of the output will be 0.
- In order to set the threshold value of switch , double click on the switch block and edit the value of threshold as obtained to get the required cutoff value.
- Also one more connection from PS-Simulink converter to Switch Block is extended and connected to the Display Block.
- After setting the threshold value for the switch ,we need to run the simultion for stop time of 50 Sec ad the plot is observed in the Scope2.
- The final output is recorded in the Scope and the value is monitered Display Block.
3.5 Results:-
After the succesfully running the simulation, the result can be visualized by using scope also display block which shows the output value.
The trend of the input parameter signal(scope) is visualized and then its compared with the output signal(scope1)
3.5 Scope[Input parameter from signal builder]
- Temperature source to be maintained is 20ºC from 0 to 10 Sec, 27ºC from 10 to 30 Sec. 23ºC from 30 to 50 Sec.
- From the above plot,the changes in voltage with the change in temperature is observed. By using the signal we can set condition for ON and OFF.

3.6 Scope1[Signal Generated at output w.r.t given Temperature]
- It shows that in the range of 0-10 Sec it has temperature of 293ºK in which the voltage is obtained between 0.0095 & 0.01.For the range of 10-30 Sec it has temperature of 300ºK in which the voltage is obtained closed to 0.013 and for range 30-50 Sec it has temeprature of 296ºK in which the voltage is obtained is around 0.011.

- Required criteria is the fan should be ON when the temperature is more than 25ºC .Hence from the above graph when the voltage is more than the 0.011(296ºK) the fan should be ON and when the voltage is below the threshold value than fan should be OFF.
Results:
- After successfully running the simulation,the resukt can be visualized by using scope and also display block which shows the output.
- From the above plot, the changes in voltage with change in temperature is observed.By using this signal we can set the condition for ON and OFF.
- It shows that inn range of 0-10 Sec it has a temperature of 293ºK in which the voltage is obtained between 0.0095 & 0.01. For the range of 10-30 Sec it has temperature of 300ºK in which the voltage is obtained close to 0.013 and for the range of 30-50 Sec it has temperature of 296ºK in which the voltage is around 0.011.
- Required criteria is fan should be ON when the temperature is more tha 25ºC.Hence from the above graph when thw voltage is more than 0.011(296ºK) the fan should be ON & when the value voltage is below the threshold value the fan should be OFF
3.8 Conclusion:
- A Simulink Model of doorbell using solenoid block is created such that the switch is closed for 2 Sec and then released.Also the physical movement in the plunger is observed.
- A simulink model using a thermistor to sense the temperature of a heater is created and parameters are set to Turn ON and Turn OFF the Fan based on the specified the temperature and time.