Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

You are to develop a control code to fulfill these specifications: The Force Sensor can sense a force from 0 N to 1 0 N

You are to develop a control code to fulfill these specifications:
The Force Sensor can sense a force from 0N to 10N at input A0.
If the force is below 3N then only green LED is blinking.
If the force is above 6N then only red led is blinking.
Otherwise, both LEDs are blinking.
The servo angle is continuously controlled such that it varies automatically from 0O at 0N to 180O at 10N. That is, the limits are: 0N gives 180O (fully opened); 10N gives 0O (fully closed).
The blinking delay time of LEDs is such that 0N causes a long delay of 800ms; and 10N causes short delay of 80ms. Meaning the blinking rate is inversely proportional to the force. So, low force gives slow blinking, high force gives fast blinking.
The sensed force value, the blinking rate, and the rotated angle are to be displayed on the serial monitor.
Force sensor output value in decimal are 0N produces a decimal 0; 10N produces 870 in decimal.
Assume the application scenario as this:
The force sensor is attached to a window.
The opening-and-closing angle of the window is controlled by the servo.
If the wind blowing on to the window causes a force of below 3N, then is considered a safe cool breeze day and ok to open the window with large angle as controlled by the servo. The green LED is blinking at slower rate.
If the force by the wind is above 6N, then red LED is blinking at a faster rate as a sign of warning of strong wind blowing, and the window is opened at smaller angle by the servo control. When the force is 10N the window is totally closed (0O) and the red LED is blinking very fast.
Otherwise, both LEDs are blinking alternately indicating it is a windy day and the window angle is appropriately adjusted by the servo.

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database Management Systems Designing And Building Business Applications

Authors: Gerald V. Post

1st Edition

0072898933, 978-0072898934

More Books

Students also viewed these Databases questions