The MKE-S10 CNY70 is a compact line follower sensor designed for robotics and automation applications. It utilizes an infrared LED and a phototransistor to detect the contrast between a line (typically black) and the surrounding surface (typically white). This sensor is widely used in educational robots, maze solvers, and industrial line following vehicles.
Pin Number | Name | Description |
---|---|---|
1 | VCC | Power supply (4.5V to 5.5V) |
2 | GND | Ground |
3 | VO | Analog voltage output relative to surface reflectivity |
// Define the pin connected to the sensor's output
const int sensorPin = A0;
void setup() {
// Initialize serial communication at 9600 baud rate
Serial.begin(9600);
}
void loop() {
// Read the analog value from the sensor
int sensorValue = analogRead(sensorPin);
// Convert the analog value to a voltage (0-5V)
float voltage = sensorValue * (5.0 / 1023.0);
// Print the voltage to the Serial Monitor
Serial.println(voltage);
// Delay for a short period to avoid spamming the Serial Monitor
delay(100);
}
Q: Can the MKE-S10 CNY70 sensor detect colors other than black and white? A: The sensor is designed to detect reflectivity differences. While optimized for black and white, it can detect other colors if there is sufficient contrast.
Q: What is the maximum operating distance of the sensor? A: The sensor operates best within a range of 0.5mm to 15mm from the surface.
Q: How can I adjust the sensitivity of the sensor? A: Sensitivity can be adjusted by calibrating the threshold value in your code based on the analog voltage readings from the sensor.
Q: Is it possible to use multiple MKE-S10 CNY70 sensors on a single robot? A: Yes, you can use multiple sensors to improve line detection and navigation accuracy. Ensure each sensor is connected to a separate analog input pin on your microcontroller.