Circuit Documentation
Summary
This circuit is designed to interface an Arduino Nano with a rain/snow sensor, a DC motor, and a motor driver. The Arduino Nano reads data from the rain/snow sensor and controls the DC motor through the L298N motor driver. The circuit is powered by a 9V battery.
Component List
Arduino Nano
- Description: A small, complete, and breadboard-friendly board based on the ATmega328P.
- Pins: D1/TX, D0/RX, RESET, GND, D2, D3, D4, D5, D6, D7, D8, D9, D10, D11/MOSI, D12/MISO, VIN, 5V, A7, A6, A5, A4, A3, A2, A1, A0, AREF, 3V3, D13/SCK
YL-83 Rain Sensor - Detection Board
- Description: A sensor board used to detect rain.
- Pins: POS, NEG
Rain/Snow Sensor - Board
- Description: A sensor board used to detect rain or snow.
- Pins: 1, 2, A0 (Analog), D0 (Digital), GND, VCC (5V)
DC Motor
- Description: A simple DC motor.
- Pins: pin 1, pin 2
L298N DC Motor Driver
- Description: A dual H-Bridge motor driver module.
- Pins: OUT1, OUT2, 12V, GND, 5V, OUT3, OUT4, 5V-ENA-JMP-I, 5V-ENA-JMP-O, +5V-J1, +5V-J2, ENA, IN1, IN2, IN3, IN4, ENB
9V Battery
- Description: A standard 9V battery.
- Pins: -, +
Wiring Details
Arduino Nano
- GND connected to GND of Rain/Snow Sensor - Board and GND of 9V Battery and GND of L298N DC Motor Driver.
- D3 connected to IN1 of L298N DC Motor Driver.
- D4 connected to IN2 of L298N DC Motor Driver.
- VIN connected to VCC (5V) of Rain/Snow Sensor - Board.
- 5V connected to 5V of L298N DC Motor Driver.
- A3 connected to A0 (Analog) of Rain/Snow Sensor - Board.
YL-83 Rain Sensor - Detection Board
- POS connected to 2 of Rain/Snow Sensor - Board.
- NEG connected to 1 of Rain/Snow Sensor - Board.
Rain/Snow Sensor - Board
- GND connected to GND of Arduino Nano.
- VCC (5V) connected to VIN of Arduino Nano.
- A0 (Analog) connected to A3 of Arduino Nano.
- 2 connected to POS of YL-83 Rain Sensor - Detection Board.
- 1 connected to NEG of YL-83 Rain Sensor - Detection Board.
DC Motor
- pin 1 connected to OUT2 of L298N DC Motor Driver.
- pin 2 connected to OUT1 of L298N DC Motor Driver.
L298N DC Motor Driver
- IN1 connected to D3 of Arduino Nano.
- IN2 connected to D4 of Arduino Nano.
- GND connected to GND of Arduino Nano and GND of 9V Battery.
- 5V connected to 5V of Arduino Nano.
- OUT2 connected to pin 1 of DC Motor.
- OUT1 connected to pin 2 of DC Motor.
- 12V connected to + of 9V Battery.
9V Battery
- - connected to GND of Arduino Nano and GND of L298N DC Motor Driver.
- + connected to 12V of L298N DC Motor Driver.
Code Documentation
Arduino Nano Code
void setup() {
// put your setup code here, to run once:
}
void loop() {
// put your main code here, to run repeatedly:
}
This code is a basic template for the Arduino Nano. The setup() function is where you initialize your components and settings, and the loop() function is where you place the main logic that runs repeatedly.
Additional Documentation
This section is reserved for any additional documentation or notes related to the code or circuit.
