Cov txheej txheem:

Automated Model Railroad Layout Running Two Train (V2.0) - Arduino Raws: 15 Cov Kauj Ruam (nrog Duab)
Automated Model Railroad Layout Running Two Train (V2.0) - Arduino Raws: 15 Cov Kauj Ruam (nrog Duab)

Video: Automated Model Railroad Layout Running Two Train (V2.0) - Arduino Raws: 15 Cov Kauj Ruam (nrog Duab)

Video: Automated Model Railroad Layout Running Two Train (V2.0) - Arduino Raws: 15 Cov Kauj Ruam (nrog Duab)
Video: Automated multi-point model railroad running two trains | Arduino based 2024, Hlis ntuj nqeg
Anonim
Automated Model Railroad Layout Running Two Train (V2.0) | Arduino Raws
Automated Model Railroad Layout Running Two Train (V2.0) | Arduino Raws

Automating qauv kev tsheb ciav hlau txheej txheem siv Arduino microcontrollers yog txoj hauv kev zoo ntawm kev koom ua ke microcontrollers, cov phiaj xwm thiab qauv kev tsheb ciav hlau mus rau ib qho haujlwm. Muaj cov phiaj xwm phiaj xwm muaj nyob rau ntawm kev khiav tsheb ciav hlau ntawm tus qauv kev tsheb ciav hlau tab sis tom qab qee lub sijhawm, ib lub tsheb ciav hlau pib pib me ntsis. Yog li, txhawm rau nthuav tawm peb cov qauv, cia peb tau txais ib lub tsheb ciav hlau ntxiv thiab pib!

Kauj ruam 1: Saib Video

Image
Image

Saib cov vis dis aus saum toj no kom tau txais lub tswv yim ntawm qhov no ua haujlwm li cas.

Kauj Ruam 2: Tau Cov Khoom thiab Cov Cheeb Tsam

Program Arduino Micorocontroller
Program Arduino Micorocontroller

