Exploring output devices this week showed me how important feedback is in user experience. Whether it's lights, sounds, or displays, output devices bring the system to life by communicating information clearly and effectively.
Output device example
We used a DC power supply to measure the DC motor’s power consumption. The supply operates in two modes: constant voltage (CV) and constant current (CC). The operating mode depends on the voltage and current settings as well as the characteristics of the connected load.
WANPTEK GPS605D DC POWER SUPPLY
Input voltage:AC 220V 50Hz
Output voltage:0 ~ 60V
Output current:0 ~5A
Voltage resolution:10mV
Current resolution:1mA
Indicator Meter:
Voltage display precision: +-(0.5% of rdg + 2 digits).
Current display precision: +-(0.5% of rdg + 2 digits)
DDC Power Supply Test for DC Motor Experiment, the connection is as follows:
Test video
Observation:
We set the maximum voltage to 2V and used the constant current (CC) mode to observe the changes in voltage and the motor’s movement. The larger the current, the higher the voltage; conversely, the smaller the current, the lower the voltage. According to the formula P = I × V, the power consumption of the DC motor decreases accordingly. When the current is less than 0.05A, the motor stops running.
An LED display is a module designed to display letters, numbers, and symbols. It is widely used in industrial applications such as digital clocks and temperature displays.I am using an I2C 1602A LCD.
Note: If the LCD backlight is too dim, adjust the blue potentiometer on the back of the LCD module.
The I2c 1602 LCD is a common 16×2 character liquid crystal display often used in embedded systems such as Arduino or microcontroller projects. It can display 2 rows with up to 16 characters per row. The common interface methods include parallel interface (4-bit or 8-bit mode) and I2C interface (via the PCF8574 expansion module).
Components Required: Arduino board, LED display module, and jumper wires.
Start → Initialize → Display "Hello World!" on the LED screen → End
LCD Pin | Arduino Uno Pin |
---|---|
VCC | 5V |
GND | GND |
SDA | A4 |
SCL | A5 |
The first time testing the code, the display did not show any content, so I used the following code to check the I2C Address.
#include <Wire.h>
void setup() {
Serial.begin(9600);
while (!Serial);
Serial.println("I2C Scanner is running...");
Wire.begin();
}
void loop() {
Serial.println("Scanning...");
byte count = 0;
for (byte address = 1; address < 127; address++) {
Wire.beginTransmission(address);
if (Wire.endTransmission() == 0) {
Serial.print("I2C device found at address 0x");
Serial.println(address, HEX);
count++;
}
delay(5);
}
if (count == 0) Serial.println("No I2C devices found!");
Serial.println("Scan complete.\n");
delay(5000);}
lcd.backlight();
is called to turn on the display.The correct I2C address is found(0x27), use the following test code:
#include <Wire.h>
#include <LiquidCrystal_I2C.h>
LiquidCrystal_I2C lcd(0x27, 16, 2);
void setup() {
lcd.init();
lcd.backlight();
lcd.clear();
lcd.setCursor(0, 0);
lcd.print("Hello, World!");
}
void loop() {}
Unfortunately,there was still no display content. I continued troubleshooting and found that the contrast needed to be adjusted. Finally, the test was completed.
This device uses the DS18B20 sensor as the temperature input and an I2C 1602 LCD as the output display.
DS18B20 is a common digital temperature sensor that uses a unique single-wire interface. Compared to analog temperature sensors, it is more functional, simple in hardware, easy to expand, and highly resistant to interference.
Feature | Specification |
---|---|
Power Supply | DC 5V |
Temperature Range | -55 to +125℃ |
Communication Interface | 1-Wire |
Accuracy | ±0.5℃ |
Resolution | 9-12 bits adjustable |
The pin configuration is as follows:
Pin | Description |
---|---|
VCC | Power Supply (5V) |
GND | Ground |
I/O | Data Line |
The following Arduino code reads temperature from the DS18B20 sensor and displays it on an I2C 1602 LCD:
#include <Wire.h>
#include <LiquidCrystal_I2C.h>
#include <OneWire.h>
#include <DallasTemperature.h>
// LCD setup
LiquidCrystal_I2C lcd(0x27, 16, 2);
// DS18B20 setup
#define ONE_WIRE_BUS 2
OneWire oneWire(ONE_WIRE_BUS);
DallasTemperature sensors(&oneWire);
void setup() {
lcd.init();
lcd.backlight();
sensors.begin();
lcd.setCursor(0, 0);
lcd.print("Temp Monitor");
}
void loop() {
sensors.requestTemperatures();
float temperatureC = sensors.getTempCByIndex(0);
lcd.setCursor(0, 1);
lcd.print("Temp: ");
lcd.print(temperatureC);
lcd.print(" C ");
delay(1000);
}
video
Use one button module and one DC motor to build a small fan. The button module is used to control the fan’s speed and select different speed levels.
The ULN2003 motor driver is a high-voltage, high-current Darlington transistor array commonly used to drive stepper motors, DC motors, and relays. It contains seven NPN Darlington pairs, each capable of driving up to 500 mA and withstanding 50 V.
code
test