Cov txheej txheem:

Ntxiv Arduino-based Optical Tachometer rau CNC Router: 34 Cov Kauj Ruam (nrog Duab)
Ntxiv Arduino-based Optical Tachometer rau CNC Router: 34 Cov Kauj Ruam (nrog Duab)

Video: Ntxiv Arduino-based Optical Tachometer rau CNC Router: 34 Cov Kauj Ruam (nrog Duab)

Video: Ntxiv Arduino-based Optical Tachometer rau CNC Router: 34 Cov Kauj Ruam (nrog Duab)
Video: Xu Yang - Ib zaug ntxiv 🎶Karaoke🎶 Instrumental by DjSaDao 2024, Hlis ntuj nqeg
Anonim
Image
Image
Ntxiv Arduino-based Optical Tachometer rau CNC Router
Ntxiv Arduino-based Optical Tachometer rau CNC Router

Tsim qhov ntsuas RPM kho qhov muag rau koj lub tshuab CNC nrog Arduino Nano, IR LED/IR Photodiode sensor thiab OLED zaub rau tsawg dua $ 30. Kuv tau txais kev tshoov siab los ntawm eletro18 Kev Ntsuas RPM - Kev Siv Lub Tshuab Tachometer Qhia tau thiab xav ntxiv lub tachometer rau kuv li CNC router. Kuv ua kom yooj yim rau lub ntsuas hluav taws xob ntsuas, tsim tus qauv kev cai 3D-luam tawm rau kuv Sienci CNC router. Tom qab ntawd kuv tau sau ib daim duab Arduino los tso saib ob qho tib si digital thiab analog ntawm OLED zaub

Ob peb qhov yooj yim thiab ob peb teev ntawm koj lub sijhawm, thiab koj tuaj yeem ntxiv digital thiab analog RPM zaub rau koj lub tshuab CNC.

Nov yog cov npe khoom muaj rau kev xa khoom 2-hnub. Koj tuaj yeem tuaj yeem muab cov khoom rau tsawg dua yog tias koj txaus siab tos ntev dua.

Daim Ntawv Teev Npe

$ 6.99 Arduino Nano

$ 5.99 IR LED/IR Photodiode (5 khub)

$ 7.99 OLED zaub 0.96 daj/xiav I2C

$ 4.99 Jumper xov hlau

$ 1.00 30 ntiv tes (75 cm) 3-tus neeg xyuas pib-xaim hlau. Yuav tuaj yeem yuav los ntawm koj lub khw muag khoom hauv tsev hauv tsev (Tsev Depot, Lowes) hauv ntu yuav-los-tus-ko taw

$ 0.05 220 ohm resistor ($ 6.99 yog tias koj xav tau 750 pawg sib txawv resistors)

$ 0.50 Thaum tshav kub kub ntsws tubing ($ 5.99 yog tias koj xav tau ua tiav ntau yam)

3D Printed nkhaus

Arduino IDE (pub dawb)

Nco tseg: Kuv pib ntxiv ib.01μF capacitor tom qab kuv ruaj ntseg tag nrho cov xov hlau thiab ceeb toom qee qhov tsis raug RPM qhov tseem ceeb thaum CNC txav mus. Lub capacitor ua haujlwm zoo rau qis RPMs <20K tab sis nws ua kom lub teeb liab ntau dhau rau txhua yam uas siab dua. Kuv taug qab lub suab nrov mus rau lub zog Nano thiab tso ncaj qha los ntawm CNC ntaub thaiv npog. Kev faib khoom cais ua haujlwm rau txhua RPM. Kuv tau tso cov kauj ruam rau tam sim no, tab sis koj yuav tsum siv cais USB lub zog qhov chaw.

Kauj Ruam 1: Luam daim duab 3D

Luam tawm daim kab xev 3D
Luam tawm daim kab xev 3D

Luam daim kab xev 3D tuav IR LED thiab IR Photodiodes. Cov ntaub ntawv 3D nyob ntawm no thiab ntawm Thingiverse.

www.thingiverse.com/thing:2765271

Rau Sienci Zeb, lub kaum sab xis tau siv los txhawm rau txhawm rau lub kaum sab xis ntawm lub kaum sab xis, tab sis lub tiaj tiaj yuav zoo dua rau koj txoj haujlwm.

Kauj Ruam 2: Xaiv 3D Luam Tawm Cov Zaub OLED thiab Cov Khoom Siv Hluav Taws Xob

Optionally 3D Luam tus OLED Display Holder thiab Electronic Enclosure
Optionally 3D Luam tus OLED Display Holder thiab Electronic Enclosure

