Week -2
AIM:
- To make a Simulink Model of Door Bell using solenoid block.
- To make a Simulink Model Using a thermistor to sense the temperature of a heater & turn on or turn off the fan.
SOLENOID:
A solenoid is a type of electromagnet, the purpose of which is to generate a controlled magnetic field through a coil wound into a tightly packed helix. The coil can be arranged to produce a uniform magnetic field in a volume of space when an electric current is passed through it. The term solenoid was coined in 1823 by André-Marie Ampère to designate a helical coil. In engineering, the term may also refer to a variety of transducer devices that convert energy into linear motion. The term is also often used to refer to a solenoid valve, an integrated device containing an electromechanical solenoid which actuates either a pneumatic or hydraulic valve, or a solenoid switch, which is a specific type of relay that internally uses an electromechanical solenoid to operate an electrical switch for example, an automobile starter solenoid or linear solenoid. Solenoid bolts, a type of electromechanical locking mechanism, also exist. In electromagnetic technology, a solenoid is an actuator assembly with a sliding ferromagnetic plunger inside the coil. Without power, the plunger extends for part of its length outside the coil; applying power pulls the plunger into the coil. Electromagnets with fixed cores are not considered solenoids.
THERMISTOR:
A thermistor is a type of resistor whose resistance is dependent on temperature, more so than in standard resistors. The word is a combination of thermal and resistor. Thermistors are widely used as inrush current limiters, temperature sensors (negative temperature coefficient or NTC type typically), self-resetting overcurrent protectors, and self-regulating heating elements (positive temperature coefficient or PTC type typically).
Thermistors are of two opposite fundamental types:
- With NTC thermistors, resistance decreases as temperature rises. An NTC is commonly used as a temperature sensor, or in series with a circuit as an inrush current limiter.
- With PTC thermistors, resistance increases as temperature rises. PTC thermistors are commonly installed in series with a circuit, and used to protect against overcurrent conditions, as resettable fuses.
Thermistors are generally produced using powdered metal oxides. With vastly improved formulas and techniques over the past 20 years, NTC thermistors can now achieve accuracies over wide temperature ranges such as ±0.1 °C or ±0.2 °C from 0 °C to 70 °C with excellent long-term stability. NTC thermistor elements come in many styles such as axial-leaded glass-encapsulated (DO-35, DO-34 and DO-41 diodes), glass-coated chips, epoxy-coated with bare or insulated lead wire and surface-mount, as well as rods and discs. The typical operating temperature range of a thermistor is −55 °C to +150 °C, though some glass-body thermistors have a maximal operating temperature of +300 °C.
Thermistors differ from resistance temperature detectors (RTDs) in that the material used in a thermistor is generally a ceramic or polymer, while RTDs use pure metals. The temperature response is also different RTDs are useful over larger temperature ranges, while thermistors typically achieve a greater precision within a limited temperature range, typically −90 °C to 130 °C.
GOVERNING DIAGRAMS:
FOR SOLENOID:

Figure.1
Basic components used to generate a simple doorbell circuit are:
- Battery
- Switch
- Solenoid
- A bell with plunger.
FOR THERMISTOR:

Figure.2
Basic components used to generate a simple cooling fan circuit are:
- Battery
- ThermistorDOR
- Fan
- Transistor
- Resistor
OBJECTIVES:
FOR DOOR BELL:
- Create a situation where the switch is closed for 2 seconds and then released. Observe the physical movement of the plunger.
FOR FAN
- Temperature source should be 20 °C from 0 to 10 seconds, 27 °C from 10 to 30 seconds, 23 °C from 30 to 50 seconds. Fan conditions should be ON if the temperature above 25 °C, OFF otherwise.
SIMULINK MODEL:
DOOR BELL:

EXPLANATION:
- From the above governing circuit of a door bell, we know that we need a switch, solenoid, battery and a plunger.
- So, in order to get all these components into a Simulink model we have to taken blocks that perform same action what the above devices perform.
- Now first a ‘Solenoid Block’ is taken to represent a solenoid in the model, then to represent the battery we have taken Battery Block’ from the library browser.
- Then this ‘Solenoid Block’ and ‘Battery Block’ are connected to each other via positive and negative terminals.
- A ‘Switch Block’ is placed in between ‘Solenoid Block’ and ‘Battery Block’ and it is connected with both the blocks.
- Now for the Switch to operate we need to provide a physical signal through ‘PS’ port in the ‘Switch Block’. The provided physical signal should be greater than the threshold of the switch, for switch being closed, or else it will open.
- Now this whole battery, switch and solenoid path is connected to an ‘Electrical Reference Block’ which represents earthing of the circuit. This ‘Electrical Reference Block’ should be connected with negative port of the ‘Battery Block’.
- Then in the ‘Solenoid Block’, ‘R’ and ‘C’ are two variables which represent plunger and fixed point respectively.
- Now this ‘R’ is connected to a ‘R’ of ‘Ideal Translation Motion Sensor Bock’, which senses the position of the plunger in the ‘Solenoid Block’ and gives the output.
- Now in ‘Ideal Translation Motion Sensor Bock’ the outputs are given as ‘V’ and ‘P’ which represent the velocity and position of the plunger. Since we are only interested in knowing the change in position of the plunger, so we need only results from ‘P’ output.
- Now ‘C’ in the ‘Ideal Translation Motion Sensor Bock’ is a mechanical translation conserving port, which means that the mechanical process starts from ‘R’ and ends at ‘C’ and again it starts at ‘R’ and the cycle goes on.
- So ‘C’ in the ‘Ideal Translation Motion Sensor Bock’ is connected to a ‘Mechanical Translation Reference’ which represents a fixed point where it is rigidly clamped in real time.
- Similarly ‘C’ of ‘Solenoid Block’ is also connected to the same ‘Mechanical Translation Reference’ as fixed point for the solenoid.
- Since we position of the plunger as output from ‘Ideal Translation Motion Sensor Bock’ we have connected port ‘P’ to a ‘PS – Simulink Converter’ where the physical values from port ‘P’ are converted into Simulink value, and then this ‘PS-Simulink Converter’ is connected to ‘Scope Block’ which will generate a graph for change in position of plunger from port ‘P’ of ‘Ideal Translation Motion Sensor Bock’.
- Now to provide a physical signal for operating the switch, we have used a ‘Pulse Generator Block’, which generates a continuous square pulse.
- From the above Figure we can observe that we have taken we have given period value as ‘4’, pulse width as ‘50’, phase delay as ‘2’ and amplitude by default is ‘1’ we have not changed it. This means that initially the pulse will be zero, since we have given phase delay of ‘2’ so till 2 sec the pulse will be zero and at 2 secs the pulse will start from zero to 1 since we have given amplitude as ‘1’ and then now the pulse width will half of period ,so for the next two seconds the pulse will be at amplitude ‘1’ only, then it will again come down to zero at 4thsecond and then it will at zero for next 2 secs thus completing the period of 4 seconds.
- From starting to ending of the pulse it will take 4 secs of time period in which only for 2 secs the amplitude will be one and for rest of time it will be zero. So, after these 4 secs period again the pulse will be generated and thus cycle continues.
- To this ‘Pulse Generator Block’ a ‘Scope Block’ is connected to see how the pulse is generated.

- The above figure is obtained by running the Simulink model and double clicking on the ‘Scope1’ block. This figure shows, how the pulse is generated and in this figure the X-axis represents the time and Y-axis represents the amplitude. As mentioned in the point no.18, the pulse has started after 2 seconds, then for next two seconds it has amplitude of ‘1’ and then next two seconds the pulse is again zero. The pulse is starting from 2 seconds and ending at 6 seconds which nothing but a time period of two seconds.
- Thus, this represents that when amplitude is one, the switch will be closed and when it is zero the switch will open. Since our objective is only to see the change in position of plunger when switch s closed for 2 secs so the we have the amplitude as 1 for 2 secs in the pulse generator by making the pulse width half of the period in the inputs for ‘Pulse Generator Block’.
- Since the pulse that is coming from ‘Pulse Generator Block’ is a Simulink value, so to convert this value into a physical value we have used ‘Simulink-PS Converter Block’, since switch only takes physical value as inputs.
- As mentioned above the port ‘P’ of ‘Ideal Translation Motion Sensor Bock’ is connected to another ‘Scope Block’, and a ‘Solver Configuration Block’ is also connected to this path which generates equations and solves the whole model internally to give the results of the whole Simulink model as output.
- Now the run the model and double click on the ‘Scope’ Block which is connected to ‘Ideal Translation Motion Sensor Bock’ to get the results.

- We will get above graph as the result when we double click on the ‘Scope’ block. Here x-axis represents the time in seconds and y-axis represents position of plunger in mm
- From the above figure we can observe that the initial position of the plunger is at ‘5’, as from the pulse generator block, a pulse generated at 2, so in the position of the plunger is also changing at time 2 seconds and time till which the pulse amplitude is ‘1’ till that time the plunger is also at same position after the change from initial position.
- Again, as the amplitude of the pulse becomes zero, the plunger returns to its initial position back again and as the pulse cycle goes on, plunger also changes its position and comes back to its initial position.
- We can also observe that when there is a change in position of the plunger, there are some waves forms at the start of changes in position. This is due to recoil of the spring, each time when the plunger is moving. So to reduce this , in the ‘Solenoid Block’ we can reduce the spring constant value and increase the damping coefficient. This will reduce the waves that are being formed and we will get a smooth graph.
FOR FAN OPERATIONS USING THERMISTOR:

