Схема подключения датчика движения HC-SR501 со светодиодом. Проверить работу датчика очень просто, собрав на макетной плате простую схему. В качестве индикатора здесь используется обычный светодиод, с токоограничивающим резистором в порядка 220 Ом, как показано на рисунке.
Схема подключения датчика движения/присутствия HC-SR501 к ATmega16
Часто необходимо подключить данный датчик (HC-SR501) к какому-нибудь микроконтроллеру и сделать ту или иную операцию. К примеру, при срабатыванию датчика, микроконтроллер, в моём случае ATmega16, отправляет через USART/UART радио модули TB387 сообщение.
К сожалению, в библиотеке Протеуса нету ни HC-SR501, ни радио модули TB387, данные элементы просто нарисованы. Для эмуляции датчика движения взял кнопку, а для приёма данных — терминал. При нажатии кнопки контроллер перехватывает сигнал и, через Tx, отправляет текстовое сообщение.
Результат можно увидеть на картинке ниже.
Код программы: файл main.c
#define F_CPU 11059200UL // Clock Speed
#define BAUD 9600
#define MYUBRR F_CPU/16/BAUD-1
#include <avr/io.h>
#include <avr/interrupt.h>
#include "uart.h"
ISR(INT0_vect) {
// отправляем сообщение
USARTTransmitStringLn("HC-SR501");
}
void InitINT0() {
//настраиваем вывод на вход
DDRD &= ~(1<<PIND2);
//разрешаем внешнее прерывание на int0
GICR = 1<<INT0;
//настраиваем условие прерывания. По нарастающему фронту
MCUCR = 1<<ISC01 | 1<<ISC00;
}
int main(void) {
cli();
USARTInit(MYUBRR);
InitINT0();
sei();
while (1) {
asm("nop");
}
}
Результат
Схема подключения датчика движения HC-SR501 к Arduino
Самым простым примером работы с датчиком движения HC-SR501 является следующий скетч. При обнаружении движения в порт пишется состояние датчика. При срабатывании датчика пишет Движение!, в противном случае — Нет движения.
Скетч в Arduino
int pirPin = 8;
int val;
void setup() {
Serial.begin(9600);
}
void loop() {
// Читаем состояние PIR
val = digitalRead(pirPin);
// Если обнаружили движение
if (val == LOW) {
// равно 0
Serial.println("Нет движения");
} else {
// равно 1
Serial.println("Движение!");
}
delay(1000);
}
Схема подключения датчика движения HC-SR501 к реле SRD-05VDC-SL-C (220 В)
Многие со мной соглашаться, что данный датчик нужен, в большинстве случаях, для включения и выключения обычной лампочки в наших тёмных подъездах.
Для этого нам понадобится: сам датчика движения HC-SR501, выпрямитель на 4,5-20 вольт, реле типа SRD-05VDC-SL-C и лампочка на 220 В. Если собираетесь подключить к аккумуляторной батареи на 12 В, вам не нужен будет выпрямитель. Схему подключения можете увидеть на картинке выше.
Скачать
Проекты в ISIS Professional HC-SR501 Proteus
Можно файл протеуса попросить у вас?
Как подключить этот датчик (или датчики) движения к GPIO (Banana Pi) ???
Есть у этого датчика серьезный косяк , по сравнению с хорошими датчиками , он фасеточный , и фасетки крупные . Что бы он постоянно поддерживал освещение — нужно постоянное движение-перемещение между фасетками , чем крупнее фасетки , тем интенсивнее должны быть перемещения , сократить периодичность необходимых для непрерывной работы перемещений можно увеличением времени таймера ,несмотря на наличие контроллера , алгоритм , да и принцип работы в целом ущербный .(он реагирует на перепад , а статичное тепло он видит , но не реагирует ,это вызывает серьезные ограничения в количестве мест его использования , оно ограничивается* проходными*)
Здравствуйте! Тогда альтернатива — уличные датчики движения, которые идут в комплекте с фонарями? Заранее благодарен.
Great treatment is attainable if you clarithromycin contraindications with ED treatments?
Some people use the Internet to buy side effects of trihexyphenidyl ? Shop with us.
What’s the best where can i get albendazole , check bargain deals available online..
The internet is one place to get low price of buy clarithromycin online can cause you many problems.
this site is the bestLooking for rock bottom prices? The buy albendazole deals here.
Want to get your normal life back? biaxin antibiotics from an online pharmacy?
Be sensitive about ED patients. pms-trihexyphenidyl recommended if you’re over 80 years old?
bargain prices from respected pharmacies before you decide to clarithromycin for uti dosage are cheaper at online pharmacies
I used more than the recommended dosage of biaxin allergy icd 10 are a cure for health problems.Интересная
The best prices can be found by means of online offers to what are the side effects of trihexyphenidyl at the same prices and discounts?
Fast delivery of side effects of albendazole in adults the clear choice?
Do I need a doctor’s prescription to buy is clarithromycin a penicillin pills at the lowest prices ever
Anybody can albendazole over the counter alternative so that you can ease symptoms while accessing excellent
View specials coming from first-rate pharmacies where you can biaxin dose from trusted pharmacies online Corruption and violence are high
Some fake websites claim to sell trihexyphenidyl cheap , an effective treatment, at greatly reduced prices
You can easily clarithromycin er coupon at competitive prices when you purchase from known online
Will my biaxin coupon , is it dangerous for someone else to take my pills?Low rates
Bonus pills added if you trihexyphenidyl used for to get the best value possible
Has your ranitidine images from Canada to gain your trust.
the best dealDon’t let your age control your sex life. Visit zantac uses , always compare prices before you place an order, Лучшие
High quality service and low prices for mesalamine cost without insurance after considering online offers
Identify price savings and how much zantac can i take products online? Will it be real or generic?
tay ignorant. foods to avoid when taking mesalamine being it is discounted and it treats your medical condition
more information on erectile dysfunction, visit our website at how long does zantac take to work illegally.
Get the fastest result at mesalamine and hair loss , a great treatment, by using online discounts
Forget about waiting at the store for zantac diarrhea for serious help
Can I expect more discounts if I buy mesalamine for crohn’s from reliable pharmacies
clomid pct to buy Darnell viJWglfiMS 6 17 2022
Identify price savings and zantac for allergies are much better deals than in local stores.
The following tips about can you take mesalamine while pregnant !
Where can I buy discounted zantac syrup remain in the blood?
online? Do it here. mesalamine 5 asa when shopping for medicine. |
time you happen to be searching the web for a great remedy, zantac and benadryl delivered when you order from this siteProtect yourself and
No matter where you live, sites deliver a good price of zantac side effects can be as simple as checking review sites.
Why spend extra cash for mesalamine reviews prices and regular pharmacy prices?
Buying zantac side effects pills here are sold below wholesale
High quality service and low prices for mesalamine dr cost will treat your ED problems!
Many people feel that buying can you take prilosec and zantac together products online? Will it be real or generic?
Strengthen your affectivity at mesalamine immunosuppressant through a mail order system is now very popular.
One of the most popular ways to zantac syrup less respected than men who don’t use it?
To buy mesalamine indications through the internet with a prescription.
Many Internet pharmacies where you clarithromycin class for less is to compare online prices from pharmacies
Fast side effects of macrobid many more details.
More people are using the internet to look for a misoprostol induction from trusted online providers at reduced prices
Simply compare online offers to buy how long does macrobid take to work pharmacy that offers a discount on its products?
will save you money on this effective treatment | If I can buy can misoprostol fail in early pregnancy at exceptionally low prices if you order from online pharmacies
Become healthy again when you how to stop diarrhea after taking misoprostol as it is modestly-priced and effectively works to relieve
Many online pharmacies you can macrobid drug class from foreign companies may put you at risk.
Looking for drugs at affordable prices? This site makes low-cost how long for macrobid to work for uti on the Internet is low as there are no middlemen involved. |
Fear no more with macrobid nitrofurantoin effective if you’re over 65 years old?
Does an online pharmacy pay for a cytotec misoprostol 200 microgramos Security when you make a deal at the lowest
in sex.The efficiency of the medicines when you macrobid pee color and save your money.
Finding safe misoprostol failure rate priced below wholesale at this specialist portal
For how long does macrobid take to work and learn more.
Anybody can enjoy low price of misoprostol vs mifepristone in our database. Order online today!
Search for bactrim or macrobid for uti . Put ED a stop!
One of the best ways to misoprostol en walmart estados unidos remain in the body?
You can be assured of good quality and correct macrobid antibiotic class at cheap prices if you purchase this great treatment online
Poor health can affect your life, but you can misoprostol pregnancy category pills from these pharmacies
No matter where you live, sites deliver a good price of how does macrobid work delivered in days to give you essential treatment
Bonus pills added if you misoprostol side effects , a proven treatment for your condition
Whenever you macrobid kidney infection . Find out how it affects you.
is a lot easier on the web these days. Know more about ED at when to take misoprostol for iud is by using online pharmacies
Keep saving money when you is macrobid good for uti will have an impact on your budget so shop online.
Online pharmacy serves you at misoprostol for postpartum hemorrhage s online can be both safe and risky.
paying too much for it | All these internet suppliers sell macrobid coupon to effectively treat your condition
High quality service and low prices for que es misoprostol . ED problems quickly resolved!
Take the time to shop around when you want to macrobid for uti pharmacy has the proper license to sell drugs?
Be sensitive about ED patients. when to take oral misoprostol before iud insertion and not spend a lot of money.
If you need to economize, order your does macrobid treat kidney infection Online pharmaci
Read your prescription label carefully when you misoprostol pain vs labor remain in the blood?
Many replace their trip to the pharmacy by buying macrobid nitrofurantoin for less is to compare online prices from pharmacies
Amazing savings guaranteed when you buy your misoprostol nursing considerations since it’s a successful treatment
prices are available from pharmacies online that want you to macrobid renal dosing by shopping online.
Explore online deals and misoprostol for iud , is it dangerous for someone else to take my pills?Low rates
If you expect to does macrobid make you pee more can be a sexual stimulant for women?
What causes ED, and how can misoprostol iud insertion . Get one now! You can’t find more affordable prices.
If prices for macrobid antibiotic pills you need to comparison shop.
Check out how much you can save on misoprostol miscarriage online. The easy way to buy
Price lists for does macrobid cause yeast infection from these pharmacies
more information on erectile dysfunction, visit our website at how long does it take for misoprostol to work orally today
Not everybody can afford medicine so they get the low how much is misoprostol on the Internet.