Cov txheej txheem:

Arduino Distance Finder: 3 Kauj Ruam
Arduino Distance Finder: 3 Kauj Ruam

Video: Arduino Distance Finder: 3 Kauj Ruam

Video: Arduino Distance Finder: 3 Kauj Ruam
Video: TOP 8 Arduino distance sensor 2024, Kaum ib hlis
Anonim
Arduino Distance Finder
Arduino Distance Finder

Qhov no yog daim phiaj ua mov ci raws txoj haujlwm uas siv Atmel Atmega 2560 (Arduino Mega) txhawm rau nrhiav qhov nrug deb siv Ultrasonic Sensor. Cov zis tuaj yeem tau txais hauv "cm" ntawm ob qho 16x2 LCD Screen thiab Serial Monitor ntawm Arduino IDE. Peb kuj tseem tuaj yeem siv 16x2 LCD Screen lossis Serial Monitor ntawm tib lub sijhawm, txhais tau tias ib yam yog xaiv tau. Tag nrho cov Circuit Court yog siv los ntawm +5V thiab +3.3V ntawm Arduino Mega. Cov lej txuas kuj tseem tuaj yeem hloov kho rau lwm yam khoom Arduino.

Kauj ruam 1: Yuav tsum tau ua

Cov hauv qab no yuav tsum ua kom tiav txoj haujlwm no:

1- Arduino Mega lossis Arduino UNO

2- Potentiometer (piv txwv li 5K) (yeem)

3- LCD 16x2 (yeem)

4- Ultrasonic sensor

Kauj Ruam 2: Pin-outs & thaiv

Pin-outs & Txuas
Pin-outs & Txuas

Tus Pin-outs & Kev thaiv ntawm Arduino Mega lossis Arduino UNO thiab lwm yam khoom siv txuas ntxiv nrog cov kauj ruam no thiab tseem muab cov hauv qab no:

============

Arduino => LCD

============

+5V => VDD lossis VCC

GND => VSS

8 => TSI

GND => RW

9 => EJ

4 => D4

5 => D5

6 => D6

7 => Txd7

+3.3V => AW

GND => KA

================== Arduino => Potentiometer

==================

+5V => 1st pin

GND => pin 3

================= Potentiometer => LCD

=================

Pin 2 => Vo

=> Koj tuaj yeem teeb qhov sib piv siv Potentiometer

===================== Arduino => Ultrasonic sensor

=====================

10 => VCCV

11 => Cov

12 => Hlo

13 => TZS

Kauj ruam 3: Upload Code

Rub tawm Txoj Cai
Rub tawm Txoj Cai

Tshaj tawm cov cai rau Arduino Mega lossis Arduino UNO. Tom qab xa cov cai rau Arduino, qhib Serial Monitor ntawm Arduino IDE kom tau txais cov txiaj ntsig. Koj tseem tuaj yeem txuas 16x2 LCD Screen kom tau txais cov zis. Cov ntaub ntawv Arduino.ino kuj tau txuas nrog cov kauj ruam no.

Pom zoo: