Arduino Mega 2560 Proximity Sensor System with IR High Range Detection
View and Edit Project In Cirkit Designer
Circuit Documentation
Summary
This circuit consists of an Arduino Mega 2560 microcontroller and an IR High Range NPN Optical Proximity Switch (E18-D80NK). The proximity switch is connected to the Arduino to detect objects within a range of 3 to 80 cm. The Arduino processes the signal from the proximity switch and can be programmed to perform various tasks based on the proximity sensor's output.
Component List
Arduino Mega 2560
- Description: A microcontroller board based on the ATmega2560.
- Pins: IOREF, RESET, 3V3, 5V, GND, VIN, A0-A15, D21/SCL, D20/SDA, D19/RX1, D18/TX1, D17 PWM/RX2, D16 PWM/TX2, D15/RX3, D14/TX3, D0 RX0, D1 TX0, D2 PWM, D3 PWM, D4 PWM, D5 PWM, D6 PWM, D7 PWM, D8 PWM, D9 PWM, D10 PWM, D11 PWM, D12 PWM, D13 PWM, AREF, SDA, SCL, D52, D50, D48, D46, D44, D42, D40, D38, D36, D34, D32, D30, D28, D26, D24, D22, D53, D51, D49, D47, D45, D43, D41, D39, D37, D35, D33, D31, D29, D27, D25, D23
IR High Range NPN Optical Proximity Switch (E18-D80NK)
- Description: An infrared proximity sensor with a range of 3 to 80 cm.
- Pins: GRN, 5V, OUT
Wiring Details
Arduino Mega 2560
- 5V: Connected to the 5V pin of the IR High Range NPN Optical Proximity Switch.
- GND: Connected to the GRN pin of the IR High Range NPN Optical Proximity Switch.
- D5 PWM: Connected to the OUT pin of the IR High Range NPN Optical Proximity Switch.
IR High Range NPN Optical Proximity Switch (E18-D80NK)
- 5V: Connected to the 5V pin of the Arduino Mega 2560.
- GRN: Connected to the GND pin of the Arduino Mega 2560.
- OUT: Connected to the D5 PWM pin of the Arduino Mega 2560.
Code Documentation
Arduino Mega 2560 Code
sketch.ino
void setup() {
// put your setup code here, to run once:
}
void loop() {
// put your main code here, to run repeatedly:
}
documentation.txt
This document provides a comprehensive overview of the circuit, including a summary, detailed component descriptions, wiring details, and the code used in the Arduino Mega 2560.