Week -2
Answer 1:
A Simulink and Simscape model of Doorbell using solenoid block
Aim:
To make a simulink and simscape model of electric doorbell using solenoid block with the given details.
Theory and working:


The above shown clip is the working of a simple electric doorbell.This works on the principle of electromagnetic induction. In the above arrangement, when the switch is closed the electromagnet receives electrical power from the battery and due to magnetic field produced it pulls the metal arm to hit the bell producing sound. We have to create a situation where the switch is closed for 2 seconds and then released.And we have to observe the physical movement of the plunger in simulink.A doorbell uses a electromagnet called solenoid.
Required blocks in simulink and simscape:
- Pulse generator : generates the time based output pulses of amplitude 1m ,period 4 sec,having a phase delay of 2 sec.The figure below shows the input pulse signal given the switch.

- Switch: The switch is controlled by an external physical signal. If the external physical signal PS is greater than the threshold, then the switch is closed, otherwise the switch is open.The closed resistance is defined by parameter R_closed, and the open conductance is defined by parameter G_open. Both parameters must be greater than zero.
- Battery: A 12V battery having 2ohm internal resistance is used.
- Solenoid: It is a electromagnetic device.When the coil of solenoid carries current it produces a magnetic field and plunger inside the solenoid moves forward and backwards.The plunger Maximum stroke is implemented as a hard stop, the dynamics of which are set by the Contact stiffness and Contact damping parameters. The same parameters are used to model the contact dynamics when the plunger pulls fully in. The Spring constant parameter is used to implement a spring force that pulls the plunger out, and can be set to zero.
- Ideal translational motion sensor: This block measures velocity or displacement in a mechanical translational network. The sensor is ideal since it does not account for inertia, friction, delays, energy consumption, and so on.The physical signal ports V and P report the velocity and position, respectively, of port R relative to port C. The measured velocity is positive when the velocity at port R is greater than the velocity at port C.
- Solver configuration: Each physical network represented by a connected Simscape™ block diagram requires solver settings information for simulation. The Solver Configuration block specifies the solver parameters that your model needs before you can begin simulation.Each topologically distinct Simscape block diagram requires exactly one Solver Configuration block to be connected to it.
- scope
- simulink to PS convertor
- PS to simulink convertor
- Electrical reference
- Mechanical translational reference
Simulink and simscape Model:

Output 1: The velocity of plunger

Output 2: Displacement of the plunger

Result:
The simulink and simscape model for electric doorbell is created and the outputs are verified.
Answer 2:
Temperature controlled fan
Aim:
To sense the temperature of a heater using a thermistor and turn on or turn off the fan as per the conditions.
Conditions:
- The temperature of the heater source must be as: 20 °C from 0 to 10 seconds, 27 °C from 10 to 30 seconds, 23 °C from 30 to 50 seconds
- The fan must be on if and only if the temperature is above 25 °C
- The fan must be off if the temperature is below 25 °C
Theory of thermistor:

Thermistor means thermal resistor.It is a type of resistor whose electrical resistance varies with changes in temperature.It is a passive component.They are an accurate,cheap,and robust way to measure the temperature.Thermistors have a variety of applications. They are widely used as a way to measure temperature as a thermistor thermometer in many different liquid and ambient air environments. Some of the most common uses of thermistors include:
- Digital thermometers (thermostats)
- Automotive applications (to measure oil and coolant temperatures in cars & trucks)
- Household appliances (like microwaves, fridges, and ovens)
- Circuit protection (i.e.surge protection)
- Rechargeable battery(ensure the correct battery temperature is maintained)
- To measure the thermal conductivity of electrical materials.
- Useful in many basic electronic circuits (e.g. as part of a beginner arduino starter kit)
- Temperature compensation (i.e. maintain resistance to compensate for effects caused by changes in temperature in another part of the circuit)
- Used in wheatstone bridge circuits
There are two types of thermistors:
- Negative Temperature Coefficient (NTC) Thermistor
- Positive Temperature Coefficient (PTC) Thermistor
- NTC Thermistor
In an NTC thermistor, when the temperature increases, resistance decreases. And when temperature decreases, resistance increases. Hence in an NTC thermistor temperature and resistance are inversely proportional. These are the most common type of themistor.
The relationship between resistance and temperature in an NTC thermistor is governed by the following expression:

Where:
- RT is the resistance at temperature T (K)
- R0 is the resistance at temperature T0 (K)
- T0 is the reference temperature (normally 25oC)
- β is a constant, its value is dependant on the characteristics of the material. The nominal value is taken as 4000.
2. PTC Thermistor
A PTC thermistor has the reverse relationship between temperature and resistance. When temperature increases, the resistance increases.
And when temperature decreases, resistance decreases. Hence in a PTC thermistor temperature and resistance are inversely proportional.
Although PTC thermistors are not as common as NTC thermistors, they are frequently used as a form of circuit protection. Similar to the function of fuses, PTC thermistors can act as current-limiting device.
When current passes through a device it will cause a small amount of resistive heating. If the current is large enough to generate more heat than the device can lose to its surroundings then the device heats up.
Working of simulink model:
We have to build a signal for the above conditions.Inorder to make that signal we have to use a signal builder block.In this the unit of temperature is converted into kelvin not °Celsius.
- For 0-10 sec ~ 293K
- For 10-30 sec ~ 300K
- For 30-50 sec ~ 296K
In the Simulink to PS convertor block we should provide an integrated input for enabling to read for the systems.

Simulink and simscape Model:

As we can see in the above image the voltage sensor is used to measure the voltage across the resistor.This physical signal is then converted into simulink and it is plotted in voltage plot ,its value is shown in the scope ie. 0.01099V and this voltage is given as threshold voltage for the switch.When u2>threshold voltage it passes the input .

Plot 1: The Temperature plot

Output 1: The voltage plot

Output 2: The Fan output

Output 3: The angular velocity plot

Output 4: The angle plot

Result:
The simulink and simscape model for thermistor controlled fan is designed and the outputs are verified.