Kuv xaiv los txuas OLED rau lub kaum sab xis tuav uas kuv ntsia rau saum Sienci Electronics Enclosure.

Nov yog cov kev txuas mus rau ntu 3D luam ntawv uas kuv tau siv.

Sienci Electronics Enclosure 3D Tshooj

0.96 OLED Display Mounting Bracket

Lub thawv ntawv yog qhov chaw zoo rau txhawm rau txhawm rau teeb tsa OLED zaub thiab nws tuav Arduino Nano zoo, ntxiv rau nws haum rau sab nraum qab ntawm Sienci Zeb. Kuv tau laum ob peb lub qhov nyob rau sab saum toj ntawm lub thawv ntawv txhawm rau txhawm rau txhawm rau OLED.

Kuv kuj tau laum ob peb lub qhov hauv qab kom ua lub zip me me khi los txhawm rau txhawm rau txuas cov hlua hlau

Kauj Ruam 3: Tsim IR Sensor Hlau Sib Dhos

Tsim IR Sensor Hlau Los Ua Ke
Tsim IR Sensor Hlau Los Ua Ke

3-tus neeg xyuas pib xaim yuav siv los xaim lub ntsuas. Ib lub xov hlau yuav yog ib qho hauv av rau ob qho tib si IR LED thiab IR Photodiode, nrog rau ob qho ntawm ob qho mus rau lawv cov khoom sib xws.

Kauj Ruam 4: Ntxiv Tam Sim No Txwv Tiv Thaiv rau IR LED

Ntxiv Tam Sim No Txwv Tiv Thaiv rau IR LED
Ntxiv Tam Sim No Txwv Tiv Thaiv rau IR LED

IR LED xav kom muaj qhov txwv tam sim no. Txoj hauv kev yooj yim tshaj plaws, yog teeb tsa tus tiv thaiv rau hauv cov xaim sib dhos.

Khoov cov lus qhia ntawm txhua tus rau hauv U-puab thiab cuam tshuam lawv. Crimp nrog ib khub pliers thiab tom qab ntawd muab lawv ua ke.

Kauj Ruam 5: Splice Jumper Wires

Splice Jumper Wires
Splice Jumper Wires
Splice Jumper Wires
Splice Jumper Wires

Koj tuaj yeem txuas cov xov txuas hluav taws xob txuas rau lawv ntawm Arduino header pins.

Txiav ib daim ntawm cov cua sov ntsws tubing thiab swb hla cov hlau ua ntej txuas rau lawv.

Xaub lub cua sov ntsws ntsws rov qab hla qhov kev sib txuas (lossis tag nrho Resistor) thiab txo cov tubing los ntawm kev siv rab phom cua sov lossis khiav nplaim taws nrawm hla lub raj kom txog thaum nws nqaim. Yog tias siv nplaim taws, ua kom nws txav nrawm lossis nws tuaj yeem pib yaj.

Kauj Ruam 6: Txiav txim siab IR LED thiab Photodiode Leads

Txiav txim siab IR LED thiab Photodiode Leads
Txiav txim siab IR LED thiab Photodiode Leads

Ob qho IR LED thiab IR Photodiode zoo ib yam, txhua tus muaj cov hmoov txhuas ntev (anode lossis positive) thiab luv (cathode lossis tsis zoo) ua.

Kauj Ruam 7: Ntxig Diodes rau hauv tus tuav

Ntxig Diodes rau hauv tus tuav
Ntxig Diodes rau hauv tus tuav

Coj tus IR LED (lub teeb pom kev zoo) thiab ntxig nws rau hauv ib qho ntawm lub qhov tuav LED. Tig lub LED kom cov hmoov txhuas ntev nyob sab nraud. Hauv daim duab, koj tuaj yeem pom qhov pom tseeb LED nyob rau sab saum toj nrog nws cov hlau lead ntev nyob rau saum toj kawg nkaus.

Coj tus IR photodiode (tsaus diode) thiab ntxig nws rau lwm qhov. Tig lub photodiode kom nws cov hlau lead ntev nyob hauv plawv.

Raws li tau qhia hauv daim duab, luv luv ntawm LED thiab cov hlau lead ntev ntawm photodiode yuav ob leeg nyob hauv nruab nrab. Ob txoj hauv kev no yuav muab txuas rau ib qho xaim rov qab mus rau arduino. (Saib cov ntawv sau thev naus laus zis thaum kawg yog tias koj xav paub ntau ntxiv)

Nqa me me ntawm 1.75 filament thiab ntxig nws tom qab lub diodes. Qhov no yuav kaw lub diodes nyob rau hauv qhov chaw thiab tiv thaiv lawv los ntawm kev tig los yog tawm los.

Kuv tau dhau los ntawm ntau qhov kev tsim qauv ua ntej txiav txim siab ntawm qhov no. Muaj cov diodes lo tawm me ntsis txhim kho qhov ua siab ntev thaum ua kom nws nrog cov txiv ntoo sib tsoo.

Kauj Ruam 8: Fuse Lub Xauv Filament rau Tus Tuav

Fuse Lub Xauv Filament rau Tus Tuav
Fuse Lub Xauv Filament rau Tus Tuav

Koj yuav xav txiav qhov ntsuas phoo xauv rau ntev me ntsis dua li qhov dav ntawm tus tuav.

Ua kom sov tus ntsia hlau rau ob peb lub vib nas this hauv lub vise lossis tuav nws nrog cov pliers.

Kauj Ruam 9: Nias Filament Ends Against Heated Nail Head

Nias lub Filament Ends Against Heated Nail Head
Nias lub Filament Ends Against Heated Nail Head

Khaws koj tus ntiv tes rau ntawm qhov kawg ntawm lub ntsiab lus thiab nias kom yaj thiab fuse tus xauv tus pin hauv tus tuav.

Kauj ruam 10: Tiav Diode Holder

Tiav Diode Holder
Tiav Diode Holder

Yaug thiab huv si

Kauj Ruam 11: Txuas cov hlua txuas rau Diodes

Txuas cov hlua txuas rau Diodes
Txuas cov hlua txuas rau Diodes
Txuas cov hlua txuas rau Diodes
Txuas cov hlua txuas rau Diodes

Txiav cov hlau kom ntev rau koj daim ntawv thov. Rau Sienci Zeb, koj yuav xav tau txog 30 ntiv tes (~ 75cm) hauv qhov tag nrho (xaim + dhia) thiab muaj qhov ua rau lub router txav mus.

Khoov cov hlau thiab cov lus qhia ua U-puab los cuam tshuam lawv thiab ua kom yooj yim dua.

Siv qee qhov cua sov-ntsws tubing thiab txiav ob daim luv thiab ob daim me me ntev dua. Hlais cov ntawv luv dua rau sab nraum diode ua. Tshem tawm cov ntawv ntev dua ob qhov chaw nruab nrab.

Muaj ob qhov sib txawv ntawm qhov sib txawv ntawm qhov sib txuas ua ke thiab ua kom cov pob qij txha sib zog los ntawm ib leeg kom qhov txoj kab uas hla ntawm txoj hlua raug txo. Nws tseem tiv thaiv ib qho luv luv ntawm cov xov hlau sib txawv

Txiav peb daim me me ntawm txoj kab uas hla loj dua cov cua sov-ntsws tubing thiab tso lawv hla ntawm txhua ntawm peb lub xov hlau hauv txoj hlua hlau.

Nws yog ib qho tseem ceeb kom ntseeg tau tias muaj qhov sib txawv me ntsis ntawm qhov kawg ntawm cov cua sov ntsws tubing ntawm cov xov hlau thiab qhov txuas txuas. Cov xov hlau yuav kub dua, thiab yog tias cov cua sov ntswj tubing nyob ze dhau, lawv yuav pib nqaim thaum kawg, muaj peev xwm ua rau lawv tsawg dhau los swb hla qhov sib koom tes.

Kauj Ruam 12: Ua kom ntseeg tau tias Cov Hlau Nrog Cov Hluav Taws Xob tau txuas rau Ntev Lead ntawm IR LED

Tam sim no txwv kev tiv thaiv (220 ohm) ua rau hauv txoj hlua hlau, yuav tsum tau txuas nrog ntev (anode) ua rau pom tseeb ntawm IR LED. Cov xaim txuas ob txoj hauv kev sib txuas yuav txuas rau hauv av, yog li koj yuav xav siv cov xim dub lossis liab qab rau qhov kev txuas ntawd.

Siv cov kab sib txuas los ua kom lawv nyob ruaj khov.

Kauj Ruam 13: Txo Cov Cua Kub-ntsws Tubing

Ntsws cov cua sov-ntsws Tubing
Ntsws cov cua sov-ntsws Tubing

Tom qab cov pob qij txha tau raug siv lawm, siv qhov sib tw lossis sib zog kom txo tau cov tubing ntawm cov diode ua ntej. Ua ntej txav cov cua sov-ntsws tubing ntawm cov xov hlau kom deb ntawm tshav kub kom ntau li ntau tau.

Khaws cov nplaim taws kom txav mus sai li sai tau thiab tig mus kom tau txais txhua sab sib npaug. Tsis txhob nyob ntev lossis cov tubing yuav yaj es tsis txhob ntsws.

Tom qab cov diode coj tau nqaim, xaub qhov me me cua sov-ntsws tubing los ntawm cov xov hlau, hla cov pob qij txha thiab rov ua dua.

Kauj Ruam 14: Npaj Mounting Block

Npaj Mounting Block
Npaj Mounting Block

Nyob ntawm koj daim ntawv thov, xaiv cov mounting block uas haum rau koj daim ntawv thov. Rau Txij Zaum, xaiv lub kaum sab xis mounting block.

Siv lub txiv ntseej M2 thiab ntsia hlau M2. Ntsia cov txiv ntoo tsuas yog nyuam qhuav nyob rau qhov kawg ntawm cov ntsia hlau.

Tig lub mounting block hla thiab ntsuas haum M2 txiv ntoo rau hauv lub qhov.

Tshem tawm thiab ua kom sov cov txiv ntoo me ntsis nrog cov khoom sib dhos lossis cov nplaim hluav taws thiab tom qab ntawd ntxig nws mus rau sab nraub qaum ntawm qhov thaiv.

Ntsia lub hau ntswj, tawm hauv cov txiv ntoo rau hauv cov yas txuas thaiv. Rau qee qhov ntxiv dag zog, thov tso cov kua nplaum super rau ntawm ntug ntawm cov txiv ntoo kom ruaj ntseg txuas cov txiv ntoo rau qhov thaiv.

Kauj Ruam 15: Xyuas kom M2 Ntsia Hlau Yog Qhov Ncaj

Xyuas kom M2 Ntsia Hlau Yog Qhov Ncaj
Xyuas kom M2 Ntsia Hlau Yog Qhov Ncaj

Nco ntsoov tias cov ntsia hlau tsis ntev dhau los lossis lub ntsuas phoo yuav tsis nruj rau qhov thaiv qhov thaiv. Rau lub kaum sab xis mounting block, xyuas kom meej tias M2 ntsia hlau yog 9mm lossis luv dua.

Kauj Ruam 16: Txuas Mounting Block rau CNC Router

Txuas lub Mounting Block rau CNC Router
Txuas lub Mounting Block rau CNC Router

Rau Sienci Zeb, txuas lub kaum sab xis rau sab hauv qab ntawm sab hauv Z Rail nrog ob peb tee ntawm cov kua nplaum super.

Kauj Ruam 17: Txuas lub Sensor mus rau Mounting Block

Txuas lub Sensor mus rau Mounting Block
Txuas lub Sensor mus rau Mounting Block

Muab lub caj npab kho tau rau hauv qhov thaiv

Ntxig M2 ntsia hlau nrog lub tshuab ntxhua khaub ncaws los ntawm lub qhov nyob rau hauv lub caj npab txhim kho tau thiab ntsia hlau rau hauv cov txiv ntoo.

Xaub lub caj npab uas kho tau kom txog thaum LED thiab Photodiodes txawm tias yog lub router txiv ntoo sib txuas

Ceev cov ntsia hlau

Kauj Ruam 18: Ntxiv Daim Kab Xev Rau Ib Sab Ntawm Collet Nut

Ntxiv daim kab xev Reflective rau ib sab ntawm Collet Nut
Ntxiv daim kab xev Reflective rau ib sab ntawm Collet Nut

Siv daim kab xev me me ntawm daim kab xev aluminium (siv rau cov cua sov ducts) thiab txuas nws mus rau ib sab ntawm cov txiv ntoo sib tsoo. Daim kab xev ua kom pom tseeb no yuav tso cai rau IR kho qhov muag pom kom khaws ib qho kev hloov pauv ntawm ntxaiv.

Kauj Ruam 19: Xyuas kom daim kab xev Reflective tsis txhob hla ntawm ntug mus rau qhov nyob ib sab

Xyuas kom daim kab xev Reflective tsis txhob hla ntawm ntug mus rau qhov nyob ib sab
Xyuas kom daim kab xev Reflective tsis txhob hla ntawm ntug mus rau qhov nyob ib sab

Daim kab xev yuav tsum nyob ntawm ib sab ntawm cov txiv ntoo sib txuas nkaus xwb. Daim kab xev yog nyias thiab lub teeb txaus uas nws tsis cuam tshuam nrog cov ciaj ntswj los hloov qhov kawg ntawm cov mills lossis cuam tshuam rau ntxaiv qhov sib npaug.