EXPLANATION:
- To create a Simple Cooling Fan model using Thermistor we need a thermistor, battery, resistor, voltmeter, a logical switch which are basic components of the circuit we need in the Simulink model.
- First to represent a thermistor, a ‘Thermistor Block’ is taken and placed in the model. Now to represent a battery, a ‘Battery Block’ is taken and the positive port of this block is connected to positive port of the ‘Thermistor Block’.
- Now to represent a resistor, a ‘Resistor Block’ is taken from the library browser and its positive port is connected to negative port of the ‘Thermistor Block’. The negative port of ‘Resistor Block’ is connected to the negative port of the ‘Battery Block’. Now a ‘Electrical Reference Block’ is connected near the negative terminal of the ‘Battery Block’ which represents the earthing of the real time circuit.
- Now to represent a voltmeter a ‘Voltage Sensor Block’ is connected parallel to the ‘Resistor Block’, because to measure to voltage across a component, voltmeter should be always connected parallel to that component.
- Thus, we have completed our simple circuit model, but we need some physical quantities to as signal for thermistor to work.
- In this case we need the fan to get ON and OFF at different temperatures. So, to provide temperature, we have used ‘Controlled Temperature Source Block’ which only gives a specified temperature as output even though heat flow is more.
- Now to give different temperatures to this ‘Controlled Temperature Source Block’ we need to send temperature signals. To send these signals we have used a ‘Signal Builder Block’ which allows use to send any type of signals as inputs.
- We have to double click on the ‘Signal Builder Block’ to set the signal according to our requirement.

- Above Figure shows how the signal are set in the ‘Signal Builder Block’. As this dialogue box opens, first we have to click on the “Signal” at the top and then select “New” then select “Custom” option. Now it will ask to give the values of y-axis and x-axis. Since we know that at which time, we need which temperature as mentioned in the starting, we can give those values in an array in this box and then the above figure signals are generated.
- We can see in the figure that how different temperature are given at different time. So thus, we have created our signals and before connecting it to the ‘Controlled Temperature Source Block’ we have to convert these signals into a physical value. So, to do this we have used a ‘Simulink-PS Converter Block’.
- So now the port ‘B’ of ‘Controlled Temperature Source Block’ is connected to port ‘A’ of the ‘Thermistor Block’ and port ‘A’ of ‘Controlled Temperature Source Block’ is connected to the a ‘Thermal Reference Block’. In ‘Controlled Temperature Source Block’ a positive temperature difference causes the temperature at port B to be greater than the temperature at port A.
- Now the output of the ‘Voltage Sensor Block’ is connected to ‘Scope Block’ first, and before connecting to the ‘Scope Block’ a ‘PS-Simulink Converter’ is used to convert physical value to Simulink values.
- Now when we run the simulation and double click on the ‘Scope Block’ we will get the following the graph.

- From the above figure we can see that how voltage is changing with change in temperature. Using this information, we can set conditions for fan to ONN and OFF.
- If we observe the graph, we notice that from time 0 to 10 seconds when temperature is 293K, voltage is between 0.0095 and 0.01 and from time 10 to 30 seconds when temperature is 300K, voltage is between 0.0125 and 0.013 and from time 30 to 50 seconds when temperature is 296K, voltage is nearly 0.011.
- As mentioned in the objective fan should be ONN when temperature is more than 25 degree Celsius, from the above graph when voltage is more than 0.011 the fan should ONN and when voltage is below 0.011, fan should be OFF.
- This above logic used to ONN and OFF the fan. To do this we have used a ‘Switch Block’ that routes the signals according to the conditions provided.
- The centre port of ‘Switch Block’ is connected to output of ‘PS- Simulink Converter’ which gives the voltage values. The top port of the ‘Switch Block’ is connected to a ‘Constant Block’ of value 1 and bottom port of the ‘Switch Block’ is connected to another ‘Constant Block’ of value 0.
- The centre port of ‘Switch Block’ is the condition input which means that when the value from ‘Voltage Sensor Block’ is more than the threshold value in the ‘Switch Block’ then it will pass the value 1 which we have specified in the top port of the ‘Switch Block’. If the voltage from ‘Voltage Sensor Block’ is less then the threshold value in the ‘Switch Block’ then it will pass the value 0 which we have specified in the bottom port of the ‘Switch Block’. Here it acts like a transistor in a real time circuit.
- To set the threshold value of ‘Switch Block’, we have to double click on the ‘Switch Block’ and then we can change the value of threshold. Since we want switch to be ONN only when temperature is 300K so the threshold is given as 0.011. So when voltage gets more than 0.011 the switch will give value 1 as output which means fan will be ONN and when voltage gets less than 0.011 the switch will give value 0 as output which means fan will be off.
- Now the output of ‘Switch Block’ is connected to another ‘Scope Block’ to get the results.

- By double clicking the Scope Block we can observe the above graph. Here we can clearly see that when temperature is 300K the fan is ONN and at remaining temperatures the fan is OFF.
CONCLUSIONS:
- Thus, both the objectives were achieved successfully.
- Similar approach can be used for simulating other physical devices using Simulink.