Minors mod 2

Capacitive sensors

​A capacitive sensor is a device that detects nearby objects without touching them.

​It works by measuring changes in an invisible electrical field.

​It can spot both metal objects and non-metal objects like plastic or water.

​Inside the sensor, two metal plates are separated by an insulating gap.

​When power is turned on, the sensor stores electrical energy between these plates.

​Bringing metal objects closer makes the stored energy field stronger.

​Bringing non-metal objects into the field changes the insulating gap, which also alters the energy level.

​Car airbags use these sensors to detect sudden crashes.

​Tanks use them to check water or fuel levels as liquids rise and fall.

​These sensors last a long time because they have no moving parts to break.

​However, dirt, dust, or unwanted moisture can easily confuse them.




Design of the Mechatronic System

​A mechatronic system combines mechanical hardware with electronics and software to automate a task. For this parking lot, it consists of four main parts:

​Sensors (Input): These act as the "eyes" of the system. They detect whether a parking spot is empty or taken and notice when a car approaches the entry or exit gates.

​Controller (Processing): This is the "brain" of the system (such as an Arduino, ESP32, or PLC). It receives signals from the sensors, keeps track of the total open parking spots, controls the gate movements, and updates the display board.

​Actuators (Output): These act as the "muscles" of the system. They are the electric motors (like servo motors) that physically raise and lower the gate barriers.

​Display (Interface): A digital screen at the entrance that shows drivers how many parking spots are currently free.

​2. Ultrasonic Sensors vs. IR Sensors for Slot Occupancy

​To know if a parking spot is full, you need to pick the right sensor:

​Ultrasonic Sensors:

​How they work: They send out high-frequency sound waves (like a bat) and measure how long it takes for the sound to bounce back from a car.

​Why they are suitable: They are very reliable indoors and outdoors. Sunlight, dust, vehicle color, or dark paint do not mess up their readings.

​Infrared (IR) Sensors:

​How they work: They project a beam of light and check for reflections.

​Why they are less suitable: Bright sunlight, dark vehicle paint (which absorbs light), or dirt on the lens can trick the sensor into giving wrong readings.

​Conclusion: Ultrasonic sensors are the better choice for accurate vehicle detection.

​3. Sensor, Controller, and Actuator Interaction at the Gate

​Here is the step-by-step flow of how a car enters or exits:

​Detection: A car drives up to the gate and triggers an entry sensor.

​Decision: The sensor sends a signal to the controller. The controller checks if there are empty slots available.

​Action: If a slot is free, the controller sends electricity to the actuator motor, which lifts the barrier arm up.

​Closing: After the car drives through, a second sensor detects that the car has safely cleared the gate. The controller then tells the motor to lower the barrier back down and subtracts 1 from the available count.

​4. Preventing Double Counting (Simultaneous Entry & Exit)

​If two cars enter and exit at the exact same millisecond, a basic computer program might get confused and skip a count. Here is how to fix that:

​Separate Lanes: Use physically separate entry and exit lanes, each with its own sensor wired to a different pin on the controller.

​Interrupt Coding: Use "interrupts" in the controller's code. Interrupts pause the main program for a split second to register a count immediately when a sensor triggers, making sure no car signal is missed.

​Locks in Code (Mutex): Use a coding technique where only one process can update the slot total at a time. If both gates trigger at once, the system processes entry first, updates the number, and then processes exit immediately after.



Case Study 2: Hospital Fire Management System

​This system needs to spot fires early, turn on alarms, start sprinklers, and automatically unlock exit doors while avoiding false alarms from things like kitchen steam.

​a) Two Suitable Sensors for Reliable Fire Detection

​Optical (Photoelectric) Smoke Detector:

​How it works: It shines a beam of light inside a chamber. When smoke enters, it scatters the light onto a sensor, which triggers the alarm.

​Why it is used: It is great at detecting slow, smoldering fires before big flames start.

​Heat / Temperature Sensor (Thermistor or Rate-of-Rise Sensor):

​How it works: It measures how hot the room gets or how fast the temperature is rising.

​Why it is used: It helps avoid false alarms. Steam from a kitchen might look like smoke, but it won't trigger a sudden high-heat reading like a real fire.

​b) Actuators Required and Their Energy Source

​Actuators are the output devices that physically do something when triggered:

​Solenoid Water Valves (Electrical): Opens the water pipe to turn on the sprinklers.

​Solenoid / Magnetic Door Locks (Electrical): Cuts off power to electro-magnetic locks so emergency exit doors open automatically.

​Fire Alarm Bells / Buzzers (Electrical): Makes a loud sound to alert everyone in the hospital.

​Exhaust Fans / Fire Dampers (Pneumatic or Electrical): Uses air pressure or electricity to close air ducts and stop smoke from spreading.

​c) Closed-Loop vs. Open-Loop Control System

​Open-Loop System (No Feedback):

​The system turns on a sprinkler or unlocks a door, but never checks if the action actually worked.

​Problem: If a valve is stuck closed or a door stays jammed shut, the system doesn't know and won't give an alert.

​Closed-Loop System (With Feedback):

​The system sends a command and then checks sensors to make sure the task was completed successfully.

​Example: The controller signals the sprinkler valve to open, and a flow-switch sensor confirms water is actually flowing. If no water flows, it immediately alerts the control room.

​Why Closed-Loop is Better: It makes the system far more reliable because it detects failures in real-time to protect lives.