Cov txheej txheem:

3.3V Mod rau Ultrasonic Sensors (npaj HC-SR04 rau 3.3V Logic ntawm ESP32/ESP8266, Particle Photon, thiab lwm yam): 4 Kauj Ruam
3.3V Mod rau Ultrasonic Sensors (npaj HC-SR04 rau 3.3V Logic ntawm ESP32/ESP8266, Particle Photon, thiab lwm yam): 4 Kauj Ruam

Video: 3.3V Mod rau Ultrasonic Sensors (npaj HC-SR04 rau 3.3V Logic ntawm ESP32/ESP8266, Particle Photon, thiab lwm yam): 4 Kauj Ruam

Video: 3.3V Mod rau Ultrasonic Sensors (npaj HC-SR04 rau 3.3V Logic ntawm ESP32/ESP8266, Particle Photon, thiab lwm yam): 4 Kauj Ruam
Video: Mod Nguồn máy tính thành nguồn DC đa năng - Giai đoạn 1 2024, Hlis ntuj nqeg
Anonim
3.3V Mod rau Ultrasonic Sensors (npaj HC-SR04 rau 3.3V Logic ntawm ESP32/ESP8266, Particle Photon, thiab lwm yam)
3.3V Mod rau Ultrasonic Sensors (npaj HC-SR04 rau 3.3V Logic ntawm ESP32/ESP8266, Particle Photon, thiab lwm yam)
3.3V Mod rau Ultrasonic Sensors (npaj HC-SR04 rau 3.3V Logic ntawm ESP32/ESP8266, Particle Photon, thiab lwm yam)
3.3V Mod rau Ultrasonic Sensors (npaj HC-SR04 rau 3.3V Logic ntawm ESP32/ESP8266, Particle Photon, thiab lwm yam)

TL; DR: Ntawm lub sensor, txiav cov kab rau Echo tus pin, tom qab ntawd rov txuas nws siv qhov faib hluav taws xob (Echo trace -> 2.7kΩ -> Echo pin -> 4.7kΩ -> GND). Edit: Muaj qee qhov kev sib cav txog seb ESP8266 puas yog 5V zam rau GPIO cov tswv yim. Espressif thov ob leeg tias nws yog thiab nws tsis yog. Tus kheej, Kuv tsuas yog yuav muaj kev pheej hmoo yog tias kuv muaj "seem" ESP8266s.

Yog tias koj yog ib yam dab tsi zoo li kuv, koj tau los paub thiab nyiam HC-SR04 raws li qhov tseeb qhov qauv rau tus nqi qis ultrasonic nrug kev nkag siab rau 5V-based Arduino cov haujlwm. Tias yog vim li cas kuv muaj ob peb ntawm lawv dag ib ncig ntawm no.

Tab sis lub ntiaj teb kev nyiam ua hluav taws xob tau hloov pauv tas li ntawm 5V mus rau 3.3V. Raspberry Pie thiab ntau lwm cov laug cam, zoo li cov raws ESP8266, ESP32 lossis cov laug cam zoo li Particle Photon, tab tom ua haujlwm nrog 3.3V lub tswv yim ntawm lawv cov tswv yim/tso tawm pins.

Yog tias peb txuas lub ntsuas hluav taws xob rau 5V lub zog thiab tib lub sijhawm rau 3.3V tus pin, Echo tus pin tso tawm kuj tseem yuav yog 5V thiab feem ntau yuav ua rau puas 3.3V pins ntawm peb lub microcontroller board. Peb tuaj yeem sim txuas txuas ib yam li HC-SR04 rau 3.3V lub zog thiab yuav tuaj yeem ntsuas ntsuas, tab sis hmoov tsis, cov no feem ntau yuav tsis raug.

Kev daws teeb meem yog tseem txuas lub ntsuas hluav taws xob rau 5V VCC, tab sis kom paub tseeb tias Echo teeb liab uas mus txog lub microcontroller tsuas muaj 3.3V los ntawm kev tsim qhov faib hluav taws xob siv ob tus tiv thaiv. Muaj hmoo rau peb, HC-SR04's Trigger pin tsis xav tau 5V thiab tseem lees txais 3.3V uas peb tau txais los ntawm peb tus microcontroller tus pin.

Nrog cov lus piav qhia saum toj no thiab txuas, koj feem ntau yuav muaj cov ntaub ntawv txaus los tsim qhov faib hluav taws xob raws li ib feem ntawm koj lub Circuit Court ntawm lub khob cij thiab txuas tus ntsuas ultrasonic kom raug.

Yog tias koj xav kawm paub yuav hloov kho ib lossis ntau HC-SR04s li cas lawv thiaj li 3.3V-npaj tau raws li tus kheej muaj, tsis muaj ib qho txuas ntxiv, nyeem hauv qab no.

Kauj Ruam 1: Yam Koj Xav Tau

Yam Koj Xav Tau
Yam Koj Xav Tau
  1. HC-SR04 Ultrasonic Sensor
  2. Ib qho 4.7kΩ thiab ib qho 2.7kΩ resistor (lossis ib qho kev sib xyaw ntawm cov resistors hauv 1-50kΩ ntau nrog R1/(R1+R2) = ca. 0.66)
  3. Cov cuab yeej siv cuab yeej
  4. X-Acto riam (lossis ib rab riam uas zoo sib xws thiab taw tes)
  5. Kev txawj ntse siv tau-lossis txaus siab ua kom puas HC-SR04 thaum sim ua tej yam tshiab:)
  6. Tsis teb los tau: iav tsom iav, lub ntsuas hluav taws xob, oscilloscope, particle collider,…