Nov yog yam koj yuav xav tau rau txoj haujlwm no:

  • Ib lub Arduino microcontroller board sib xws nrog Adafruit lub cev muaj zog tiv thaiv.
  • Adafruit lub cev muaj zog tsav tsheb thaiv v2.0.
  • Cov ntaub thaiv npog nthuav dav (Yeem tau, tab sis pom zoo kom ua rau thaiv yooj yim dua.)
  • 3 'hnov' lem.
  • 8 tus txiv neej rau txiv neej jumper xov hlau (Rau txuas txuas lub zog thiab tawm mus rau lub cev tiv thaiv kab mob.)
  • 3 teeb ntawm 3 tus txiv neej rau poj niam jumper xov hlau (Rau txuas 'sensored' lem rau Arduino board.
  • 12-volt DC lub zog siv hluav taws xob nrog lub peev xwm tam sim no tsawg kawg 1A (1000 mA).
  • Ib qho USB tsim nyog rau txuas Arduino board rau lub khoos phis tawj.
  • Ib lub computer.

Kauj Ruam 3: Program Arduino Micorocontroller

Nco ntsoov tias koj muaj Adafruit lub tshuab tiv thaiv lub v2 lub tsev qiv ntawv teeb tsa hauv koj li Arduino IDE, yog tias tsis yog, nyem Ctrl+Ua haujlwm+Kuv, tshawb rau Adafruit lub cev tiv thaiv kab mob thiab rub tawm qhov tseeb version ntawm Adafruit Motor shield V2 lub tsev qiv ntawv.

Ua ntej xa cov cai ntawm Arduino microcontroller, nco ntsoov hla nws kom tau txais lub tswv yim ntawm txhua yam tshwm sim thiab ua li cas.

Koj tuaj yeem kawm paub ntau ntxiv txog daim ntawv tsav tsheb ntawm no, tab sis nco ntsoov rov qab los txuas ntxiv txoj haujlwm!

Kauj Ruam 4: Ua Tus Txheej Txheem

Ua tus Layout
Ua tus Layout
Ua tus Layout
Ua tus Layout
Ua tus Layout
Ua tus Layout
Ua tus Layout
Ua tus Layout

Nyem rau ntawm thawj daim duab kom paub ntau ntxiv.

Ua tus qauv thiab teeb tsa lub zog pub rau ntawm kab tseem ceeb nrog rau kev hla mus. Nco ntsoov cais kev hla txoj kab hla hluav taws xob los ntawm cov kab tseem ceeb siv cov tsheb nqaj hlau txuas ntawm qhov chaw sib faib ntawm txoj kab sib ze ze ob qho tib si.

Nco tseg qhov chaw ntawm txhua qhov 'hnov' taug qab:

  • Thawj qhov 'hnov qab' taug qab tau teeb tsa tsuas yog tom qab kev xaiv tsa tau teeb tsa ntawm qhov tawm ntawm sab nrauv kom lub tsheb ciav hlau tawm ntawm txoj kab hla nws tsuas yog ua ntej los rau ntawm kab tseem ceeb.
  • Qhov thib ob 'nkag siab' taug qab tau teeb tsa hauv kab tseem ceeb qee qhov deb ua ntej nkag ntawm sab nrauv (Saib thawj daim duab rau siv).
  • Qhov thib peb 'hnov' taug qab tau teeb tsa ua ntej qhov kev xaiv tsa tau teeb tsa ntawm qhov nkag ntawm qhov rooj.

Kauj Ruam 5: Txhim Kho Cov Tsav Tsheb Tsav Tsheb ntawm Arduino Board

Txhim Kho Cov Tsav Tsheb Tsav Tsheb ntawm Arduino Board
Txhim Kho Cov Tsav Tsheb Tsav Tsheb ntawm Arduino Board

Txhim kho daim thaiv tsav tsheb rau ntawm pawg thawj coj Arduino los ntawm kev ua tib zoo kho tus pin ntawm pawg tsav tsheb nrog poj niam lub taub hau ntawm Arduino board. Saib xyuas ntxiv kom ntseeg tau tias cov pins tsis tau khoov hauv cov txheej txheem teeb tsa.

Kauj Ruam 6: Txuas Cov Hluav Taws Xob Hluav Taws Xob rau Cov Tsav Tsheb Tsav Tsheb

Txuas Cov Hluav Taws Xob Hluav Taws Xob rau Cov Tsav Tsheb Tsav Tsheb
Txuas Cov Hluav Taws Xob Hluav Taws Xob rau Cov Tsav Tsheb Tsav Tsheb
Txuas Cov Hluav Taws Xob Hluav Taws Xob rau Cov Tsav Tsheb Tsav Tsheb
Txuas Cov Hluav Taws Xob Hluav Taws Xob rau Cov Tsav Tsheb Tsav Tsheb
Txuas Cov Hluav Taws Xob Hluav Taws Xob rau Cov Tsav Tsheb Tsav Tsheb
Txuas Cov Hluav Taws Xob Hluav Taws Xob rau Cov Tsav Tsheb Tsav Tsheb

Ua cov kab txuas txuas hauv qab no:

  • Txuas cov kab tseem ceeb khiav lub zog pub rau lub davhlau ya nyob twg thaiv ntawm daim thaiv cim 'M1'.
  • Txuas cov kab hla hla lub zog mus rau lub davhlau ya nyob twg thaiv ntawm daim thaiv cim 'M2'.

Kauj Ruam 7: Txuas Cov Hluav Taws Xob rau Cov Tsav Tsheb Tsav Tsheb

Txuas Cov Qhib rau Cov Tsav Tsheb Tsav Tsheb
Txuas Cov Qhib rau Cov Tsav Tsheb Tsav Tsheb
Txuas Cov Qhib rau Cov Tsav Tsheb Tsav Tsheb
Txuas Cov Qhib rau Cov Tsav Tsheb Tsav Tsheb
Txuas qhov Turnouts mus rau Tsav Tsheb Tsav Tsheb
Txuas qhov Turnouts mus rau Tsav Tsheb Tsav Tsheb

Txuas qhov kev tawm mus los sib txuas los ntawm kev txuas lawv +ve (liab) thiab -ve (dub) xov hlau ua ke thiab txuas lawv mus rau lub davhlau ya nyob twg thaiv ntawm lub cav thaiv lub cim 'M3'.

Kauj Ruam 8: Txhim Kho Lub Nkoj Txuas Ntxiv ntawm Lub Cev Tsav Tsheb

Txhim Kho Daim Npog Ua Ntej ntawm Lub Cev Tsav Tsheb
Txhim Kho Daim Npog Ua Ntej ntawm Lub Cev Tsav Tsheb

Txhim kho daim npog nthuav dav ntawm tus neeg tsav tsheb tiv thaiv tib txoj kev uas lub cav thaiv tau teeb tsa ntawm Arduino board.

Kauj Ruam 9: Txuas cov kab ntawv 'nkag siab' mus rau daim npog nthuav dav

Txuas qhov 'hnov qab' Cov kab lus mus rau daim npog nthuav dav
Txuas qhov 'hnov qab' Cov kab lus mus rau daim npog nthuav dav
Txuas qhov 'hnov qab' Cov kab lus mus rau daim npog nthuav dav
Txuas qhov 'hnov qab' Cov kab lus mus rau daim npog nthuav dav
Txuas qhov 'hnov qab' Cov kab lus mus rau daim npog nthuav dav
Txuas qhov 'hnov qab' Cov kab lus mus rau daim npog nthuav dav
Txuas qhov 'hnov qab' Cov kab lus mus rau daim npog nthuav dav
Txuas qhov 'hnov qab' Cov kab lus mus rau daim npog nthuav dav

Txuas txhua qhov 'hnov qab' taug qab lub zog rau +5-volt header ntawm daim npog nthuav dav thiab 'GND' tus pin ntawm txhua lub sensor mus rau 'GND' header ntawm daim ntaub thaiv. Tom ntej no, ua cov kev sib txuas hauv qab no:

  • Txuas thawj lub ntsuas hluav taws xob tso tawm tus pin mus rau tus lej nkag 'A0' ntawm Arduino board.
  • Txuas lub sensor thib ob tus pin tso rau tus pin nkag 'A1' ntawm Arduino board.
  • Txuas lub sensor thib peb tus pin tso zis rau tus lej nkag 'A2' ntawm Arduino board.

Kauj Ruam 10: Tso Thawj Lub Tsheb ciav hlau hauv Sab

Muab Thawj Lub Tsheb Ciav Hlau tso rau ntawm Siding
Muab Thawj Lub Tsheb Ciav Hlau tso rau ntawm Siding

Muab thawj lub tsheb ciav hlau tso rau ntawm ib sab, siv cov cuab yeej rerailer tau pom zoo, tshwj xeeb tshaj yog rau cov tsheb ciav hlau.

Kauj Ruam 11: Fais fab Kev Teeb

Fais fab Kev Teeb
Fais fab Kev Teeb

Txuas lub hwj chim 12-volt rau Arduino pawg thawj coj lub zog txuas txuas thiab qhib lub zog.

Kauj Ruam 12: Xyuas kom tseeb tias txhua yam ua haujlwm tau zoo

Tom qab lub zog ntawm lub kaw lus, cov neeg tawm mus yuav tsum hloov pauv mus rau txoj kab khiav mus rau txoj kab tseem ceeb. Yog tias leej twg ntawm lawv hloov txoj hauv kev tsis raug, thim rov qab qhov tsis sib xws ntawm nws qhov kev sib txuas nrog lub cev tiv thaiv kab mob.

Tom qab cov neeg tawm mus tau hloov mus rau ntawm ib sab, lub tsheb ciav hlau yuav tsum pib txav qeeb thiab nrawm dua tom qab hla thawj qhov kev nkag siab. Yog tias lub tsheb ciav hlau pib txav mus rau qhov tsis raug ntawm txoj kab lossis txoj kab tseem ceeb, koj paub yuav ua dab tsi.

Kauj Ruam 13: Muab Txoj Kev Tsheb Ciav Hlau Thib Ob rau Siding Track

Muab Txoj Kev Tsheb Ciav Hlau Thib Ob rau Siding Track
Muab Txoj Kev Tsheb Ciav Hlau Thib Ob rau Siding Track
Muab Txoj Kev Tsheb Ciav Hlau Thib Ob rau Siding Track
Muab Txoj Kev Tsheb Ciav Hlau Thib Ob rau Siding Track

Tom qab thawj lub tsheb ciav hlau hla txoj kab thib ob 'nkag siab', cov neeg tawm mus yuav txav deb ntawm ob sab thiab lub zog ntawm txoj kab sib dhos yuav raug kaw. Nov yog lub sijhawm los tso lub tsheb ciav hlau thib ob rau ntawm qhov rooj.

Kauj Ruam 14: Zaum Rov Qab, So, thiab Saib Koj Cov Tsheb ciav hlau khiav

Kauj ruam 15: Mus Furthur

Vim li cas ho tsis hloov kho qhov teeb tsa no? Sim ua cov txheej txheem nyuaj dua, ntxiv cov tsheb ciav hlau, tawm mus, muaj ntau yam ua!

Txawm koj ua dab tsi, sim qhia koj qhov kev tsim nrog zej zog kom lwm tus pom koj txoj haujlwm. Txhua yam zoo tshaj plaws!

Pom zoo: