Challenge

Week -2

AIM :

  1. To create a Simulink Model of Doorbell using Solenoid block.
  2. To sense the temperature of a heater and turn on/off the fan using Thermistor block in Simulink.

OBJECTIVE 1 :

  • To Make a Simulink model of Doorbell using solenoid block.
  • To create a situation where the switch is closed for 2 seconds and then released.
  • To observe the physical movement of the plunger.

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 occupant to the presence of the visitor. Although the first doorbells were mechanical, activated by pulling a cord connected to a bell, modern doorbells are electric, operated by a pushbutton switch. Modern doorbells often incorporate intercoms and miniature video cameras to increase security.

Working Principle :- The most important part of a door bell is its magnetic motor. The magnetic motor constitutes a conventional electromagnet. We know that an electromagnet is an arrangement in which a coil of wire is wrapped around magnetic material which produces magnetic field when electricity is passed through the coil. The greater the coiling of the wire, the higher the amplification of magnetic field. This magnetic field produces a substantial effect on any magnetic substance when brought in the vicinity of its magnetic field. This means that when an iron object is placed in this magnetic field, it will be attracted towards the magnetic field due to polar orientation generated by the electromagnetism.

When the door bell button is pressed, the electrical circuits closes and results in the generation of an electromagnetic field. The magnetic field attracts the iron bar, which pulls the contact arm away from the metal contact. The moving away of the contact arm breaks the circuit and thus turns off the electromagnet. The contact arm snaps back to its original position. This closes the electrical circuit and reestablishes the flow of electrical current through the circuit. Once again the magnetic field is generated and the process repeats itself.

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 a current is pass through it. The term solenoid was coined in 1823 by Andre-Marie Ampere to designate a helical coil. In Engineering the term may also refer to variety of transducer device that convert energy into linear motion. The term is also often use to refer to a solenoid valve, an integrated device containing an electromechanical solenoid which actuate either a pneumatic value or hydraulic valve, or a solenoid switch, which is specific type of Relay that internally uses an electromagnetic solenoid to operate an electric 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. Electromagnet with the fix core is not considered solenoids.

Working Principle :- The solenoid simply works on the principle of electromagnetism. When the current flow through the coil magnetic field is generated in it, if you place a metal core inside the coil the magnetic lines of flux is concentrated on the core which increases the induction of the coil as compared to the air core.

Most of the flux is concentrated only on the core, while some of the flux appears at the ends of the coil and a small amount of flux appears outside the coil.The magnetic strength of the solenoid can be increased by increasing the density of the turns or by increasing the current flow in the coil.Like all other magnets the activated solenoid has both Positive and Negative poles, through which an object can be attracted or repelled.

Simulink Blocks Used in the model:

  1. 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. The following diagram shows how each parameter affects the waveform.
  2. Scope: To view te characterictics of a property with respect to the time. Scope is connected with Ideal Translation Motion Sensor to get the output. The real-time Scope block acquires data in chunks of size Number of samples from the real-time application that is executing on the target computer.
  3. Simulink-Ps Converter: This Block convert simulink signals into physical signal for operational use in Model.
  4. Ps-Simulink Converter: These are basically the converter from Physical systems to Simulink signals for operational use in Model.
  5. Switch: Switch is a device the completes the electric circuit for current flow and can be controlled manually or automatically depends on the type of switch required.
  6. Battery: It provides voltage to the system.
  7. Solenoid: The Solenoid block represents the electrical characteristics and generated force for the solenoid .It shows the position of the plunger with respect to the EMF induced, which depends on the initial position of the plunger. Both positive and negative currents generate a force that pulls the plunger towards the winding.
  8. Electrical and Mechanical references: It is a reference block with which the system has a ground source as a base.
  9. Ideal Translational Motion Sensor: The block represents an ideal mechanical translational motion sensor, that is, a device that converts an across variable measured between two mechanical translational nodes into a control signal proportional to velocity and position.
  10. Solver Configuration: It's a type of block that acts as a complete equation for where `f(x) = 0` where we find the value of x and generate the output which represents the block diagram as an equation.

SIMULINK MODEL :

The below figure shows the Simulink model of Doorbell using solenoid block.

