|
Sxemani loyihalash va amalga oshirish
|
bet | 15/18 | Sana | 15.06.2024 | Hajmi | 4,3 Mb. | | #263888 |
Bog'liq Avtomatlashtirilgan piyodalarni o (2)Sxemani loyihalash va amalga oshirish
Svetofor tizimida svetoforni boshqarish va kuzatish uchun amalga oshiriladigan turli LED qurilmalari mavjud. Biz aqlli trafik tizimining har bir kesishmasi uchun uchta LED moslamasini talab qilamiz, masalan, Qizil, Sariq va Yashil. Tavsiya etilgan chorraha asosiy to'rt qatorga bo'lingan, masalan, Signal1, Signal2, Signal3 va Signal4. Ushbu LEDlarning barchasi Arduino UNO platasiga ulangan va quvvat manbai Arduino kontrolleri yordamida ta'minlanishi mumkin. Quyidagi rasmda aqlli svetoforning sxemasi ko'rsatilgan:
Yakuniy dizayn yechimi
Ushbu loyiha aqlli svetofor bo'lib, unda svetoforni boshqarish va nazorat qilish sezilarli darajada amalga oshirilishi va yo'l harakati bilan bog'liq muammolarni samarali hal qilish mumkin. Unda UNO mikrokontrolleri, LEDlar, rezistorlar va quvvat manbai mavjud. Aqlli svetoforning ishlashini tushunish uchun quyidagi chiziqli kesishuvni ko'rib chiqish mumkin:
Birinchi signalning yashil chirog'i va boshqa svetoforlardagi qizil chiroqlar 1-signalda transport vositalari yoki avtomobillarga vaqt berish uchun yonishi ko'rsatilgan. Biroz kechikishdan so'ng, 1-signaldagi sariq chiroq yonadi. 1-signaldagi qizil signal qo'shiladi va 2-signalda avtomobillar yoki avtomobillarga yashil chiroq yonishini belgilang.
Quyidagi rasmlar Arduino UNO-dan foydalangan holda aqlli svetofor tizimining yakuniy dizaynini ko'rsatadi:
Shunday qilib, bir necha kechikishlardan so'ng 1-signaldagi qizil chiroq yonadi va yashil chiroq yonadi, bu birinchi signaldagi transport vositalari harakat qilmasligi kerakligini va 2-signaldagi transport vositalarining harakatlanishini ko'rsatadi. harakatlanishga qodir. Xuddi shunday, svetofor tizimi 3-signal va 4-signal uchun ishlaydi va yo'llardagi harakatni kuzatish imkonini beradi. Quyida Arduino kodlash aqlli svetoforlarning operatsiyalarini bajarish uchun ishlatiladi:
int Signal1[] = {13,12,11};
int Signal2[] = {10,9,8};
intSignal3[] = {7,6,5};
intSignal4[] = {4,3,2};
void setup()
{
for (int i = 0; i < 3; i++)
{
pinMode(Signal1[i], OUTPUT);
pinMode(Signal2[i], OUTPUT);
pinMode(Signal3[i], OUTPUT);
pinMode(Signal4[i], OUTPUT);
}
uchun (int i = 0; i < 3; i++)
{
digitalWrite(Signal1[i], LOW);
digitalWrite(Signal2[i], LOW);
digitalWrite(Signal3[i], LOW);
digitalWrite(Signal4[i], LOW);
}
}
void loop()
{
digitalWrite(Signal1[2], HIGH);
digitalWrite(Signal3[0], HIGH);
digitalWrite(Signal4[0], HIGH);
digitalWrite(Signal2[0], HIGH);
kechikish (7000);
digitalWrite(Signal1[2], LOW);
digitalWrite(Signal3[0], LOW);
digitalWrite(Signal1[1], YUQORI);
digitalWrite(Signal3[1], HIGH);
kechikish (3000);
digitalWrite(Signal1[1], LOW);
digitalWrite(Signal3[1], LOW);
digitalWrite(Signal1[0], YUQORI);
digitalWrite(Signal3[2], HIGH);
kechikish (7000);
digitalWrite(Signal3[2], LOW);
digitalWrite(Signal4[0], LOW);
digitalWrite(Signal3[1], HIGH);
digitalWrite(Signal4[1], HIGH);
kechikish (3000);
digitalWrite(Signal3[1], LOW);
digitalWrite(Signal4[1], LOW);
digitalWrite(Signal3[0], HIGH);
digitalWrite(Signal4[2], HIGH);
kechikish (7000);
digitalWrite(Signal4[2], LOW);
digitalWrite(Signal2[0], LOW);
digitalWrite(Signal4[1], HIGH);
digitalWrite(Signal2[1], HIGH);
kechikish (3000);
digitalWrite(Signal4[1], LOW);
digitalWrite(Signal2[1], LOW);
digitalWrite(Signal4[0], HIGH);
digitalWrite(Signal2[2], HIGH);
kechikish (7000);
digitalWrite(Signal1[0], LOW);
digitalWrite(Signal2[2], LOW);
digitalWrite(Signal1[1], YUQORI);
digitalWrite(Signal2[1], HIGH);
kechikish (3000);
digitalWrite(Signal2[1], LOW);
digitalWrite(Signal1[1], LOW);
|
| |