Control servo motors and pumps based on sensor measurements
The Parallax Feedback 360° High-Speed Servo provides the functionality of a light-duty standard servo, continuous rotation servo, high-speed servo, and encoder in one convenient package.
Please note that the power switch of the activity board should be in position 2. You can connect the servo motor to one of the servo pins. Please use pins 16 and 17 and make sure the jumper is set to Vdd (regulated 5 VDC for this board). We should also provide power using a 7 Volt adaptor to supply adequate power/current for the servo.
The pump houses a flexible tube fitted in a circular pump casing. The pump works through a rotary motion that displaces the fluid inside the tube at a constant rate by squeezing fluid against the pump housing.
The outlet Power Relay Module (EKM-Switch120) is a power cord that switches 120 AC voltage with a DC control voltage of 3.3--60 VDC, which allows it to be controlled remotely. It has three types of outlets: always ON, normally ON, and normally OFF.
Connection: Connect the relay module to 'relay 1' socket (or 'relay 2' socket) on the green custom-designed board mounted on the activity board.
Create a script that:
| Condition | Action |
|---|---|
| Relative humidity > threshold | Spin the servo motor 360° per second (fan ON). Otherwise, set speed to 0. |
| Soil moisture < threshold | Turn on the pump until soil moisture returns to desired level. |
Save your code as: Lab7_YourInitials_actuators (e.g., Lab7_AM_actuators)
Set pin 13 (which is relay 1) high to turn on the pump.
You have four functions, name them as:
Submit your code saved as a *.svg file.
Naming: Lab7_YourInitials_actuators.svg