Cov txheej txheem:
- Kauj Ruam 1: Cheeb Tsam
- Kauj ruam 2: Server Board
- Kauj Ruam 3: Server Coder: Luam thiab Muab Tshuaj
- Kauj Ruam 4: Pawg Neeg Siv Khoom
- Kauj Ruam 5: Tus Neeg Siv Khoom Code: Luam thiab Muab Tshuaj
- Kauj Ruam 6: Lus Cim Txog Txoj Cai:
Video: Wireless Servo Control: 6 Kauj Ruam
2024 Tus sau: John Day | [email protected]. Kawg hloov kho: 2024-01-30 09:29
Txoj haujlwm no tswj hwm kev sib hloov ntawm servo wirelessly los ntawm kev siv lub zog (pob qhov rooj). Kev sib hloov yog txwv rau 180 degrees.
Kauj Ruam 1: Cheeb Tsam
Txoj haujlwm no suav nrog
- 2 Arduino UNO cov laug cam nrog USB txuas cable
- 2 nRF24L01-2.4GHz RF transceiver modules (rau kev pab nrog cov qauv no xa mus rau
- 2 lub qhov (socket) adapter (lub hnab ev ntawv) rau nRF24L01
- 1 xaiv Arduino Tau Tshaj 328 ProtoShield Prototype Expansion Board
- 1 siv
- 1 analog potentiometer
- soldering hlau thiab solder
- xaim
- rab koob nosed pliers
- insulating qhwv, Kuv siv daim kab xev hluav taws xob
Kauj ruam 2: Server Board
Lub rooj tsav xwm neeg rau zaub mov suav nrog tus qauv xa xov, daim thaiv npog (uas txuas ncaj qha rau Arduino pawg thawj coj tsuas yog ib txoj hauv kev), thiab servo. Kuv tau txiav txim siab suav nrog daim phiaj thaiv kom tsis txhob muaj lub khob cij clumsy thiab muab txoj haujlwm thiab ua tiav tag nrho.
Cov cai thiab cov peev txheej hauv web suav nrog hauv cov npe teev qhia ntxaws txog qhov kev sib txuas ntawm tus xa xov. Kuv txiav txim siab los txuas cov kev sib txuas es tsis txhob siv kev sib txuas ib ntus zoo li hauv cov phiaj xwm yav dhau los. Txij li thaum kuv yog tus pib, Kuv tau insulated txhua qhov sib txuas nrog cov kab xev hluav taws xob (lawv tsis zoo nkauj).
Cov ntaub thaiv npog lub rooj sib tham ncaj qha rau Arduino pins. Ua ntej txuas daim phiaj thaiv, kuv txuas hauv av thiab 5volt pins rau lub rooj tsav tsheb nrog cov xaim thiab cov laug. Kuv kuj tau siv cov khoom sib txuas '5volt thiab cov xov hlau hauv av mus rau daim phiaj thaiv kab hlau, tom qab ntawd thaum kawg txuas Arduino rau daim thaiv npog.
Qhov kev pabcuam tau txuas rau 3volt tus pin rau lub zog thiab tus lej digital 2 rau kev sib txuas lus.
** Nco tseg: tsuas yog tom qab ua tiav qhov kev tsim no kuv tau pom tias kuv cov laug cam Arduino tsis zoo ib yam. Kuv tus neeg xa xov xa hluav taws xob tau siv los ntawm 5volt kev tsheb nqaj hlau ntawm daim phiaj thaiv, thaum cov neeg siv khoom xa xov hluav taws xob tau siv los ntawm 3volt tus pin, txawm hais tias kuv tau raug coj los ntseeg tias lub luag haujlwm ntawm lub adapter adapter ntawm lub transceiver yog los muab qhov hluav taws xob kom raug. Txhua yam kuv tuaj yeem hais tau tseeb yog tias cov cai tau muab sib phim nrog cov teeb tsa uas qhia hauv cov duab tsim cov txiaj ntsig piav qhia.
Kauj Ruam 3: Server Coder: Luam thiab Muab Tshuaj
// SERVER CODE/ * NRF24L01 Arduino CE> D8 CSN> D10 SCK> D13 MO> D11 MI> D12 RO> Tsis siv GND> GND VCC> 5V */// transceiver thaiv
#suav nrog
// servo lub tsev qiv ntawv
#suav nrog
// transceiver tsev qiv ntawv
#Txhais Servopin 2
// tshaj tawm servo tso tawm tus pin
ServoTimer2 pab;
// tshaj tawm lub npe servo
RH_NRF24 nrf24;
// tshaj tawm lub npe transceiver
int timeOUT = 0;
// sib txawv rau servo
pulse = 90;
// sib txawv los khaws cov mem tes
void teeb tsa ()
{serv.attach (Servopin); // servo cov khoom
Serial.begin (9600); // transceiver khoom
yog (! nrf24.init ())
Serial.println ("init ua tsis tau tejyam"); // serial monitor cov khoom yog (! nrf24.setChannel (12)) // teeb tsa channel rau 125 Serial.println ("setChannel ua tsis tiav"); yog (! nrf24.setRF (RH_NRF24:: DataRate2Mbps, RH_NRF24:: TransmitPower0dBm)) Serial.println ("setRF ua tsis tau tejyam"); // serial saib cov khoom}
void lub voj ()
{yog (nrf24.available ()) {uint8_t buf [RH_NRF24_MAX_MESSAGE_LEN]; uint8_t len = sizeof (buf); yog (nrf24.recv (buf, & len)) // serial monitor khoom {Serial.print ("tau thov:"); pulses = strtol ((const char*) buf, NULL, 10); // cov ntaub ntawv hom hloov khoom
int prin = daim ntawv qhia (mem tes, 750, 2250, 0, 180); // cov ntaub ntawv hom hloov khoom
Serial.println (prin); serv.write (mem tes); // ua rau servo txav}}
}
Kauj Ruam 4: Pawg Neeg Siv Khoom
Cov neeg siv khoom lag luam suav nrog tus qauv xa xov thiab lub hwj chim. Lub transceiver module yog txuas tib txoj hauv kev ** raws li cov neeg rau zaub mov pawg thawj coj saib xyuas tshwj tsis yog tias tsis muaj daim phiaj thaiv, nws tau txuas ncaj qha rau hauv Arduino board pins.
Lub ntsuas hluav taws xob siv 5v, hauv av, thiab txuas nrog rau tus pin analog 2.
** Nco tseg: raws li tau hais hauv qib server server, kuv Arduino boards tsis zoo ib yam. Hauv qhov no tus xa xov hluav taws xob tau xaim mus rau tus lej cim 3.3V, ncaj qha nyob ib sab rau 5V tus pin, tab sis ntxiv, txhua yam zoo li ua haujlwm tau zoo.
Kauj Ruam 5: Tus Neeg Siv Khoom Code: Luam thiab Muab Tshuaj
// CLIENT CODE/ * NRF24L01 Arduino CE> D8 CSN> D10 SCK> D13 MO> D11 MI> D12 RO> Tsis siv GND> GND VCC> 5V */// transceiver thaiv
#suav nrog
// transceiver tsev qiv ntawv
cov potpin = A2; // potentiometer delaration
koj val;
char tempChar [5];
Txoj hlua valString = ""; // cov ntaub ntawv hom hloov khoom
RH_NRF24 nrf24; // transceiver khoom
void teeb tsa ()
{Serial.begin (9600); yog (! nrf24.init ()) Serial.println ("init ua tsis tau tejyam"); // Qhov pib tom qab pib yog 2.402 GHz (channel 2), 2Mbps, 0dBm yog (! Nrf24.setChannel (12)) Serial.println ("setChannel ua tsis tiav"); yog (! nrf24.setRF (RH_NRF24:: DataRate2Mbps, RH_NRF24:: TransmitPower0dBm)) Serial.println ("setRF ua tsis tau tejyam"); } // transceiver khoom
void voj () {
val = analogRead (tus pin); // potentiometer khoom
val = daim ntawv qhia (val, 0, 1023, 750, 2250);
valString = nqi; Txoj hlua str = (valString); str.toCharArray (tempChar, 5); // datatype hloov khoom nrf24.send (tempChar, sizeof (tempChar));
}
Kauj Ruam 6: Lus Cim Txog Txoj Cai:
Txoj Cai muaj qee qhov txwv kev daws teeb meem kev ua haujlwm nyob rau hauv daim ntawv ntawm kev tawm tswv yim los ntawm tus lej saib hauv Arduino software interface. Thaum saib cov ntawv saib xyuas los ntawm SERVER code (ctrl + ua haujlwm + M), koj yuav tsum muaj peev xwm pom lub xeev ntawm lub zog ntsuas hauv daim ntawv ntawm tus lej ntawm 1 thiab 180.
Tsis tas li, ntawm no yog lub tsev qiv ntawv rau wireless thiab servo:
www.airspayce.com/mikem/arduino/RadioHead/
github.com/nabontra/ServoTimer2
Pom zoo:
Wireless Arduino Robot Siv HC12 Wireless Module: 7 Kauj Ruam
Wireless Arduino Robot Siv HC12 Wireless Module: Hav guys, txais tos rov qab. Hauv kuv qhov tshaj tawm yav dhau los, Kuv tau piav qhia tias H Choj Circuit yog dab tsi, L293D lub cev muaj zog tsav IC, piggybacking L293D Lub cev muaj zog tsav tsheb IC rau kev tsav tsheb tsav lub cev muaj zog tam sim no thiab koj yuav tsim thiab tsim koj li L293D lub cev tsav tsheb li cas
IR Raws Wireless Wireless Transmitter thiab Txais: 6 Kauj Ruam
IR Raws Li Lub Koob Yees Duab Wireless Transmitter thiab Txais: Wireless Audio twb yog lub thev naus laus zis thev naus laus zis nyob qhov twg Bluetooth thiab RF Kev Sib Txuas yog cov thev naus laus zis tseem ceeb (txawm hais tias feem ntau cov cuab yeej siv suab ua haujlwm nrog Bluetooth). Tsim qhov yooj yim IR Audio Link Circuit yuav tsis muaj txiaj ntsig
Fifty Meters Range Wireless Access Point Nrog TP Txuas WN7200ND USB Wireless Adapter ntawm Raspbian Stretch: 6 Kauj Ruam
Fifty Meters Range Wireless Access Point Nrog TP Txuas WN7200ND USB Wireless Adapter ntawm Raspbian Stretch: Raspberry Pi yog qhov zoo los tsim Kev Ruaj Ntseg Wireless Access Points tab sis nws tsis muaj ntau yam zoo, Kuv siv TP Txuas WN7200ND USB Wireless Adapter los txuas nws. Kuv xav qhia yuav ua li cas Vim li cas kuv thiaj xav siv raspberry pi hloov chaw ntawm lub router? T
DIY Wireless Mic rau Wireless Guitar System: 4 Kauj Ruam
DIY Wireless Mic rau Wireless Guitar System: Kuv tau saib qee cov vis dis aus thiab qee pab pawg thiab yuav luag ntawm lawv siv lub kaw lus wireless ntawm guitar. Mus vwm, tsiv, taug kev thiab ua txhua yam lawv xav tau yam tsis muaj hlua li kuv npau suav tias muaj ib qho .. Tab sis .. rau kuv tam sim no nws kim heev yog li kuv tuaj txog qhov no
Hloov Wireless Router rau Wireless Extender 2x Access Point: 5 Kauj Ruam
Hloov Wireless Router mus rau Wireless Extender 2x Access Point: Kuv tsis muaj wireless internet txuas hauv kuv lub tsev vim yog RSJ (hlau txhawb nqa nqaj hauv qab nthab) thiab xav txhawb lub teeb liab lossis ntxiv txuas ntxiv rau lwm lub tsev. Kuv tau pom qhov txuas ntxiv rau ib puag ncig &phaus; 50 hauv hluav taws xob