Kauj Ruam 20: Khiav lub Sensor Hlau Raws Sab Hauv Z Rail

Khiav lub Sensor Hlau Raws Sab Hauv Z Rail
Khiav lub Sensor Hlau Raws Sab Hauv Z Rail

Siv cov kab xev ntawm daim kab xev txhuas, txuas cov xaim rau sab hauv ntawm Z Rail. Nws yog qhov zoo tshaj los kaw daim kab xev nyob ze ntawm ntug kev ntawm txoj kab tsheb nqaj hlau kom tshem tau cov hlau lead ntswj sib dhos.

Kauj Ruam 21: Txuas lub Sensor mus rau Arduino Nano

Txuas lub Sensor mus rau Arduino Nano
Txuas lub Sensor mus rau Arduino Nano

Txuas cov xov hlau mus rau Arduino raws li hauv qab no:

  • IR LED (nrog rau kev tiv thaiv tiv thaiv) -> Pin D3
  • IR Photodiode -> Pin D2
  • Common hlau -> Pin GND

Kauj Ruam 22: Txuas Jumper Wires rau OLED Display

Txuas Jumper Wires rau OLED Display
Txuas Jumper Wires rau OLED Display

Tshem tawm 4-xaim txheej ntawm cov hlua jumper

Txuas cov xov hlau rau hauv 4 tus pin rau I2C interface:

  • VCC
  • GND
  • SCL
  • SDA

Kauj Ruam 23: Txuas OLED Display rau Arduino

Txuas cov OLED zaub rau Arduino
Txuas cov OLED zaub rau Arduino
Txuas cov OLED zaub rau Arduino
Txuas cov OLED zaub rau Arduino

Txuas cov hlua jumper rau cov pins hauv qab no. Nco tseg: Cov xaim no tsis yog txhua tus txuas rau tus pin uas nyob ib sab, lossis tsis nyob hauv tib qho kev txiav txim.

  • VCC -> Pin 5V
  • GND -> Pin GND
  • SCL -> Pin A5
  • SDA -> Pin A4

Kauj Ruam 24: Txuas lub OLED zaub rau nws tus tuav

Txuas lub OLED zaub rau nws tus tuav
Txuas lub OLED zaub rau nws tus tuav

Siv cov kab zauv uas koj luam tawm ua ntej, muab cov duab OLED tso rau nws tus tuav

Tom qab ntawd muab cov zaub tso rau ntawm tus ncej CNC.

Kauj Ruam 25: Npaj Arduino IDE rau Loading Arduino Sketch

Npaj Arduino IDE rau Kev Thauj Khoom Arduino Sketch
Npaj Arduino IDE rau Kev Thauj Khoom Arduino Sketch

Ib txoj haujlwm rau Arduino hu ua kos duab. Kev Txhim Kho Ib Leeg Ib puag ncig (IDE) rau Arduinos yog pub dawb thiab yuav tsum tau siv los thauj lub program los txhawm rau ntsuas lub ntsuas thiab tso saib RPM.

Yog tias koj tsis muaj nws, ntawm no yog qhov txuas mus rub tawm Arduino IDE. Xaiv qhov rub tawm tau 1.8.5 lossis siab dua.

Kauj Ruam 26: Ntxiv Qhov Xav Tau OLED Tsev Qiv Ntawv

Ntxiv qhov Yuav Tsum Muaj OLED Tsev Qiv Ntawv
Ntxiv qhov Yuav Tsum Muaj OLED Tsev Qiv Ntawv

Txhawm rau khiav cov zaub OLED, koj yuav xav tau ob peb lub tsev qiv ntawv ntxiv, Adafruit_SSD1306 lub tsev qiv ntawv thiab Adafruit-GFX-Library. Ob lub tsev qiv ntawv yog pub dawb thiab muaj los ntawm cov kab ntawv txuas. Ua raws Adafruit cov lus qhia yuav ua li cas rau nruab cov tsev qiv ntawv rau koj lub khoos phis tawj.

Thaum cov tsev qiv ntawv raug teeb tsa, lawv muaj rau txhua Arduino kos duab koj tsim.

Cov tsev qiv ntawv Wire.h thiab Math.h yog tus qauv thiab tau suav nrog hauv koj li kev teeb tsa IDE.

Kauj Ruam 27: Txuas Arduino rau Koj Lub Computer

Siv tus qauv USB txuas, txuas Arduino Nano rau koj lub khoos phis tawj nrog Arduino IDE.

  1. Tua tawm IDE
  2. Los ntawm Cov cuab yeej ntawv qhia zaub mov, xaiv Board | Arduino Nano Cov
  3. Los ntawm Cov cuab yeej ntawv qhia zaub mov, xaiv Chaw Nkag |

