Zininzi iimodyuli zeArduino okanye zokusetyenziswa kwiiprojekthi ze-DIY ngabenzi. Kwindaba ye I-L298N yimodyuli yokulawula ii-motors. Ngazo ungasebenzisa iikhowudi ezilula ukuya Inkqubo yebhodi yethu yeArduino kwaye ube nakho ukulawula ii-motors zeDC ngendlela elula nelawulwayo. Ngokubanzi, olu hlobo lwemodyuli lusetyenziswa ngakumbi kwiirobhothi okanye kwii-actuator ezihamba ngemoto, nangona inokusetyenziselwa uninzi lwezicelo.
Sele singenisile yonke into oyifunayo Imodyuli ye-ESP, ene-chip ye-ESP8266, un Imodyuli evumela ukwandisa amandla Iibhodi zeArduino kunye nezinye iiprojekthi ukuze zinxibelelane neWiFi. Ezi modyuli azinakusetyenziswa kuphela zodwa, into elungileyo kukuba zinokudityaniswa. Umzekelo, i-ESP8266 inokusetyenziselwa iprototype yethu kunye ne-L298N, esinokuthi sifumane kuyo imoto elawulekayo nge-Intanethi okanye ngaphandle kwamacingo.
Intshayelelo kwi-L298N kunye neenkcukacha zolwazi:
Nangona ngeArduino unokusebenza kunye nee-stepper motors, ezaziwa kakhulu kwiirobhothi, kule meko kuhlala kuyinto eqhelekileyo ukusebenzisa isilawuli okanye umqhubi weemoto zeDC. Unokufumana ulwazi malunga ne-chip ye-L298 kunye neemodyuli ezikwiifomathi zabavelisi, ezinje nge STMicroelectronics kule linki. Ukuba ufuna ukubona ugcino lwedatha yemodyuli ethile, hayi i-chip nje, unokuzikhuphelela le enye iPDF IHandsontec L298N.
Kodwa xa sithetha ngokubanzi, i-L298N ngumqhubi wohlobo lwe-H-bridge ovumela isantya kunye nolwalathiso lokujikeleza kweemoto zeDC ukuba zilawulwe. Ingasetyenziselwa ukuhambisa ii-motors ngokulula kwi-2 H-ibhulorho eziphumezayo. Oko kukuthi, ibhulorho ku-H, oko kuthetha ukuba yenziwe zii-4 transistors eziya kuvumela ukubuyisela umva kwicala langoku ukuze i-Rotor ye-motor ijikeleze kwicala elinye okanye kwelinye njengoko sifuna. Esi sisibonelelo esingaphezulu kwabalawuli esivumela kuphela ukulawula isantya sokujikeleza (RPM) ngokulawula kuphela ixabiso levolthi yokubonelela.
I-L298N inokusebenza ngeendlela ezahlukeneyo Iivolthi, ukusuka kwi-3v ukuya kwi-35v, kwaye ngamandla e-2A. Yiyo leyo eya kuthi ichonge ukusebenza okanye isantya sokujikeleza kweemoto. Kufuneka ithathelwe ingqalelo into yokuba i-elektroniki egqityiweyo kwimodyuli ihlala itya malunga ne-3v, ke loo nto iimoto ziya kuhlala zifumana i-3v encinci kumandla esiwondla ngayo. Ukusetyenziswa okuphezulu ngandlela ithile, enyanisweni inezinto ezinamandla amakhulu ezifuna i-heatsink njengoko ubona kumfanekiso.
Ukulawula isantya, unokwenza into eguqukayo kule nto siyenzileyo nge-LM35, kule meko, endaweni yokufumana umbane othile kwimveliso kwaye kufuneka uyiguqule ibe ziidigri, nantsi iya kuba ngokuchaseneyo. Sondla umqhubi ngombane ongezantsi okanye ophezulu ukuze afumane ukujika ngokukhawuleza okanye kancinci. Ukongeza, imodyuli ye-L298N ikwavumela ibhodi yeArduino ukuba inikwe amandla kwi-5v ukuba nje sinika amandla umqhubi ubuncinci bevolthi ye-12v.
Umdibaniso neArduino
Kukho ubuninzi beeprojekthi onokusebenzisa le modyuli L298N. Ngapha koko, unokucinga nje yonke into onokuyenza ngayo kwaye uqale ukusebenza. Umzekelo, umzekelo olula uya kuba kukulawulwa kweemotor ezimbini zangoku ngokuthe ngqo njengoko kunokubonwa kumzobo wangaphambili owenziwe noFritzing.
Ngaphambi kokuba sisebenze ne-L298N kufuneka sithathele ingqalelo ukuba igalelo lemodyuli okanye iVin ixhasa imilinganiselo phakathi kwe-3v kunye ne-35v Kwaye kufuneka siyidibanise nomhlaba okanye i-GND, njengoko kunokubonwa emfanekisweni ngentambo ebomvu nebomvu ngokwahlukeneyo. Nje ukuba uqhagamshelwe kumandla, into elandelayo kukudibanisa iimoto okanye iimoto ezimbini ezamkela ukulawula ngaxeshanye. Oku kulula, kuya kufuneka uqhagamshele iiterminal ezimbini zeemoto kwithebhu yoqhagamshelo enemodyuli kwicala ngalinye.
Kwaye ngoku kuza mhlawumbi kunzima kakhulu, kwaye kukudibanisa uqhagamshelo lwemodyuli okanye Izikhonkwane kwiArduino ngokufanelekileyo. Khumbula ukuba i-jumper yemodyuli okanye ibhulorho yolawulo ivaliwe, oko kukuthi, ivuliwe, imodyuli yolawulo lwevolumu iyasebenza kwaye kukho iziphumo ezi-5v onokuzisebenzisa ukunika amandla ibhodi yeArduino. Kwelinye icala, ukuba ususa i-jumper ucima umlawuli kwaye kufuneka unike amandla iArduino ngokuzimeleyo. iliso! Ngenxa yokuba i-jumper inokumiselwa kuphela ukuya kwi-12v voltages, ngaphezulu koku kufuneka uyisuse ukuze ungonakalisi imodyuli ...
Ungayixabisa loo nto Kukho ukudibanisa oku-3 kwenjini nganye. Ezo ziphawulwe njenge-IN1 ukuya kwi-IN4 zezizo ezilawula ii-motors A kunye no-B. Ukuba awunayo enye yeenjini ezidityanisiweyo kuba ufuna enye kuphela, awuzukuzibeka zonke. Ukutsiba kwicala ngalinye lokudibanisa kwimoto nganye yi-ENA kunye ne-ENB, oko kukuthi, ukwenza kusebenze imoto A kunye no-B, ekufuneka ibekhona ukuba sifuna zombini iimoto zisebenze.
ukuba Imoto A (Iya kuba njalo nge-B), kufuneka sibe ne-IN1 kunye ne-IN2 edityanisiweyo eya kuthi ilawule indlela ejikelezayo. Ukuba i-IN1 PHAKAMILEYO kwaye i-IN2 IPHANTSI, imoto ijika kwicala elinye, kwaye ukuba PHANTSI kwaye PHAKAMILE, iyajika enye. Ukulawula isantya sokujikeleza kufuneka ususe i-INA okanye i-INB jumpers kwaye usebenzise izikhonkwane ezibonakala ziyidibanisa ne-Arduino PWM, ukuze xa siyinika ixabiso ukusuka ku-0 kuye ku-255 sifumane isantya esisezantsi okanye esingaphezulu ngokulandelelana.
Ewe Inkqubo ilula nakwi-Arduino IDE. Umzekelo, ikhowudi iya kuba:
<pre>// Motor A int ENA = 10; int IN1 = 9; int IN2 = 8; // Motor B int ENB = 5; int IN3 = 7; int IN4 = 6; void setup () { // Declaramos todos los pines como salidas pinMode (ENA, OUTPUT); pinMode (ENB, OUTPUT); pinMode (IN1, OUTPUT); pinMode (IN2, OUTPUT); pinMode (IN3, OUTPUT); pinMode (IN4, OUTPUT); } //Mover los motores a pleno rendimiento (255), si quieres bajar la velocidad puedes reducir el valor hasta la mínima que son 0 (parados)</pre> <pre>//Para mover los motores en sentido de giro contrario, cambia IN1 a LOW e IN2 a HIGH void Adelante () { //Direccion motor A digitalWrite (IN1, HIGH); digitalWrite (IN2, LOW); analogWrite (ENA, 255); //Velocidad motor A //Direccion motor B digitalWrite (IN3, HIGH); digitalWrite (IN4, LOW); analogWrite (ENB, 255); //Velocidad motor B }</pre>