Week -2
Aim:
This challenge aims to make a Simulink model of a doorbell using a solenoid blockand make another Simulink model where a thermistor will be used to sense thetemperature of a heater & turn it on or turn it off the fan.
Objective:
1. Make a Simulink model of Doorbell using a solenoid block with the following details:
In the above arrangement, when the switch is closed the electromagnet receiveselectrical power from the battery and pulls the metal arm to hit the bell producingsound. Create a situation where the switch is closed for 2 seconds and then released.Observe the physical movement of the plunger. Assume remaining parameters.
2. Use a thermistor to sense the temperature of a heater & turn on or turn off the fan asper 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.
Solution of Objective-1:
Theory:
Doorbell:
A doorbell is a signaling device typically placed near a door to a building's entrance.When a visitor presses a button the bell rings inside the building, alerting the occupantto the presence of the visitor. The heart of a doorbell is an electromagnet.Electromagnets are coils of wire wrapped around a small piece of magnetic metal.When electricity passes through the wire, it creates a magnetic field around the wire.When you press a doorbell button, you complete an electrical circuit that allowshousehold electricity to flow through the doorbell's internal electromagnet.The magnetic field generated by the electromagnet is then used to powera mechanism that creates the doorbell sound.
Doorbells are low-voltage devices. This means they require relatively little energy tooperate. An important part of a doorbell mechanism is the transformer.The transformer converts regular 120-volt household current to thelower voltage (usually somewhere between 6-16 volts) required by the doorbell.
Solenoid:
A solenoid is a 3-dimensional structure of wire. When this wire is wrapped arounda metallic block in a coil and electricity is passed through it, it has somespecial magnetic properties. Electromagnetic induction makes it an electromagnet thatcan be switched on or off. The side in which the current appears to be passing clockwiseis the South Pole, and the side in which the current seems to be passing anticlockwise isthe Northern Pole. The solenoid works just like a bar magnet and therefore has manyuses. This principle is used to create valves, among other things. Where the solenoidoperates an electric switch, it is a relay.


Simulink Model of Objective-1:

The figure above is the representation of "A doorbell operated on solenoid". In thismodel, some blocks are used to make the working model of the doorbell. These blocksare:
1. Pulse Generator:
The Pulse Generator block generates square wave pulses at regularintervals. The block waveform parameters, Amplitude, Pulse Width, Period, and Phasedelay, determine the shape of the output waveform.
2. Simulink-PS Converter:
Converts the unitless Simulink input signal to a PhysicalSignal.
3. Scope:
Display signals generated during simulation.
4. Switch:
Switch controlled by an external physical signal.
5. Battery:
The Battery block represents a simple battery model.
6. Solenoid:
Model electrical characteristics and generated force of solenoid.
7. Ideal Translational Motion Sensor:
The Ideal Translational Motion Sensor blockrepresents a device that converts an across variable measured between twomechanical translational nodes into a control signal proportional to velocity or position.You can specify the initial position (offset) as a block parameter. The sensor is idealsince it does not account for inertia, friction, delays, energy consumption, and so on.
8. Mechanical Translational Reference:
The Mechanical Translational Reference blockrepresents a reference point, or frame, for all mechanical translational ports. Alltranslational ports that are rigidly clamped to the frame (ground) must be connectedto a
Mechanical Translational Reference block.
9. Electrical Reference:
The Electrical Reference block represents an electrical ground.Electrical conserving ports of all the blocks that are directly connected to the groundmust be connected to an Electrical Reference block. A model with electrical elementsmust contain at least one Electrical Reference block.
10. Solver Configuration:
The
Solver Configuration
block specifies the solver parametersthat your model needs before you can begin the simulation.
11.PS-Simulink Converter:
Convert physical signal into Simulink output signal.
Model Explanation:
1. The pulse generator is used to give the signal input where, Amplitude=1, Period=4 sec,Pulse width= 50%, and Phase delay= 2 sec. (See Fig 4.)
2. After that, the input signal is converted into physical form with the use of "Simulink-PSConverter"
and further send to the switch of the electrical circuit.
3. The electrical circuit consists of a solenoid, a battery, and a switch. One end of thesolenoid is connected to the battery and its other end is connected to the switch. Anelectrical reference is provided in the electrical circuit.
4.The mechanical part of the solenoid is connected to an ideal translation motion sensorand mechanical translational reference.
5.The P-port of the sensor makes a connection with the "PS-Simulink Converter"
toprovide the output in signal form. Further, the converter is connected with scope todisplay our output signal.
6.A solver configuration is connected to an electrical circuit to solve all parameters beforethe beginning of the simulation.


Output:
Here we can see that the switch is closed for 2 seconds and after that switch is open.Amplitude= 0 means the switch is closed. It can also be seen that the plunger strikesafter every 2 seconds.
The motion of the plunger was simulated and recorded and plotted in scope.

Solution of Objective-2:
Theory:
A thermistor (or thermal resistor) is defined as a type of resistor whose electricalresistance varies with temperature changes. Although all resistors’ resistance willfluctuate slightly with temperature, a thermistor is particularly sensitive to temperaturechanges.
Thermistors act as a passive component in a circuit. They are an accurate, cheap, androbust way to measure temperature. While thermistors do not work well in extremely hotor cold temperatures, they are the sensor of choice for many different applications.

SIMULINK MODEL-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.
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.

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: -