TM1637 4-Digit Display + IR Proximity Sensor
TM1637 4-Digit Display + IR Proximity Sensor
The TM1637 4-Digit Display + IR Proximity Sensor is a compact, multifunctional module that combines a 4-digit seven-segment LED display with an infrared (IR) proximity sensor. This component is designed to provide a convenient and space-saving solution for a wide range of applications, including IoT projects, robotics, home automation, and more.
+ Display type | 4-digit seven-segment LED display |
+ Driver IC | TM1637 |
+ Operating voltage | 5V |
+ Current consumption | 10-20mA |
4-digit seven-segment LED display
TM1637 driver IC
High brightness and contrast ratio
Low power consumption
Supports numeric and alphanumeric characters
Can display temperature, humidity, and other environmental data
+ Detection range | up to 30 cm (12 inches) |
+ Operating frequency | 38 kHz |
+ Operating voltage | 5V |
+ Current consumption | 5-10mA |
Highly sensitive IR sensor with a detection range of up to 30 cm (12 inches)
Built-in LED indicator for visual feedback
Operates at a frequency of 38 kHz
Low power consumption
Can be used for object detection, obstacle avoidance, and proximity sensing applications
Compact design with a small form factor
Low power consumption, making it suitable for battery-powered applications
Easy to use and integrate into projects
Supports a wide range of microcontrollers, including Arduino, Raspberry Pi, and ESP32
Can be used for a variety of applications, including IoT projects, robotics, home automation, and more
45 x 25 x 15 mm (1.77 x 0.98 x 0.59 inches)
The component has a 5-pin interface, consisting of |
5V power supply
Ground
Clock input for the display module
Data input/output for the display module
Output signal from the IR proximity sensor
The TM1637 4-Digit Display + IR Proximity Sensor is a versatile component that can be used in a wide range of applications, including |
IoT projects, such as smart home automation and environmental monitoring systems
Robotics and robotic arms
Industrial automation and control systems
Medical and healthcare devices
Gaming and interactive systems
Home appliances and consumer electronics
The TM1637 4-Digit Display + IR Proximity Sensor is a powerful and versatile component that offers a unique combination of features and functionalities. Its compact design, low power consumption, and ease of use make it an ideal choice for a wide range of applications, from IoT projects to industrial automation and robotics.
TM1637 4-Digit Display + IR Proximity Sensor Documentation
Overview
The TM1637 4-Digit Display + IR Proximity Sensor is a combined module that integrates a 4-digit 7-segment display and an infrared proximity sensor. This module is suitable for various IoT applications, such as home automation, robotics, and interactive projects.
Technical Specifications
Display:
+ 4-digit 7-segment display
+ TM1637 driver IC
+ Common anode configuration
IR Proximity Sensor:
+ Infrared sensor module
+ Detection range: 10-50 cm
+ Adjustable sensitivity
Power supply: 5V
Communication protocol: Serial (clock and data pins)
Pinout
| Pin | Function |
| --- | --- |
| VCC | Power supply (5V) |
| GND | Ground |
| CLK | Clock pin for serial communication |
| DIO | Data pin for serial communication |
| VOUT | IR proximity sensor output (digital) |
Code Examples
### Example 1: Displaying Numbers on the 4-Digit Display
This example demonstrates how to display numbers on the 4-digit display using an Arduino board.
```cpp
#include <TM1637.h>
// Define the clock and data pin connections
TM1637 tm1637(2, 3); // CLK on pin 2, DIO on pin 3
void setup() {
tm1637.init();
tm1637.setBrightness(7); // Set display brightness to maximum
}
void loop() {
tm1637.display(1234); // Display the number 1234
delay(1000);
tm1637.display(5678); // Display the number 5678
delay(1000);
}
```
### Example 2: Using the IR Proximity Sensor to Detect Obstacles
This example demonstrates how to use the IR proximity sensor to detect obstacles using an ESP32 board.
```cpp
const int irProximityPin = 32; // IR proximity sensor output pin
void setup() {
pinMode(irProximityPin, INPUT);
Serial.begin(9600);
}
void loop() {
int sensorValue = digitalRead(irProximityPin);
if (sensorValue == LOW) {
Serial.println("Obstacle detected!");
} else {
Serial.println("No obstacle detected.");
}
delay(50);
}
```
### Example 3: Combining the Display and Proximity Sensor
This example demonstrates how to combine the 4-digit display and IR proximity sensor to create a simple obstacle detection system with a distance indicator.
```cpp
#include <TM1637.h>
const int irProximityPin = 32; // IR proximity sensor output pin
TM1637 tm1637(2, 3); // CLK on pin 2, DIO on pin 3
void setup() {
pinMode(irProximityPin, INPUT);
tm1637.init();
tm1637.setBrightness(7); // Set display brightness to maximum
}
void loop() {
int sensorValue = digitalRead(irProximityPin);
if (sensorValue == LOW) {
int distance = calculateDistance(); // Calculate distance using the sensor value
tm1637.display(distance); // Display the distance on the 4-digit display
} else {
tm1637.display(0); // Reset the display when no obstacle is detected
}
delay(50);
}
int calculateDistance() {
// Implement your distance calculation algorithm here
// For example:
return map(sensorValue, 0, 1023, 0, 50); // Convert sensor value to distance (0-50 cm)
}
```
Note: These examples are simplified and may require additional error handling and calibration depending on your specific use case.