Tam sim no koj tau npaj thauj cov duab kos, suav nws thiab muab xa mus rau Nano

Kauj ruam 28: Rub tawm Arduino Sketch

Arduino Sketch code tau txuas nrog thiab tseem muaj nyob ntawm kuv nplooj ntawv GitHub qhov twg yuav muaj kev txhim kho yav tom ntej yuav tshaj tawm.

Rub tawm OpticalTachometerOledDisplay.ino cov ntaub ntawv thiab muab tso rau hauv cov npe ua haujlwm nrog tib lub npe (rho tawm.ino).

Los ntawm Arduino IDE, xaiv Cov Ntaub Ntawv | Qhib …

Nkag mus rau koj phau ntawv teev npe ua haujlwm

Qhib cov ntawv OpticalTachometerOledDisplay.ino.ino.

Kauj Ruam 29: Sau Daim Duab Sketch

Sau cov Sketch
Sau cov Sketch
Sau cov Sketch
Sau cov Sketch

Nyem rau 'Kos' khawm lossis xaiv Sketch | Txheeb xyuas/Sau los ntawm cov ntawv qhia zaub mov kom suav sau cov duab.

Koj yuav tsum pom thaj chaw sib sau ua ke hauv qab, nrog kab ntawv xwm txheej. Hauv ob peb lub vib nas this cov lus "Ua Ntej Ua Ke" thiab qee qhov kev txheeb xyuas qhov kev nco ntau npaum li cas cov duab kos yuav tshwm sim. Tsis txhob txhawj xeeb txog qhov "Muaj Tsawg Muaj Nco" cov lus, nws tsis cuam tshuam dab tsi. Feem ntau ntawm kev nco tau siv los ntawm GFX lub tsev qiv ntawv xav tau los kos cov ntawv ntawm OLED zaub thiab tsis yog qhov kos duab tiag tiag.

Yog tias koj pom qee qhov yuam kev, lawv feem ntau yuav tshwm sim los ntawm cov tsev qiv ntawv ploj, lossis teeb meem teeb tsa. Txheeb ob zaug tias cov tsev qiv ntawv tau theej rau hauv phau ntawv qhia raug rau IDE.

Yog tias tsis kho qhov teeb meem kos cov lus qhia yuav ua li cas rau nruab lub tsev qiv ntawv thiab sim dua.

Kauj ruam 30: Upload rau Nano

Upload rau Nano
Upload rau Nano

Nias lub pob 'Xub' lossis xaiv Sketch | Rub tawm los ntawm cov ntawv qhia zaub mov kom suav thiab xa cov duab kos.

Koj yuav pom tib 'Compiling..' cov lus, ua raws los ntawm 'Uploading..' cov lus thiab thaum kawg 'Done Uploading' cov lus. Arduino pib ua haujlwm qhov program sai li sai tau Upload tiav lossis sai li sai tau lub zog tau thov tom qab.

Txog tam sim no, OLED cov zaub yuav tsum muaj sia nrog RPM: 0 zaub nrog lub xov tooj ntawm xoom.

Yog tias koj tau tso lub router rov qab ua ke, koj tuaj yeem qhib qhov hloov pauv thiab pom cov zaub nyeem tawm RPM thaum koj kho qhov nrawm.

Nrog koj zoo siab!

Kauj Ruam 31: Siv Dedicated Power Source

Siv Dedicated Power Source
Siv Dedicated Power Source
Siv Dedicated Power Source
Siv Dedicated Power Source

NCO TSEG: Qhov no yog lub hauv paus ntawm lub teeb liab nrov nrov uas ua rau tsis pom kev RPM. Kuv tab tom tshawb nrhiav tso qee lub kaus mom lim rau ntawm lub zog dhia, tab sis tam sim no koj yuav xav tau lub hwj chim los ntawm cais USB cable.

Koj tuaj yeem khiav cov zaub txuas nrog koj lub khoos phis tawj nrog USB cable, tab sis thaum kawg koj yuav xav tau lub zog tshwj xeeb.

Koj muaj ob peb txoj kev xaiv, koj tuaj yeem tau txais tus qauv USB phab ntsa them nyiaj thiab khiav Arduino los ntawm nws.

Lossis koj tuaj yeem khiav Arduino ncaj qha los ntawm koj lub tshuab CNC router hluav taws xob. Arduino/OLED cov duab tsuas yog kos 0.04 amps, yog li nws yuav tsis mus hla koj cov khoom siv hluav taws xob uas twb muaj lawm.

Yog tias koj muaj Arduino/CNC Router Shield hluav taws xob (zoo li Sienci Zeb), tom qab ntawd koj tuaj yeem siv ob peb tus pin uas tsis tau siv los coj mus rau qhov xav tau 5 volts ntawm lub zog.

Ntawm sab laug sab sauv ntawm CNC router daim thaiv, koj tuaj yeem pom tias muaj ob peb tus pin uas tsis siv uas sau tias 5V/GND. Txuas ib khub ntawm jumper cables rau ob tus pin no.

Kauj Ruam 32: Txuas Arduino mus rau Lub Hwj Chim Jumpers

Txuas Arduino mus rau Lub Hwj Chim Jumpers
Txuas Arduino mus rau Lub Hwj Chim Jumpers
Txuas Arduino mus rau Lub Hwj Chim Jumpers
Txuas Arduino mus rau Lub Hwj Chim Jumpers

Nov yog qhov yooj yim, tab sis tsis zoo li daim ntawv lo.

Ntawm Arduino Nano, muaj teeb tsa ntawm 6 tus pin kawg ntawm pawg thawj coj. Lawv tsis sau npe, tab sis kuv tau suav nrog tus pin tawm daim duab thiab koj tuaj yeem pom tias ob sab sab nraud uas nyob ze rau qhov taw qhia LEDs tau sau GND thiab 5V ntawm daim duab.

Txuas lub jumper los ntawm 5V tus pin ntawm CNC daim thaiv rau tus pin ze rau ntawm ib daim ntawv lo VIN (tsis txhob txuas nws rau VIN, tab sis mus rau sab hauv tus pin tus lej 6 pawg). VIN yog rau lub zog Nano nrog 7V-12V lub zog.

Txuas lub jumper los ntawm GND tus pin ntawm CNC daim thaiv rau tus pin nyob ze rau TX1 tus pin.

Tam sim no thaum koj qhib lub CNC router hluav taws xob, OLED RPM zaub yuav los ib yam thiab.

Kauj Ruam 33: Cov Lus Cim Qhia ntawm Circuit

Cov Lus Cim Tseem Ceeb ntawm Circuit
Cov Lus Cim Tseem Ceeb ntawm Circuit

Lub ntsuas hluav taws xob ntsuas siv IR LED/IR Photodiode khub.

IR LED ua haujlwm zoo li ib txwm LED. Cov hlau lead zoo (ntev dua lossis anode) txuas nrog qhov hluav taws xob zoo. Ntawm Arduino Nano, nws yog tus pin tso tawm teeb rau HIGH. Cov hmoov txhuas tsis zoo (luv dua lossis cathode) txuas nrog hauv av kom ua tiav cov Circuit Court. Txij li LEDs nkag siab rau qhov tam sim no ntau dhau, ib qho me me tiv thaiv tau muab tso ua ke nrog LED los txwv cov nqi tam sim no. Tus tiv thaiv no tuaj yeem nyob txhua qhov hauv Circuit Court, tab sis nws ua rau muaj kev nkag siab tshaj plaws los tso nws rau ntawm qhov zoo ntawm Circuit Court, txij li cov hlau lead tsis zoo koom nrog kev txuas hauv av nrog photodiode.

IR Photodiode coj zoo ib yam li lwm lub diode (suav nrog Lub Teeb Emitting Diodes LEDs) hauv qhov uas lawv tsuas yog siv hluav taws xob hauv ib qho kev taw qhia, thaiv hluav taws xob hauv qhov kev coj rov qab. Tias yog vim li cas nws thiaj tseem ceeb kom tau txais qhov polarity raug rau LEDs ua haujlwm.

Qhov sib txawv tseem ceeb nrog Photodiodes, yog thaum lawv pom lub teeb, cov photodiodes yuav tso cai rau hluav taws xob ntws ob txoj kev. Cov cuab yeej no yog siv los ua lub ntsuas hluav taws xob (hauv qhov no Lub Teeb Hluav Taws Xob lossis IR). IR Photodiode tau txuas nrog qhov tsis sib xws (hu ua rov qab tsis ncaj ncees) nrog qhov zoo 5V ntawm Arduino tus pin txuas nrog cov hlau tsis zoo ntawm photodiode thiab cov hlau lead zoo tau txuas nrog los ntawm cov xov hlau ib txwm nrog rau IR LED rau hauv av.

Tsis muaj lub teeb IR, IR photodiode thaiv hluav taws xob, tso cai rau Arduino tus pin nrog nws sab hauv rub tawm tus tiv thaiv nyob rau ntawm lub xeev HIGH. Thaum IR photodiode pom IR lub teeb, nws tso cai rau hluav taws xob ntws, tsaws tus pin thiab ua rau HIGH tus nqi ntawm tus pin photodiode poob qis rau hauv av ua rau FALLING ntug uas Arduino tuaj yeem tshawb pom.

Qhov kev hloov pauv ntawm lub xeev ntawm tus pin Arduino tau siv hauv daim duab los suav cov kev tawm tsam.

Cov kab xev ntawm txhuas daim kab xev ntawm cov txiv ntoo sib txuas, cuam tshuam txog IR lub teeb los ntawm ib txwm-ntawm IR LED rov qab mus rau IR photodiode txhua lub sijhawm nws tig dhau lub sensor.

Kauj Ruam 34: Cov Lus Cim ntawm Arduino Sketch

Arduino kos duab tsav lub OLED cov duab thiab ua ke ua ke rau IR LED/IR Photodiode sensor.

Daim Sketch pib OLED cov duab thoob plaws nws I2C (Inter-integrated Circuit) raws tu qauv. Cov txheej txheem no tso cai rau ntau cov lus/ntsuas kom sib qhia kev sib txuas thiab tuaj yeem nyeem lossis sau rau ib lub cuab yeej txuas nrog yam tsawg kawg ntawm cov xov hlau (4). Qhov kev txuas no txo tus naj npawb ntawm kev sib txuas ntawm Arduino thiab OLED zaub.

Nws mam li tig rau IR LED los ntawm kev teeb tsa tus pin HIGH muab 5V xav tau rau LED.

Nws txuas qhov kev cuam tshuam cuam tshuam rau tus pin uas hu ua thaum nws pom qhov kev hloov pauv uas tus pin lub xeev. Hauv qhov no qhov kev nce qib Revolution () muaj nuj nqi yog hu ua thaum twg pom FALLING ntug pom ntawm tus Pin 2.

Ib qho kev cuam tshuam cuam tshuam tsuas yog qhov nws cuam tshuam, nws cuam tshuam txhua yam uas tam sim no tau ua tiav, ua tiav txoj haujlwm thiab tom qab ntawd rov pib ua qhov tseeb uas nws tau cuam tshuam. Kev cuam tshuam kev ua haujlwm yuav tsum luv li sai tau, hauv qhov no nws tsuas yog ntxiv ib qho rau ntawm qhov sib txawv ntawm cov txee. Me ntsis Arduino Nano khiav ntawm 16Mhz - 16 lab mus rau ib pliag - txaus txaus txaus los daws qhov cuam tshuam ntawm 30, 000 RPM, uas tsuas yog 500 kiv puag ncig.

Lub Loop () muaj nuj nqi yog thawj qhov ua haujlwm rau ib qho Arduino kos duab. Nws tau txuas ntxiv hu ua, ntau thiab ntau dua ntev npaum li Arduino muaj lub zog. Nws tau txais lub sijhawm tam sim no, kuaj xyuas seb lub sijhawm tshwj xeeb tau dhau mus lawm (1/4 thib ob = 250 milliseconds). Yog li, nws hu rau updateDisplay () muaj nuj nqi los tso saib tus nqi RPM tshiab.

Lub voj ua haujlwm tseem yuav ua kom cov zaub poob qis tom qab 1 feeb thiab tua cov zaub tom qab 2 feeb - teeb tsa tau tag nrho hauv txoj cai.

Kev hloov kho tshiab () ua haujlwm hu ua calculRpm () muaj nuj nqi. Txoj haujlwm ntawd suav nrog suav cov kev tawm tsam qhov kev cuam tshuam cuam tshuam tau nce zuj zus thiab suav nrog RPM los ntawm kev txiav txim siab tus nqi ntawm kev tawm tsam ib lub sijhawm twg thiab suav qhov ntawd rau tus lej ntawm Kev Tawm Tsam Ib feeb.

Nws qhia txog tus lej tus lej thiab siv qee Lub Tsev Kawm Ntawv Qib Siab txhawm rau kos cov lus sib piv thiab qhov taw tes qhia kom pom qhov zoo ib yam.

Qhov ruaj khov nyob rau sab saum toj ntawm daim duab tuaj yeem hloov kho, yog tias koj xav tau RPM hu nrog qhov sib txawv loj thiab qhov tseem ceeb me.

Hloov kho ncua thiab nruab nrab ncua sijhawm kuj tseem tuaj yeem hloov kho.

Pom zoo: