Week -2
- AIM: -
Make a Simulink model of doorbell using a solenoid block and use a thermistor to sense the temperature of a heater & turn on or turn off the fan.
- OBJECTIVE: -
- Make a Simulink model of a Doorbell using a solenoid block under given conditions. Create a situation where the switch is closed for 2 seconds and then released. Observe the physical movement of the plunger.
- The temperature source should be 20 °C from 0 to 10 seconds, 27 °C from 10 to 30 seconds, and 23 °C from 30 to 50 seconds. Fan conditions should be ON if the temperature exceeds 25 °C, OFF otherwise.
THEORY: -
SOLENOID:

Basic components used to generate a simple doorbell circuit are:
- Battery
- Switch
- Solenoid
- A bell with a plunger.
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 that 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. A solenoid is an actuator assembly with a sliding ferromagnetic plunger inside the coil in electromagnetic technology. 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:

Basic components used to generate a simple cooling fan circuit are:
- Battery
- Thermistor
- Fan
- Transistor
- Resistor
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, and 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 more extensive temperature ranges, while thermistors typically achieve a greater precision within a limited temperature range, typically −90 °C to 130 °C
- DOOR BELL

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 the 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 words display a graph concerning time.
Explanation Model and Output: -
- First, the pulse generator block is used to give signal inputs like amplitude, pulse width, period, and phase delay to determine the shape of the output length.
- The scope is used to see the graph of wavelength.

- After that Simulink-PS Converter is used to convert signal input to the physical system and send it to the switch block.
- To complete the circuit the battery, switch, and solenoid block are used and connect. 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.
- The mechanical part of the solenoid (clapper) is connected with the ideal translation motion sensor because the motion of the clapper is the translation and for the ground, the mechanical translation reference is used.
- 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, and at first, a phase delay of 1sec is given. Amplitude is equal to 0 means the switch is closed. We can also see that the clapper rings every 2 seconds. The motion of the clapper is as we can see in I above graph with the help of scope.
- THERMISTOR

BLOCKS USED: -
- SignalBuilder: - 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 differences 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, concerning which all the temperatures in the system are determined.
- Thermistor: -The Thermistor block represents an NTC thermistor that senses the temperature concerning 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 the 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 the simulation.
- PS-Simulink Converter: -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 inputs. The second input is the control input. Specify the condition under which the block passes the first input by using the Criteria for passing the 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 the display.
- Scope: -Display signals generated during simulation.in simple words display a graph concerning time.
EXPLANATION:
- To create a Simple Cooling Fan model using a Thermistor we need a thermistor, battery, resistor, voltmeter, and 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 the 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 the negative port of the ‘Thermistor Block’. The negative port of the ‘Resistor Block’ is connected to the negative port of the ‘Battery Block’. Now an ‘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 the voltage across a component, the voltmeter should be always connected parallel to that component.
- Thus, we have completed our simple circuit model, but we need some physical quantities as signals for the 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 the ‘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 us to send any type of signal as inputs.
- We have to double click on the ‘Signal Builder Block’ to set the signal according to our requirement.

- The above Figure shows how the signal is 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 the “Custom” option. Now it will ask to give the values of the y-axis and x-axis. Since we know 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 how different temperatures are given at different times. So thus, we have created our signals and before connecting them 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 ‘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 the ‘Scope Block’ first, and before connecting to the ‘Scope Block’ a ‘PS-Simulink Converter’ is used to convert the physical values to Simulink values.
- Now when we run the simulation and double click on the ‘Scope Block’ we will get the following graph.

- As per the given condition the fan should be turned off when the temperature falls below 25 degrees (298.15K).
- To find the threshold value of the voltage, we are giving the input as 298.15K

- After running the simulation, we'll get the voltage value as 0.01196
-

Then, we'll set the threshold value for the switch as 0.01196 so that, if it goes below 0.01196 then the fan shouldn't turn on.

Results:

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