Kauj Ruam 2: Nrhiav kab rau Echo Pin thiab Txiav Nws

Nrhiav txoj kab rau Echo Pin thiab Txiav Nws
Nrhiav txoj kab rau Echo Pin thiab Txiav Nws

Saib ze ntawm lub sensor lub rooj tsavxwm (tejzaum nws siv lub iav tsom iav) thiab nrhiav kab uas coj mus rau Echo tus pin.

Nco tseg: Koj HC-SR04 yuav muaj qhov sib txawv luam tawm Circuit Board (PCB) teeb tsa dua li qhov tau qhia ntawm no! Cov kab ntawv kuj tseem tuaj yeem nyob rau sab nraud (thaum cov kab xaus rau hauv ib puag ncig puag ncig, qhov no feem ntau yog txuas rau sab nraud ntawm PCB).

Tsis teb los tau: Siv koj lub multimeter thiab txheeb xyuas tias koj tau txheeb xyuas qhov tseeb los ntawm kev sim rau txuas ntxiv ntawm Echo tus pin thiab cov laug txuas uas qhov kab txuas txuas mus rau qee yam ntawm PCB. Nws yuav tsum qhia xoom ohms.

Siv rab riam, txiav txoj kab ua tib zoo ua ob peb zaug hauv tib qho chaw. Ua tib zoo saib kom tsis txhob txiav cov neeg nyob ib puag ncig. Tom qab ntawd, khawb cov kab kom txog thaum koj xub pom nws cov hlau, tom qab ntawd pom nws ploj, thiab koj paub tseeb tias tsis muaj kev sib txuas ntxiv lawm.

Nco tseg: Yog tias koj tsis ua tiav qhov kev cais tawm, Echo tus pin tseem yuav xa tag nrho 5 volts rau koj tus microcontroller tus pin.

Tsis teb los tau: Nrog lub multimeter, txheeb xyuas tias koj tau muab tshem tawm ib qho qub qub los ntawm kev sim txuas ntxiv ntawm Echo tus pin thiab cov laug sib koom ua ke qhov twg cov kab txuas mus rau qee yam ntawm PCB. Nws yuav tsum qhia qhov tsis muaj qhov kawg ohms (yog tias nws qhia qee yam hauv mega-ohms ntau, uas yog, ib yam nkaus).

Kauj Ruam 3: Solder 2.7kΩ Nruab Nrab ntawm Echo Pin thiab Nws Txoj Kev Kawg

Solder 2.7kΩ Nruab Nrab ntawm Echo Pin thiab Nws Txoj Kev Kawg
Solder 2.7kΩ Nruab Nrab ntawm Echo Pin thiab Nws Txoj Kev Kawg

Yog tias koj tsis tau pom dua, nrhiav qhov twg ntawm Echo tus pin kab (uas koj tau txiav tawm) ncaj qha coj lwm lub ntsiab lus, zoo li IC.

Hauv kuv qhov piv txwv, nws txuas nrog tus pin 2 ntawm lub nti ntawd nyob nruab nrab ntawm PCB.

Txiav thiab khoov lub 2.7kΩ resistor ob txhais ceg kom haum haum ntawm Echo tus pin thiab lwm qhov txuas.

Tom qab ntawd muab cov tshuaj tiv thaiv tso rau hauv qhov chaw (ntxuav cov khoom kom yaj thiab siv cov dej ntws tej zaum yuav tsis mob, ib yam).

Kauj Ruam 4: Solder 4.7kΩ Resistor Ntawm Echo Pin thiab GND Pin

Solder 4.7kΩ Resistor Ntawm Echo Pin thiab GND Pin
Solder 4.7kΩ Resistor Ntawm Echo Pin thiab GND Pin

Txiav thiab khoov 4.7kΩ tus tiv thaiv ob txhais ceg kom haum ntawm Echo tus pin thiab GND tus pin (lossis lawv cov ntsiab lus sib txuas ntawm PCB), thiab muab lawv tso rau ntawd.

Tsis teb los tau: Siv lub multimeter los tshuaj xyuas qhov tsis kam ntawm qhov sib txuas kom ntseeg tau tias tsis muaj luv.

Tsis tshua muaj neeg xaiv: Nqis tus pin txuas rau koj qhov program MCU, tsis txhob txuas tus Echo tus pin tsis tau, thiab nco ntsoov tias Echo teeb liab yog 3.3V thiab tsis yog 5V siv qhov koj nyiam oscilloscope. Okay, Kuv 85% tso dag rau qhov ntawd.:)

Tam sim no koj yuav tsum tuaj yeem txuas koj lub ntsuas hloov pauv rau ib qho 3.3V microcontroller. Koj tseem xav tau lub hwj chim nrog 5 volts, tab sis ntau lub microcontroller boards (uas muaj tus tswj hluav taws xob) kuj lees txais 5 volts, yog li qhov no yuav tsum ua haujlwm zoo nyob hauv ntau qhov haujlwm.

Ntxiv nyiaj ntxiv: qhov ntsuas qhov ntsuas qhov ntsuas no yuav rov qab sib xws nrog 5V cov haujlwm, vim tias feem ntau 5V microcontrollers (zoo li Arduino/ATMEGA) tuaj yeem txhais 3.3V teeb liab ib yam nkaus li lawv ua 5V.

Pom zoo: