Simulink Challenge
1. AIM: -
Make a Simulink model of doorbell using solenoid block and use a thermistor to sense the temperature of a heater & turn on or turn off the fan.
2. OBJECTIVE: -
2.1 Make a Simulink model of Doorbell using solenoid block with the following details;
Create a situation where the switch is closed for 2 seconds and then released. Observe the physical movement of the plunger.
2.2 Use a thermistor to sense the temperature of a heater & turn on or turn off the fan as per the below conditions:
Temperature source: 20 °C from 0 to 10 seconds, 27 °C from 10 to 30 seconds, 23 °C from 30 to 50 seconds. Fan conditions: ON if the temperature above 25 °C, OFF otherwise
3. OBJECTIVE 1
- Doorbell: -
The most widely used form is the interrupter bell, which is a mechanical bell that produces a continuous sound when current is applied. The bell (B), which is often in the shape of a cup or half-sphere, is struck by a spring-loaded arm (A) with a metal ball at the end called a clapper, actuated by a solenoid (E). In its rest position the clapper is held away from the bell a short distance by its springy arm. When the switch (K) is closed, an electric current pass from the battery (U) through the winding of the solenoid. It creates a magnetic field that attracts the iron arm of the clapper, pulling it over to give the bell a tap. This opens a pair of electric contact (T) attached to the clapper arm, interrupting the current to the solenoid. The magnetic field of the electromagnet collapses, and the clapper springs away from the bell. This closes the contacts again, allowing the current to flow to the solenoid again, so the magnet pulls the clapper over to strike the bell again. This cycle repeats rapidly, many times per second, resulting in a continuous ringing.
The tone of the sound generated depends on the shape and size of the bell resonator. Where several bells are installed together, they may be given distinctive rings by using different size or shapes of bell, even though the strike mechanisms are identical.
Another type, the single-stroke bell, has no interrupting contacts. The hammer strikes the gong once each time the circuit is closed. These are used to signal brief notifications, such as a shop door opening for a customer, rather than continuous warnings.
- Solenoid: -
A solenoid is a device comprised of a coil of wire, housing and a moveable plunger (armature). When an electrical current is introduced, a magnetic field forms around the coil which draws the plunger in. More simply, a solenoid converts electrical energy into mechanical work. The coil is made of many turns of tightly wound copper wire. When an electrical current flows through this wire, a strong magnetic field/flux is created.
The housing, usually made of iron or steel, surrounds the coil concentrating the magnetic field generated by the coil. A solenoid is a device comprised of a coil of wire, housing and a moveable plunger (armature). When an electrical current is introduced, a magnetic field forms around the coil which draws the plunger in. More simply, a solenoid converts electrical energy into mechanical work. The plunger is attracted to the stop through the concentration of the magnetic field providing the mechanical force to do work.
3.1 SIMULINK MODEL: -

3.2 BLOCKS USED: -
- Pulse Generator: - The Pulse Generator block generates square wave pulses at regular intervals. The block waveform parameters, Amplitude, Pulse Width, Period, and Phase delay, determine the shape of the output waveform.
- Simulink-PS Converter: - The Simulink-PS Converter block converts the input Simulink signal into a physical signal. Use this block to connect Simulink sources or other Simulink blocks to the inputs of a Simscape physical network.
- Switch: - The Switch block models a switch controlled by an external physical signal. If the external physical signal PS is greater than the value specified in the Threshold parameter, then the switch is closed, otherwise the switch is open.
- Battery: - The Battery block implements a generic dynamic model that represents the most popular types of rechargeable batteries.
- Solenoid: - The Solenoid block represents the electrical characteristics and generated force for the solenoid
- 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.
- Ideal Translation Motion Sensor: - The Ideal Translational Motion Sensor block represents a device that converts an across variable measured between two mechanical translational nodes into a control signal proportional to velocity or position.
- Scope: - Display signals generated during simulation.in simple word display graph with respect to time.
3.3 Explanation Model and Output: -
1. Firstly, the pulse generator is block is used to give signal inputs like amplitude, pulse width, period and phase delay to determine the shape of the output length. Scope is used to see the graph of wavelength.


2. After that Simulink-PS Converter is used to convert signal input to physical system and send to the switch block.
3. To complete the circuit the battery, switch and solenoid block are used and connect to each other. The electric reference is used as a ground. All systems are connected in series. The solver configuration block is used to specify the solver parameter.
4. The mechanical part of solenoid (clapper) is connected with ideal translation motion sensor because the motion of clapper is translation and for ground the mechanical translation reference is used.
5. The scope is connected to an ideal translation motion sensor to see the output graph of plunger motion. The output is as follows,

In the above graph we can see that the switch is closed for 2 sec after that switch is open. Amplitude is equal to 0 means the switch is closed. We can also see that the clapper strings every 2 seconds. The motion of clapper is as we can see I above graph with the help of scope.
3.4 CONCLUSION: -
We can conclude from the above output results that we have successfully simulated doorbell mechanism operated by solenoid with given conditions as we can saw in above graph.
4. OBJECTIVE 1
THERMISTOR: -
A thermistor (or thermal resistor) is defined as a type of resistor whose electrical resistance varies with changes in temperature. Although all resistors’ resistance will fluctuate slightly with temperature, a thermistor is particularly sensitive to temperature changes. The working principle of a thermistor is that its resistance is dependent on its temperature. We can measure the resistance of a thermistor using an ohmmeter.
There are two types of thermistors:
- Negative Temperature Coefficient (NTC) Thermistor
- Positive Temperature Coefficient (PTC) 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. This is the most common type of thermistor.
In a PTC thermistor 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 devices.

4.1 SIMULINK MODEL: -

4.2 BLOCKS USED: -
- Signal Builder: - The Signal Builder block allows you to create interchangeable groups of piecewise linear signal sources and use them in a model. You can quickly switch the signal groups into and out of a model to facilitate testing. In the Signal Builder window, create signals and define the output waveforms.
- Simulink-PS Converter: - The Simulink-PS Converter block converts the input Simulink® signal into a physical signal. Use this block to connect Simulink sources or other Simulink blocks to the inputs of a Simscape physical network.
- Controlled Temperature Source: - The Controlled Temperature Source block represents an ideal source of thermal energy that is powerful enough to maintain specified temperature difference across the source regardless of the heat flow consumed by the system.
- Thermal Reference: - The Thermal Reference block represents a thermal reference point, that is, a point with an absolute zero temperature, with respect to which all the temperatures in the system are determined.
- Thermistor: - The Thermistor block represents an NTC thermistor which senses the temperature with respect to time.
- Battery: - The Battery block implements a generic dynamic model that represents the most popular types of rechargeable batteries.
- Voltage Sensor: - The Voltage Sensor block represents an ideal voltage sensor, that is, a device that converts voltage measured between two points of an electrical circuit into a physical signal proportional to the voltage.
- Electrical Reference: - The Electrical Reference block represents electrical ground. Electrical conserving ports of all the blocks that are directly connected to the ground must be connected to an Electrical Reference block. A model with electrical elements must contain at least one Electrical Reference block.
- 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.
- PS-Simulink Convertor: - The PS-Simulink Converter block converts a physical signal into a Simulink output signal. Use this block to connect outputs of a Simscape physical network to Simulink scopes or other Simulink blocks.
- Switch: - The Switch block passes through the first input or the third input signal based on the value of the second input. The first and third inputs are data input. The second input is control input. Specify the condition under which the block passes the first input by using the Criteria for passing first input and Threshold parameters.
- Constant: - The Constant block generates a real or complex constant value signal. Use this block to provide a constant signal input.
- Display: - The Display block shows the value of the output data. You can specify the frequency of the display. For numeric output data, you can also specify the format of display.
- Scope: - Display signals generated during simulation.in simple word display graph with respect to time.
4.3 Explanation Model and Output
The above model shows the thermistor is used to sense the temperature and switch is used to start and stop the fan.
1. Firstly, we add thermistor (NTC) block. The port (T) is connected with a controlled temperature source block. The block one port is connected to thermal reference and another port is connected to converter.
2. The temperature difference is set by the physical signal port (S)which is connected to signal builder block with help of Simulink-PS converter. This converter is used because we require physical signal for temperature source input. Our input signal given to signal builder is Simulink signal.
3. In signal builder we created an input signal for system. As per given condition as follow
0 - 10 sec – temperature is 293.15 k (20℃)
10 - 30 sec – temperature is 300.15 k (27℃)
30 - 50 sec – temperature is 296.15 k (23℃)

4. Here the temperature is converted to kelvin because the signal converter didn’t have the option of degree Celsius. Otherwise, there is another option, Apply Affine Conversion, also gave input signal unit is kelvin. Also selected solver requires input derivatives, you can either provide them explicitly through additional signal ports, or turn on input filtering to calculate time derivatives.


5. The battery and voltage sensor are connected in series and resistor is connected in parallel to voltage sensor. The solver configuration is also used to specify the solver parameter. The electric reference is also used to ground the electric system.
6. The voltage sensor is connected to switch to control the fan with the help of PS-Simulink converter to convert signal in Simulink input. After that we use scope to decide threshold value of switch. Also, we connected the display to show the last simulation value so we can decide our threshold value with the help of PS- Simulink converter.

7. In the switch decided threshold value. If the temperature is above the threshold limit, then it gave “1” as output which means fan switch on and if the temperature is below the threshold limit, then I gave “0” as output which means fan switch off.

8. At the end of system scope is connected to see output for fan on or off. We run the simulation for 50 sec because we take time limit in signal builder as 50 sec. So, we can get the following output,

In above graph we can saw form 0-10 sec signal is “0” because in this time the temperature was 20℃ which is below 25℃ mean fan is switch off. After that from 10-30 sec signal is “1” because in this time the temperature was 27℃ which is above 25℃ means fan is switch on. At the end from 30-50 sec signal is “0” because in this time the temperature was 23℃ which is below 25℃ mean fans was switch off.
5. Conclusion: -
We can conclude that from the above output results of our Simulink model for solenoid operated heaters give correct output and satisfy with all input conditions.
6. REFERENCE: -