Link to the Model : https://drive.google.com/file/d/1KYOgcYu3Y5nUzIFq2luN0x8HwOG-M6h5/view?usp=sharing

EXPLANATION:

  • To get the entire component in simulink model we have to select the block that perform same action what the above device perform.
  • Now first a Solenoid block is taken to represent a solenoid in the model, then to represent battery we have taken Battery Block from the library Browser.
  • Then this Solenoid Block & Battery Block are connected to each other via positive and negative terminals.
  • A Switch Block is placed between Solenoid Blocks and Battery Block and is connected with both Blocks.
  • Now for switch to operate we need to provide 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 close, or else it will be open.
  • Now this whole Battery Switch and Solenoid path is connected to an Electric Reference Block which represents earthing of the circuit. This Electric Reference Block should be connected to the negative terminal of Battery Block.
  • Then in the solenoid block 'R' and 'C' are two variable which represent Plunger and Fixed Point respectively.
  • Now the solenoid 'R' is connected to 'R' of Ideal Translation Motion Sensor Block which senses the position of plunger in the Solenoid Block and gives the Output.
  • Now in the Ideal Translation Motion Sensor Block the output are given as V & 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 of 'P' output.
  • Now 'C' in the Ideal Translation Motion Sensor Block is a mechanical translation conserving port, which means that the mechanical process starts from 'R' and end at 'C' and again it start at 'R' and the cycle goes on.
  • So 'C' in the Ideal translation Motion sensor block is connected to Mechanical Translation Reference which represents a fix point where it is rigidly clamped in real time.
  • Similarly 'C' of the solenoid block is also connected to the same Mechanical Translation Reference as fixed point for solenoid.
  • Since we position of the plunger as output from Ideal Translation Sensor Block we have connected portp to a ‘PS-Simulink Converter’ where the Physical value 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 Block’.
  • 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 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 the end of 2 sec the Pulse will start rising from Zero to 1, Since we have given Amplitude as 1 and then now the Pulse width will be Half of Period, So for the next 2 seconds the Pulse will be at Amplitude 1 only, then it will again come down to zero at 4th Second and then it will be Zero. So, after these 4 seconds period again the pulse will be generated and thus cycle continues.
  • From starting to ending of the Pulse it will take 4 sec of time period in which only for 2 secs the Amplitude will be 1 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 a Scope Block is connected to see how the Pulse is generated.
  • By running the Simulink Model and double clicking the Scope1 Block. It shows how the Pulse is generated and in this figure the X-axis represents the Time and Y-axis represents the Amplitude. The Pulse has started from 2 sec and ending at 6 sec which is nothing but a time period of 2 secs.
  • Thus, this represents that when amplitude is 1, the switch will be close and current will start flowing and when it is zero the switch will open and current stop flowing. Since our objective is only to see the change in position of Plunger when Switch is Close for 2 sec , so we have the Amplitude as 1 for 2 sec in the Pulse generator by making the Pulse width half of the period in the inputs fir Pulse Generator Block.
  • Since the Pulse that is coming from Pulse Generator Block is a Simulink value, so to convert this value into Physical value we have used Simulink-PS Converter Block, since Switch only takes Physical value as Inputs.
  • As mention above, the port 'P' of Ideal Translation Motion Sensor Block is connected to another Scope1 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 output.

RESULTS :

  • Pulse Generator


  • Now Run the Model and Double click on the Scope1 Block which is connected to Ideal Translation Motion Sensor Block to get the results.
  • We will get the Graph as the result when we double click on Scope1 Block. Here X-axis Represent the Time and the Y-axis represent position of Plunger in mm.
  • From the above figure we can observe that the initial position of the Plunger is at 5mm as from 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 plunger is also at the same position after the change from initial position.


  • Again, as the Amplitude of the Pulse become zero, the Plunger returns to the Original position back again and as the pulse cycle goes on, Plunger is also at same position after the change from initial position.
  • We can also observe that when there is change in position of the Plunger, there is some Wave form at the start of change in position. This is due to recoil of 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.
  • The below figure is a smoother graph than previous one. This was done by changing the value of spring constant and Damping Coefficient in the Solenoid Block.


CONCLUSION :

  • When the switch is closed for 2 seconds using a pulse generator, solenoid receives power and the plunger moves from a position R to position C against the spring and the metal arm hits the bell, producing sound.
  • Physical movement of the plunger is observed by using translational motion sensor & physical output is converted into Simulink output model is displayed in the scope. By reducing the spring constant value and increasing the damping value vibrations will be reduced.

OBJECTIVE 2 :

  • To make a simulink model using a thermistor to sense the temperature of a heater & turn on or turn off the fan as per the 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.

THEORY :

Thermistor: A Thermistor is a type of Resistor whose Resistance dependent on temperature, more so than is standard resistors. The word is a combination of thermal and resistor. Thermistor are widely used as inrush current limiters, temperature Sensor (negative temperature coefficient or NTC type typically), self-resetting overcurrent protector, and self-regulating heating elements (positive temperature coefficient or PTC type typically).

Depending on materials used, thermistors are classified into two types:

  • With NTC thermistors, resistance decreases as temperature rises; usually due to an increase in conduction electrons bumped up by thermal agitation from the valence band. 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; usually due to increased thermal lattice agitations particularly those of impurities and imperfections. PTC thermistors are commonly installed in series with a circuit, and used to protect against overcurrent conditions, as resettable fuses.


Thermistors differ from resistance temperature detectance (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.

Simulink Blocks Used in the model:

  1. 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.
  2. 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.
  3. 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.
  4. Thermistor: A Thermistor is a type of resistor whose resistance dependent on temperature, more so than in standard resistors. The word is combination of Thermal + Resistor. The Thermistor block represents an NTC Thermistor using the B-parameter equation. NTC – Negative Terminal Coefficient
  5. Resistor:The Resistor block model a linear resistor. A resistor is a passive two-terminal electrical component that implements electrical resistance as a circuit element. In electronic circuits, resistors are used to reduce current flow, adjust signal levels, to divide voltages, bias active elements, and terminate transmission lines, among other uses.
  6. 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 a control input. Specify the condition under which the block passes the first input by using the Criteria for passing first input and Threshold parameters.
  7. Simulink-Ps Converter: This Block convert simulink signals into physical signal for operational use in Model.
  8. Ps-Simulink Converter: These are basically the converter from Physical systems to Simulink signals for operational use in Model.
  9. Battery: It provides voltage to the system.
  10. Scope: To view te characterictics of a property with respect to the time. Scope is connected with Ideal Translation Motion Sensor to get the output. The real-time Scope block acquires data in chunks of size Number of samples from the real-time application that is executing on the target computer.
  11. Solver Configuration: It's a type of block that acts as a complete equation for where `f(x) = 0` where we find the value of x and generate the output which represents the block diagram as an equation.
  12. Electrical and Thermal references: It is a reference block with which the system has a ground source as a base.
  13. Constant Block: The Constant block generates a real or complex constant value signal. Use this block to provide a constant signal input. The block generates scalar, vector, or matrix output, depending on:
  • The dimensionality of the Constant value parameter
  • The setting of the Interpret vector parameters as 1-D parameter
  • The output of the block has the same dimensions and elements as the Constant value parameter.

SIMULINK MODEL :

The below figure shows the Simulink model of Simple fan using Thermistor block.


Link to the Model : https://drive.google.com/file/d/1r5EFUfO_pfb4kK5rLwrVEcGXG9htV9oI/view?usp=sharing

EXPLANATION:

  1. To create a Simple Fan Cooling Model using Thermistor,Battery,Resistor,Voltmeter, a logical switch which are basic component of the circuit we need in Simulink model.
  2. First to represent a Thermistor, a Thermistor Block is taken and placed in model. Now to represent Battery, aBattery Block is taken and the positive terminal of this block is connected to positive port of the Thermistor Block.
  3. Now to represent a Resistor, a Resistor Block is taken from Library browser and its positive port is connected to negative port of Thermistor Block. The negative port of Resistor Block is connected to negative port of Battery Block. Now a Electrical Reference Block is connected near the negative terminal of the Battery Block which represent the Earthing of the real time circuit.
  4. Now to represent a Voltmeter a Voltage Sensor Block is connected parallel to the Resistor Block, because to measure the voltage across a component, voltmeter should always connected parallel to that component.
  5. Thus, we have completed our simple circuit Model, but we need some Physical Quantities to as Signal for Thermistor to work.
  6. 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 will gives a specified temperature as output even though heat flow is more.
  7. Now to give different temperature 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.
  8. We have to double click on the Signal Builder Block to set the signal configuration according to our requirement
  9. Figure(1) shows how signals are set in the Signal Builder Block. As this Dialogue Box opens, first we have to click on Signal at the top and then select New then select Custom option. Now it will ask to give the value 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.
  10. We can see in the figure(2) that how different temperatures 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 Physical Value. So, to do this we have used a Simulink-PS Converter Block.
  11. 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’.
  12. 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.
  13. Now when we run the simulation and Double click on the Scope Block we will get the followin Graph.
  14. From the above figure we can see that how voltage is changing with the change in temperature. Using this information, we can set condition for Fan to ON & OFF.
  15. If we observe the graph, we notice that from time 0 to 10 seconds when the temperature is 293K, Voltage is between 0.0095 and 0.01 and from time 10 to 30 seconds when the temperature is 300K, Voltage is between 0.0125 and 0.013 and from time 30 to 50 seconds when the temperature is 296K, Voltage is nearly 0.011.
  16. As mention in the objectives fan should be ON when the temperature is more than 25 degree Celsius i.e. 298.15K, from the above graph when voltage is more than 0.011 the Fan should get ON and when the Voltage is below 0.011, Fan should get OFF.
  17. This above Logic used to ON and OFF the Fan. To do this we have used a Switch Block that routes the Signal according to the conditions provided.
  18. The center 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 the bottom port of the Switch Block is connected to another Constant Block of value ‘0’.
  19. The center 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 the Voltage Sensor Block is less than the Threshold value in the Switch Block then it will pass the value ‘0’ which we have specified in the bottom port of Switch Block. Here it acts like a Transistor in Real time Circuit.
  20. To set the Threshold value of the Switch Block, we have to Double click on the Switch Block and then we can change the value of Threshold. Since we want to be ON only when the temperature is 300K so the Threshold value is given as {0.011}. so when the Voltage gets more than 0.011 the Switch will give value ‘1’ as output which means Fan will be ONN and when Voltage get less than 0.011 the Switch will give value ‘0’ as output which certainly means Fan will get OFF.
  21. Now the output of Switch Block is connected to another Scope Block to get results.
  22. By Double clicking the Scope Block we can observe the Graph. Here we can clearly see that when temperature is 300K the Fan is ON and at remaining temperature the Fan is OFF.


RESULTS :

  • Signal Builder

Given inputs :

At Point-1 - Time 0 sec - Temperature is 293K,

At Point-2 - Time 10 sec - Temperature is 293K,

At Point-3 - Time 10 sec - Temperature is 300K,

At Point-4 - Time 30 sec - Temperature is 300K,

At Point-5 - Time 30 sec - Temperature is 296K,

At Point-6 - Time 50 sec - Temperature is 296K,


Figure (1).


  • The temperature of the heater is supplied to thermistor to sense it. Now in order to run the fan when temperature reaches the value of 298K we have to trigger the circuit with some external supply of battery and as there is no device to calculate the resistance value of thermistor so we have attached another resistor in series across the terminal in series. The voltage sensor is attached across the resistor to calculate the voltage drop into it & this voltage drop value is inputted as threshold value to the switch to start the fan & fan will go on when threshold value is more than 0.1099.


Figure (2).


  • From 0-10 seconds fan is OFF because the temperature is 293K which is below 298K, after 10 seconds it goes to 300K, so fan will turn ON because temperature exceeds 298K. after 30 seconds fan will turn OFF because temperature goes 296K less than 298 K.


CONCLUSION :

  • The model is simulated successfully and the temperature is varied according to the requirements.
  • The thermistor senses the temperature and accordingly if the temperature is above 25°C then the fan is turned-ON otherwise it is OFF.

REFERENCES :

Your portfolio, next

Ship work like this
in your own course.

Talk to a career counsellor

Free 20-minute call. We'll map the right course to where you want to work.

By submitting you agree to our Terms and Privacy Policy.