Week 9: Output Devices¶
Group assignment:¶
Measure the power consumption of an output device. Document your work on the group work page and reflect on your individual page what you learned.
Individual assignment:¶
Add an output device to a microcontroller board you’ve designed and program it to do something
Group assignment:¶
In order to carry out this week’s task, we carried out online with our colleague Ronal from Huanuco and Wilber from Pasco. The link to our group work is:
Fluke 87V Industrial Multimeter¶
For voltage, resistance and continuity tests, we use the Fluke brand multimeter. It is a piece of equipment of excellent quality and highly recommended for its precision and reliability.
Main features
- True RMS AC voltage and current for accurate measurements for non-linear signals.
- Selectable filter for accurate frequency and voltage measurements in variable speed drives.
- 0.05% DC Accuracy 6000 counts, 3-3/4 digits.
- 4-1/2 digit resolution for accurate measurements (20,000 counts).
- Measurements up to 1000 V AC and DC.
- Measurement up to 10 A; 20 A for a maximum of 30 seconds.
- Integrated thermometer that avoids the need to carry an additional tool (temperature probe included).
- FFrequency up to 200 kHz and duty cycle (in %).
- Resistance, continuity and diode test.
- 10,000 µF capacitance range on motors and components.
- Recording of minimum, maximum and average values with alarm for automatic capture of variations
- Peak capture to record transients as fast as 250 µs
- ll inputs have been updated to the 3rd edition of ANSI/ISA S82.01 and EN61010-1 CAT IV 600V and CAT III, 1000 V. They can withstand impulses greater than 8000 V and reduce risks related to overloads and spikes
Tests with the Multimeter¶
To carry out the power consumption tests, we use a multimeter, a mini pump model JT-180B, a constructed output board, the XIOA RP2040 and a 6V battery with a capacity of 4A.
The first step is to place the components on the motherboard: the controller or board with the relay, the TDS sensor and the battery.
It is also important to position the multimeter correctly, with the black lead in the COM position and the red lead in the mA position.
When carrying out the measurements, it can be seen that the energy consumption of this minipump is 53.95 mA. This information is crucial to understand the energy requirement of the pump and ensure adequate power in the circuit design.
We use the digital multimeter to measure when the servomotor rotates to a certain degree and how the energy changes
In my multimeter we verify that the voltage is changing
Here another value
During our experience this week with the multimeter, we understood its vital importance in the electronic field. This device allows us to measure and confirm key values of electronic components, such as resistance, perform diode tests, evaluate the continuity of circuits and, fundamentally, determine the energy consumption of our loads, as in the case of the minipump. This information is crucial to selecting a suitable battery and correctly sizing the electronic components needed for our project
Individual assignment:¶
We begin to carry out the tests with the protobar, there we connect the servomotor and the potentiometer that every time we move the potentiometer, the servomotor moves the angle we want.
We check the pins of the XIAO RP2040
We check the potentiometer pins
We check the servomotor pins where to connect
We connect the potentiometer, servomotor and the XIAO RP2040
Potentiometer:
- VCC Pin: Connect to 3.3V of the XIAO RP2040.
- GND Pin: Connect to GND of the XIAO RP2040.
- Signal pin (center): Connect to pin A0 of the XIAO RP2040.
Servomotor:
- Red Wire (VCC): Connect to 5V of the XIAO RP2040 (or to an external 5V source if the XIAO cannot provide enough current).
- Black Cable (GND): Connect to GND of the XIAO RP2040.
- Signal cable: Connect to pin D3 of the XIAO RP2040 (can be another compatible PWM pin)
We write the code in arduino
Servomotor working principle:¶
The basic operating principle of a servomotor is based on position control through a control signal and a feedback system. The main components and operating process are described here:
Main components:
- Direct Current Motor (DC) or Alternating Current Motor (AC): Provides movement.
- Gearbox: Reduces speed and increases engine torque.
- Potentiometer or Encoder: Provides feedback of the current position of the axis.
- Control Circuit: Processes the input signal and feedback to adjust the position of the motor.
Operation Process
- Control Signal:
A control signal is sent to the servomotor. This signal is generally a PWM (Pulse Width Modulation) signal in hobby servo motors. The pulse duration (in milliseconds) determines the position of the motor shaft.
- Signal Processing:
The control circuit inside the servo motor receives the PWM signal and compares it with the feedback signal provided by the potentiometer or encoder. The difference between the control signal and the feedback signal is called error.
- Position Adjustment:
The control circuit uses the error to adjust the position of the motor. If the error is positive, the motor moves in one direction until the feedback signal matches the control signal. If the error is negative, the motor moves in the opposite direction. Continuous Feedback:
- The potentiometer or encoder continuously monitors the current position of the shaft and sends this information to the control circuit. This allows constant adjustments to maintain the desired position with high precision.
Servomotor code explanation:¶
- int potValue = analogRead(potPin);: Reads the analog value of the potentiometer, which can vary between 0 and 1023.
- int servoAngle = map(potValue, 0, 1023, 0, 180);: Maps the value read from the potentiometer (0-1023) to the servomotor angle range (0-180 degrees). The map function converts the value of the potentiometer to a value suitable for controlling the servomotor.
- myServo.write(servoAngle);: Moves the servomotor to the angle corresponding to the mapped value of the potentiometer.
- delay(15);: Wait 15 milliseconds before the next reading to smooth out the servomotor movement
buzzer output device:¶
A buzzer, also known as a piezoelectric buzzer or buzzer, is an electroacoustic device that converts electrical signals into sound. It is used in a variety of applications to provide audible alerts or audible signals.
Connections
Potentiometer:
- VCC Pin: Connect to 3.3V of the XIAO RP2040.
- GND Pin: Connect to GND of the XIAO RP2040.
- Signal pin (center): Connect to pin A0 of the XIAO RP2040.
Buzzer:
- Positive pin: Connect to pin D3 of the XIAO RP2040 (can be another compatible PWM pin).
- Negative pin: Connect to GND of the XIAO RP2040.
We make the connection with the buzzer
We make the code in Arduino so that as we move the potentiometer the beep goes up and if we lower the beep it goes down.
We hear in the video the beep is louder when we raise the volume of the potentiometer