Bayanin abun ciki:
1 Ka'idar watsa siginar infrared
2 Daidaitawa tsakanin mai watsa siginar infrared da mai karɓa
3 Misalin aiwatar da aikin watsawa infrared
1 Ka'idar watsa siginar infrared
Na farko ita ce na'urar da kanta da ke fitar da siginar infrared, wanda gabaɗaya yayi kama da haka:
Diamita na infrared diode a cikin hoton shine 3mm, ɗayan kuma 5mm.
Kusan sun kasance daidai da LEDs masu fitar da haske, don haka fitilun da suka fi tsayi suna haɗe zuwa sandar inganci, ɗayan kuma an haɗa shi da sandar mara kyau.
Da'irar tuƙi mafi sauƙi ita ce ƙara 1k mai iyakance iyaka na yanzu zuwa tabbataccen titin 3.3v, sannan haɗa madaidaicin lantarki zuwa IO na mai sarrafa micro.Kamar yadda aka nuna a kasa:
2 Daidaitawa tsakanin mai watsa siginar infrared da mai karɓa
Bayan na faɗi haka, ina buƙatar gyara kuskure a cikin labarin na gaba tare da ku.
A cikin hoton da ke sama, an ambaci cewa matakan sigina na mai aikawa da mai karɓa sun saba.Wato, daidai da abubuwan da ke kewaye a cikin akwatunan ja da shuɗi a cikin wannan adadi na sama.
A zahiri, a cikin ainihin yanayin motsi, ɓangaren shuɗi na mai watsawa ba ƙaramin matakin 0.56ms bane mai sauƙi.Madadin haka, kalaman pwm 0.56ms ne na 38kHz.
Ainihin ma'aunin igiyar igiyar ruwa shine kamar haka:
Cikakkun bayanai na waveform na ɓangaren launi na igiyoyin watsawa a cikin adadi sune kamar haka:
Ana iya ganin cewa mitar wannan raƙuman murabba'i mai yawa shine 38kHz.
Ga taƙaice: wasiƙun da ke tsakanin mai watsawa da mai karɓar ramut infrared:
Lokacin da mai watsawa ya fitar da raƙuman murabba'in 38kHz, mai karɓa yana da ƙasa, in ba haka ba mai karɓar yana da girma.
3 Misalin aiwatar da aikin watsawa infrared
Yanzu bari mu matsa zuwa aikace-aikacen shirye-shirye.
Bisa ga gabatarwar da ta gabata, mun san cewa don gane aikin na'ura mai nisa ta infrared, dole ne mu fara gane ayyuka guda biyu:
1 38kHz murabba'in fitarwa
2 Sarrafa igiyar murabba'in 38kHz don kunna da kashewa a lokacin da ake so
Na farko shine fitowar raƙuman murabba'in 38kHz.Muna amfani da igiyar pwm kawai don samar da shi.Anan, muna buƙatar amfani da aikin pwm na mai ƙidayar lokaci.Ina amfani da guntu mai ƙarancin ƙarfi na STM32L011F4P6 anan.
Da farko yi amfani da kayan aikin ƙirƙira lambar don samar da lambar:
Lambar farawa:
Sannan akwai aikin kunna ko kashe pwm wave bisa ga ka'idojin codeing, wanda ake aiwatar da shi ta hanyar amfani da lokacin katsewa, sannan a canza tsawon lokacin da ake kunna ko kashe pwm ta hanyar canza lokacin isowar na gaba. katse:
Har yanzu akwai wasu bayanai na rufaffiyar bayanan da ba za a buga a nan ba.Idan kuna buƙatar ƙarin lambar tushe, kuna maraba da barin saƙo, kuma zan samar muku da cikakken lambar da wuri-wuri.
Lokacin aikawa: Fabrairu-24-2022