Cov txheej txheem:

Tswj Cov Khoom Siv Hauv Ntiaj Teb Nrog Koj Lub PC: 15 Kauj Ruam (nrog Duab)
Tswj Cov Khoom Siv Hauv Ntiaj Teb Nrog Koj Lub PC: 15 Kauj Ruam (nrog Duab)

Video: Tswj Cov Khoom Siv Hauv Ntiaj Teb Nrog Koj Lub PC: 15 Kauj Ruam (nrog Duab)

Video: Tswj Cov Khoom Siv Hauv Ntiaj Teb Nrog Koj Lub PC: 15 Kauj Ruam (nrog Duab)
Video: Saib Mis paub Poj niam (hluas nkauj) tus yam ntxwv lub siab 2024, Hlis ntuj nqeg
Anonim
Tswj Cov Khoom Siv Hauv Ntiaj Teb Nrog Koj Lub PC
Tswj Cov Khoom Siv Hauv Ntiaj Teb Nrog Koj Lub PC

Cov Lus Qhia no qhia koj yuav ua li cas cuam tshuam PC thiab microcontroller. Qhov kev ua yeeb yaj kiab no yuav nkag siab qhov txiaj ntsig ntawm lub lauj kaub lossis cov lus sib piv thiab tseem tswj hwm servo. Tag nrho tus nqi qis dua $ 40 suav nrog kev pabcuam. Cov servo tig rau lub microswitch thiab tom qab ntawd microswitch tig rau ntawm lub teeb. Hauv daim ntawv thov siv tau lub lauj kaub tuaj yeem yog qhov ntsuas kub thiab qhov servo tuaj yeem tig lub rhaub. Lub servo tuaj yeem hloov pauv nrog kev xa tawm lossis lwm lub zog tswj. Lub picaxe yog programmed nyob rau hauv ib qho yooj yim version ntawm yooj yim thiab lub interface siv VB. Net. Txhua qhov software muaj pub dawb. Kev hais qhia qhia yuav ua li cas txuas ob lub microcontrollers ntawm internet

Kauj Ruam 1: Sau Cov Khoom

Sau Qhov Chaw
Sau Qhov Chaw

Daim ntawv teev npe: Picaxe 08M nti muaj los ntawm ntau qhov chaw suav nrog Rev Ed https://www.rev-ed.co.uk/picaxe/ (UK), PH Anderson https://www.phanderson.com/ (USA) thiab Microzed https://www.microzed.com.au/ (Australia) Protoboard, servo, microswitch, 9V roj teeb, 4 xAA roj teeb thiab tus tuav, tag sawb, 10k resistor, 22k resistor, 33uF 16V capacitor, 0.1uF capacitor, 7805L qis zog 5V tus tswj hwm, 10k lauj kaub, xov hlau (cov xov tooj tseem ceeb xov tooj/cov ntaub ntawv xov xwm piv txwv li Cat5/6), 6V lub teeb pom kev zoo, D9 poj niam lub qhov (socket) thiab npog, 2 meters ntawm 3 (lossis 4) cov ntaub ntawv tseem ceeb xaim, roj teeb clips Cov tuam txhab saum toj no tseem muag USB rau cov khoom siv uas muaj txiaj ntsig zoo rau lub khoos phis tawj uas tsis muaj chaw nres nkoj txuas. Nws tsim nyog sau cia tias qee qhov USB rau cov khoom siv ua haujlwm tsis ua haujlwm zoo ib yam thiab nws tsim nyog tau txais ib qho los ntawm ib qho ntawm cov khoom lag luam saum toj no raws li lawv tau sim rau siv nrog picaxe chips. Ib qho uas paub ua haujlwm yog https://www.rev-ed.co.uk/docs/axe027.pdf Yog lawm, yog tias koj lub khoos phis tawj muaj chaw nres nkoj txuas (lossis daim npav chaw nres nkoj qub) ces qhov no yuav tsis ua qhov teeb meem.

Kauj Ruam 2: Rub tawm thiab Nruab Ib Lub Software

Rub tawm thiab Nruab Ib Qho Software
Rub tawm thiab Nruab Ib Qho Software

Peb yuav xav tau VB. Net thiab picaxe maub los software. VB. Net (Visual Basic Express) muaj los ntawm https://msdn2.microsoft.com/en-us/express/aa718406.aspxIf qhov txuas no tsis ua haujlwm ces tshawb Hauv Google rau: pom qhov yooj yim nthuav qhia rub tawm picaxe software muaj los ntawm https://www.rev-ed.co.uk/picaxe/Koj yuav tsum tso npe nrog microsoft kom tau txais qhov rub tawm - yog tias qhov no yog teeb meem siv email cuav los yog ib yam dab tsi. Kuv tau pom nws muaj txiaj ntsig muab kuv tus email tiag tiag thaum lawv xa cov hloov tshiab qee zaum.

Kauj Ruam 3: Tsim kom muaj Download Circuit

Tsim ib qho Download Circuit
Tsim ib qho Download Circuit

Qhov kev rub tawm no siv lub picaxe nti, ob peb tus tiv thaiv, tus tswj hwm thiab roj teeb 9V. Cov ntaub ntawv ntau ntxiv muaj nyob hauv picaxe cov ntaub ntawv thiab qhov no tsuas yog siv ob peb feeb los tsim thaum txhua qhov khoom siv tes ua.

Kuv kuj tseem yuav ntxiv tias picaxes ua haujlwm zoo siab ntawm 3 AA roj teeb. Kev tswj hwm 5V muaj txiaj ntsig zoo rau kev siv cov khoom siv sib piv raws li qhov siv hluav taws xob tsis hloov pauv, tab sis kom yooj yim rau/tawm cov kab hluav taws xob tsis muaj kev tswj hwm qhov xav tau. Txoj cai 5V tuaj yeem tawm hauv qhov xwm txheej no.

Kauj ruam 4: Protoboard Layout ntawm Download Circuit

Protoboard Layout ntawm Download Circuit
Protoboard Layout ntawm Download Circuit

Daim duab no qhia txog rub tawm kab uas tsuas yog ntsaws D9 thiab ob peb metres ntawm qee cov tub ntxhais sib txuas. Feem ntau cov PCs niaj hnub no muaj D9 txuas txuas chaw nres nkoj. Lub PC tsim ua ntej txog 1998 yuav muaj 25 tus pin txuas. Kuv soldered txog 1cm ntawm cov tub ntxhais hlau xaim mus rau qhov kawg ntawm cov xov hlau uas hloov pauv tau thiab tom qab ntawd tso heatshrink ib puag ncig qhov no - cov xov hlau tseem ceeb nkag mus rau hauv protoboard zoo dua li cov xov hlau hloov pauv tau.

Kauj Ruam 5: Rub tawm Picaxe Program

Rub tawm Picaxe Program
Rub tawm Picaxe Program

Nyem rau ntawm xub xub xiav kom rub tawm. Yog tias nws tsis rub tawm muaj qee cov lus qhia debug hauv phau ntawv qhia picaxe. Koj tuaj yeem sim rub tawm ib qho program yooj yim kom qhib lub coj thiab tua los txheeb xyuas lub nti ua haujlwm. Txoj haujlwm no zoo li nws tsis ua dab tsi txog thaum nws txuas nrog PC li nws tau tos kom PC xa nws ib yam. Yog tias nws rub tawm zoo ces nws tau ua haujlwm thiab nti tau ua haujlwm thiab cov kauj ruam tom ntej yog rov teeb tsa lub nti ua ntu ntu ntu ntu.

Luam thiab paste cov cai hauv qab no. Txhawm rau saib nws nrog cov xim syntax saib hauv View/Options/Editor. Cov ntsiab lus xim zoo ib yam li VB. Net lub ntsiab: serin 3, N2400, ("Data"), b0, b1, b2, b3, b4, b5, b6, b7, b8, b9, b10, b11, b12, b13 readadc 1, b1 'nyeem lub lauj kaub ces xa cov lus rov qab no 0, N2400, ("Cov ntaub ntawv", b0, b1, b2, b3, b4, b5, b6, b7, b8, b9, b10, b11, b12, b13) xaiv rooj plaub b0 'nyeem cov ntaub ntawv me ntsis b0 rooj plaub <140' yog tias <140 ces teeb servo rau ib txoj haujlwm servo 2, 120 ncua 1000 'ncua sijhawm thib ob lwm qhov servo 2, 160 ncua sijhawm 1000 xaus xaiv qis 2' tua lub servo li serin ua qhov no ib yam nkaus ua main

Kauj Ruam 6: Txhim Kho Lub Circuit Court Raws Li Cov Txheej Txheem Sib Txuas Ib Leeg

Txhim kho lub Circuit Court li Serial Interface Circuit
Txhim kho lub Circuit Court li Serial Interface Circuit

Ob qhov kev hloov pauv hloov pauv tau hloov pauv mus rau picaxe Circuit. 22k resistor uas siv mus rau ceg 2 tam sim no mus rau ceg 4. Thiab ceg 2 tau raug tsaws. Lub hom phiaj nkaus xwb ntawm ceg 2 yog kom tau txais cov ntaub ntawv sau los ntawm lub PC yog li thaum lub nti tau ua haujlwm nws tuaj yeem txuas rau hauv av. Yog tias koj rov qab mus rau lub khoos phis tawj txhawm rau kho kab thiab lwm yam ces tshem tawm ob txhais ceg 2 hauv av thiab rov txuas dua 22k rau ceg 2. Lub picaxe tham rov qab rau PC ntawm ceg 7 yog li qhov no tsis tas yuav hloov pauv.

Ib lub lauj kaub tau ntxiv thiab cov servo tau ntxiv. Qhov kev pabcuam tsis tsim nyog tiag tiag thiab coj thiab 1k resistor yuav ua haujlwm tau zoo thiab/lossis ib qho kev sib txuas uas koj xav txuas. Kuv nyuam qhuav siv servo los qhia yuav ua li cas nyem qee yam ntawm lub vijtsam tuaj yeem ua qee yam txav mus los. Lub servo tau khiav tawm ntawm nws tus kheej lub hwj chim. Cov khoom siv hluav taws xob cais no yuav tsis xav tau yog tias picaxe tsuas yog tig lub teeb rau thiab tua. Lub picaxe tau npaj txhij mus - tam sim no peb xav tau qee tus lej VB.

Kauj Ruam 7: Sau Ib co VB Interface Code

Sau Ib co VB Interface Code
Sau Ib co VB Interface Code

Thaum VB. Net raug teeb tsa khiav nws thiab xaiv Cov Ntaub Ntawv/Txoj Haujlwm Tshiab thiab xaiv Windows Application. Koj tuaj yeem nyem Cov Ntaub Ntawv/Txuag Txhua txoj cai thaum pib thiab khaws rau txhua qhov chaw uas koj nyiam thiab tom qab ntawd yav tom ntej txawm tias pib qhov haujlwm los ntawm hauv VB. Net lossis nyem rau ntawm.sln cov ntaub ntawv uas yuav raug tsim.

Kauj Ruam 8: Tsim VB. Net Form

Tsim daim VB. Net Form
Tsim daim VB. Net Form

VB tsim daim foos tshiab hu ua Form1.vb. Koj tuaj yeem hloov lub npe tam sim no lossis tom qab lossis tsuas yog tso nws li Form1 yog tias txoj haujlwm yooj yim. Peb yuav tso nws li nws yog. Txhawm rau ntxiv qee qhov kev tswj hwm peb yuav tsum qhib lub cuab yeej uas tau ncig hauv ntsuab. Lub cuab yeej tuaj yeem qhib thiab kaw thaum twg nws xav tau - feem ntau thawj kauj ruam yog ntxiv cov kev tswj hwm tom qab kaw lub cuab yeej thiab ua haujlwm ntawm cov cai. Koj tuaj yeem tso nws qhib txhua lub sijhawm tab sis nws siv sijhawm me ntsis ntawm lub vijtsam.

Kauj Ruam 9: Ntxiv Timer

Ntxiv Timer
Ntxiv Timer

Peb tau nqes mus rau hauv lub thawv ntawv thiab xaiv lub sijhawm. Nyem ob npaug rau lub sijhawm kom ntxiv nws. Ib daim duab ntawm lub moos hu ua Timer1 yuav tshwm nyob rau hauv qab ntawm qhov screen thiab dhau ntawm sab xis ntawm cov khoom siv timer tau hais qhia. Koj tuaj yeem kho cov no lossis lawv tuaj yeem hloov pauv hauv kab ntawv ntawm lub chaws. Peb yuav tso lawv li lawv thiab hloov lawv hauv lub cev ntawm cov ntawv.

Raws li ib sab, lub thawv ntawv zoo li txaus ntshai me ntsis tab sis tsuas yog qee qhov xav tau rau feem ntau ntawm cov haujlwm - cov no yuav suav nrog Nyees khawm, Cov ntawv ntawv, Cov ntawv cim, Lub sijhawm, Lub thawv duab, Kos lub thawv thiab lub thawv xov tooj cua. Tej zaum qhib qhov haujlwm tshiab thiab ua si nrog qee lub sijhawm.

Kauj ruam 10: Ntxiv ob peb khawm

Ntxiv ob peb khawm
Ntxiv ob peb khawm

Nyem rau ntawm lub cuab yeej khawm thiab kos qhov loj ntawm lub pob ntawm Daim Ntawv 1. Peb yuav xav tau ob lub khawm, lub thawv duab thiab daim ntawv lo. Mus tom ntej thiab ntxiv cov no - lub screenshot tom ntej no qhia tag nrho cov no hauv. Qhov loj me thiab txoj haujlwm tsis tseem ceeb thiab koj tuaj yeem hloov npe lawv tom qab yog tias koj nyiam.

Kauj Ruam 11: Daim Ntawv Nrog Txhua Qhov Kev Tswj Ntxiv

Daim Ntawv Nrog Txhua Qhov Kev Tswj Ntxiv
Daim Ntawv Nrog Txhua Qhov Kev Tswj Ntxiv

Tam sim no daim ntawv 1 tau tso tawm. Lub npov ze ntawm Button2 yog lub thawv duab me me. Koj tuaj yeem tso duab hauv qhov no tab sis peb tsuas yog siv nws los qhia lub pob twg uas tau raug nias los ntawm kev hloov nws los ntawm liab mus rau ntsuab. Label1 qhia cov npe picaxe.

Kauj Ruam 12: Ntxiv Qee Cov Cai

Ntxiv Ib co Cai
Ntxiv Ib co Cai

Dhau ntawm sab xis nyob rau hauv ntsuab yog ob peb lub khawm muaj txiaj ntsig - qhov thib ob los ntawm sab xis yog Saib Txoj Cai khawm thiab khawm sab xis yog Tus Saib Tsim. Hauv kev xyaum thaum sau cov cai ib qho rov qab los ntawm cov kev xav no. Feem ntau yog tias ib tus nyob hauv Tus Qauv Tsim ob zaug nyem rau ntawm ib qho khoom xws li khawm coj mus rau qhov chaw hauv Txoj Cai Saib kom ntxiv qee qhov chaws lossis siv ib qho rau ib qho ntawm cov cai uas ua haujlwm thaum lub pob nyem. Txoj hauv kev no txoj haujlwm ntws dhau los ua neeg nkag siab zoo - tus neeg siv nyem rau yam thiab khoom ntawm cov cai khiav thiab hloov lub vijtsam thiab ntxiv rau. Rau peb lub hom phiaj txawm hais tias peb yuav dag thiab muab tso rau hauv tag nrho cov slab ntawm kev ua haujlwm. yuav muaj Cov Pej Xeem Chav Kawm Form1… Xaus Chav Kawm - hais qhov no thiab rho tawm nws. Tam sim no siv tag nrho cov cai hauv qab no thiab muab nws tso rau hauv. Imports System. IOImports Strings = Microsoft. VisualBasic 'yog li tuaj yeem siv qee yam xws li sab laug (thiab sab xis (rau cov hlua Cov Pej Xeem Hauv Chav Kawm Form1Public Tshaj Tawm Txog Kev Pauv Lib "kernel32" (ByVal dwMilliseconds Raws Li Integer)' rau kev hais lus pw tsaug zogDim NrogEvents serialPort Raws li Tshiab IO. Ports. SerialPort 'serial chaw nres nkoj tshaj tawmDim PicaxeRegisters (0 txog 13) Raws li Byte' sau npe b0 rau b13Private Sub Form1_Load (ByVal sender Raws li Lub Hom Phiaj, ByVal e Raws li System. EventArgs) Handles Me. LoadTimer = Muaj tseeb 'muab qhov no tso rau hauv qhov chaws raws li qhov tsis raug thaum tsimTimer1. Interval = 5000' 5 vib nas thisPictureBox1. BackColor = Xim. Red 'teeb tsa rau txoj haujlwm' liab'Array. Clear (PicaxeRegisters, 0, 13) 'tej zaum tsis xav tau raws li cov lus tshaj tawm blankEnd SubPrivate Sub Timer1_Tick (ByVal sender As System. Object, ByVal e As System. EventArgs) Handers Timer1. Tick 'timer zuam txhua 5 secondsCall SerialTxRx ()' tham nrog picaxeEnd SubSub SerialTxRx () Dim LabelString As String 'string to display by values DataP acket (0 txog 17) Raws li Byte 'tag nrho cov ntaub ntawv pob "Cov Ntaub Ntawv" +14 bytesDim Kuv Raws Li Integer' kuv ib txwm muaj txiaj ntsig zoo rau cov loops thiab lwm yam Label1. Text = "" 'tshem cov ntawv ntawm lub vijtsam rau kuv = 0 Rau 3DataPacket (i) = Asc (Mid ("Data", i + 1, 1)) 'ntxiv lo lus "Data" rau pob ntawvNextFor i = 0 Txog 13DataPacket (i + 4) = PicaxeRegisters (i)' ntxiv tag nrho cov bytes rau pob ntawvNextIf serialPort. IsOpen ThenserialPort. Close () 'tsuas yog nyob rau hauv rooj plaub tau qhibEnd IfTryWith serialPort. PortName = "COM1"' Feem ntau cov khoos phis tawj tshiab tsis zoo rau com1 tab sis ua ntej xyoo 1999 lub khoos phis tawj yuav muaj qhov tsis zoo rau com2. BaudRate = 2400 '2400 yog qhov maxiumum ceev rau me me picaxes. Parity = IO. Ports. Parity. None 'tsis muaj parity. DataBits = 8' 8 bits. StopBits = IO. Ports. StopBits. One 'one stop bit. ReadTimeout = 1000' milliseconds thiaj li tawm hauv 1 vib nas this yog tias tsis muaj lus teb. Qhib () 'qhib qhov chaw nres nkoj DiscardInBuffer ()' tshem qhov tsis nkag mus. Write (DataPacket, 0, 18) 'xa cov datapacket arrayCall Sleep (300)' 100 milliseconds yam tsawg kawg kom tos fo r cov ntaub ntawv kom rov qab los thiab ntau dua yog tias cov ntaub ntawv xa mus ntev dua. Read (DataPacket, 0, 18) 'nyeem rov qab hauv cov ntaub ntawv pob ntawv array. Close ()' kaw qhov chaw nres nkoj txuas nrog Nrog Rau Rau Kuv = 4 Rau 17LabelString = LabelString + "" + Str (DataPacket (i)) 'tig mus rau hauv kab ntawv TextNextLabel1. Text = LabelString' muab cov kab ntawv tso rau ntawm qhov screenCatch ex As Exception'MsgBox (ex. ToString) 'tsis pom qhov no yog xav pom qhov tseeb yuam kevLabel1. Text = " Timeout "'yuav tso saib qhov no yog picaxe tsis txuas nrog lwm yam EndEnd TryEnd SubPrivate Sub Button1_Click (ByVal sender As System. Object, ByVal e As System. EventArgs) Handles Button1. ClickPictureBox1. BackColor = Color. Red' hloov lub npov rau redPicaxeRegisters (0) 120 'tus nqi raws li xav tau rau servoEnd SubPrivate Sub Button2_Click (ByVal sender As System. Object, ByVal e As System. EventArgs) Handles Button2. ClickPictureBox1. BackColor = Color. Green' box to greenPicaxeRegisters (0) = 160 'arbitrary value for the servoEnd SubEnd Chav Kawm

Kauj ruam 13: Khiav qhov program

Khiav qhov Program
Khiav qhov Program

Fais fab lub picaxe yog tias nws tsis muaj zog. Khiav qhov program vb.net los ntawm txhaj rau daim duab peb sab ntsuab nyob rau sab saum toj ntawm lub vijtsam ze rau nruab nrab. Ntawm sab xis ntawm daim duab peb sab yog khawm ncua thiab khawm nres, lossis txoj haujlwm tuaj yeem raug tso tseg los ntawm txhaj rau sab saum toj sab xis x lossis nrog File/Exit yog tias koj tau ntxiv cov ntawv qhia zaub mov. Qhov kev zov me nyuam tuaj yeem suav ua ke yog tias koj nyiam tab sis rau kev debugging cia peb khiav nws hauv VB. Qhov timer xa tawm bytes txhua 5 vib nas this yog li nws siv sijhawm 5 vib nas this rau cov lus kom tshwm tuaj.. Cov no raug xa mus rau picaxe thiab tom qab ntawd xa rov qab dua. Nws yuav luag tsis tas yuav xa tag nrho 14 thiab koj cov cai tuaj yeem hloov pauv kom haum. Qhov thib ob byte nrog tus nqi ntawm 152 yog tus nqi ntawm lub lauj kaub uas hloov los ntawm 0 txog 255. Yog tias button1 tau nyem nws xa tus nqi 120 hauv thawj byte thiab yog tias button2 tau nyem nws xa 160 thiab picaxe program txiav txim siab cov no thiab txav tus servo. Qhov chaws no qhia yuav ua li cas xa cov ntaub ntawv thiab tau txais cov ntaub ntawv rov qab los ntawm lub microcontroller. Lub microcontroller tuaj yeem qhib txhua yam khoom siv - Kuv muaj txog 30 puag ncig kuv lub tsev uas siv lub tshuab tso dej, teeb, kev nyab xeeb, txheeb xyuas lub tsheb hauv txoj kev tsheb, tig lub xov tooj 3.6Kw thiab paub txog qib dej hauv cov tso tsheb hlau luam. Picaxes tuaj yeem hloov pauv ntawm lub npav loj thiab tuaj yeem sib txuas lus nrog lwm tus ntawm xov tooj cua txuas. com/id/Thoob Ntiaj Teb-microcontroller-txuas-rau-hauv-20/Ob nplooj ntawv tom ntej no tseem muaj qee qhov piv txwv ntawm yuav ua li cas siv cov ntsuas sib txawv thiab yuav ua li cas tswj cov cuab yeej sib txawv. Dr. James MoxhamAdelaide, South Australia

Kauj Ruam 14: Cov Khoom Siv

Cov cuab yeej siv tswv yim
Cov cuab yeej siv tswv yim

Tus khoos phis tawj picaxe muaj qee cov ntaub ntawv pab tau zoo, ib qho yog hu ua "Kev sib cuam tshuam sib txuas" thiab nws kuj tseem muaj nyob ntawm https://www.rev-ed.co.uk/docs/picaxe_manual3.pdfQhov no qhia txog kev tswj lub cav, nkag siab ib puag ncig thiab lwm yam muaj txiaj ntsig tswj. Ntxiv rau cov kev qhia no, muaj qee qhov uas kuv siv ntau zaus thiab ntau dua. Kub - LM35 qhov ntsuas kub ua kom muaj qhov hluav taws xob uas tuaj yeem ncaj qha mus rau hauv picaxe thiab tuaj yeem nyeem nrog nyeem ntawv nyeem lossis nyeem ntawv readadc10. Lub teeb - lub teeb nyob ntawm tus tiv thaiv muaj qhov tsis sib xws uas txawv ntawm ob peb puas ohms hauv tshav ntuj ci rau ntau dua 5 megohms hauv suab dub. Ntsuas qhov tsis kam ntawm qib teeb uas koj xav hloov ntawm thiab muab LDR ua ntu zus nrog tus tiv thaiv txog ntawm tus nqi zoo ib yam. Piv txwv li kuv xav kom pom lub teeb ntawm lub tsheb rub mus rau hauv lub tsheb kom qhib lub teeb. Kev tiv thaiv yog kwv yees li 1M los ntawm lub teeb ncaj qha yog li kuv tso 1M ua ke nrog LDR. Hloov - qee qhov hloov pauv ntawm 5V thiab 0V (ib tus ncej ob zaug muab pov tseg) tab sis qee qhov tsuas yog qhib thiab tua. Yog tias qhov hloov pauv nws tuaj yeem xa 5V rau lub picaxe nti tab sis yog tias nws tawm ntawm tus pin picaxe yuav 'ntab' thiab tuaj yeem muaj nuj nqis. Lub voj voog no qhia pom yuav ua li cas rub lub tswv yim nqis mus rau hauv av thaum qhov hloov pauv tawm. Qhov no yog lub vojvoog siv rau feem ntau cov khawm khawm. Potentiomter - lub pob qhov rooj zoo qub. Twiddle lub pob qhov rooj thiab nyeem qhov hluav taws xob rau hauv nti. Qhov muaj txhua yam ntawm lwm yam khoom siv hluav taws xob uas tsim hluav taws xob los ntawm 0-5V lossis tuaj yeem teeb tsa tau yooj yim los ua li ntawd. Piv txwv yog cov ntsuas hluav taws xob sib nqus, cov av noo, nrawm, kov, lub teeb pom kev deb, siab, xim thiab suab. Sensors feem ntau raug nqi ob peb duas las xwb.

Kauj Ruam 15: Tswj Cov Khoom Siv

Tswj cov cuab yeej
Tswj cov cuab yeej

Cov ntaub ntawv pabcuam picaxe muaj cov lus piav qhia zoo txog kev tswj lub cav thiab teeb. Ntxiv rau qhov kuv pom muaj ob peb lub voj voog uas kuv siv ntau thiab ntau dua. Thawj yog ib qho yooj yim transistor Circuit. Ib lub picaxe nti tuaj yeem tig qhov siab tshaj ntawm 20mA rau tus pin uas yog qhov zoo rau tig rau ntawm LED tab sis tsis ntau ntxiv. 547 transistor nce qhov tam sim no rau 100mA uas yog qhov zoo rau cov teeb pom kev me me. Qhov thib ob Circuit qhia pom mosfet. Mosfets xav tau yam tsis muaj tam sim no los tsav lawv - tsuas yog volts kom lawv tuaj yeem tswj tau ncaj qha los ntawm picaxe. Muaj txhua hom mosfets muaj tab sis kuv nyiam yog ib qho hu ua BUK555 60B https://www.ortodoxism.ro/datasheets/philips/BUK555-60A.pdf Nws tuaj yeem ncaj qha tsav los ntawm 5V (tsis zoo li qee qhov xav tau 10V) tab sis qhov txiaj ntsig tseem ceeb yog nws muaj qhov tiv taus tsawg heev thaum qhib rau - 0.045 ohms uas tsis ntau dua li qhov tsis kam ntawm cov xov hlau ib tus yuav txuas rau nws. Qhov no txhais tau tias nws tsis kub thaum tsav tsheb hnyav heev uas txuag lub zog thiab tseem txuag tau cov nqi cua sov. Raws li qhov piv txwv tsav 5amp load zoo li lub taub hau tsheb; watts = tam sim no ob npaug x tsis kam, yog li W = 5*5*0.045 = 1.12 watts uas tsuas xav tau lub rhaub dej kub zoo li 1inch square piece ntawm nyias txhuas. Qhov thib peb Circuit Court qhia txog kev xa xov. Muaj ntau qhov ntsuas rau txhua qhov kev xa tawm - cov kauj hluav taws xob, kauj tsis kam thiab lub zog thauj khoom thiab tam sim no. Piv txwv li kev xa tawm yuav muaj 12V coil nrog lub kauj tam sim no ntawm 30mA, coil tsis kam ntawm 400 ohms thiab tuaj yeem tuaj yeem tsav mus txog 240V ntawm 1 amp. Cov kauj tam sim no yog ntau dua thiab amps ntau dua li picaxe tuaj yeem muab tau, yog li peb siv cov transistor Circuit los hloov cov kauj. Muaj ib qho diode suav nrog - qhov no nyuab siab rov qab EMF thaum lub teeb xa tawm. Rov qab EMF yog dab tsi tsim lub txim rau lub txim taws yog li koj tsis xav tau cov hluav taws xob siab nyob txhua qhov chaw hauv Circuit Court. Cov kev sib cuag yuav muaj qhov siab tshaj tam sim no thiab volts - qhov tam sim no yuav yog ob peb amps thiab qhov hluav taws xob feem ntau yog 240V yog li hloov 12V lossis 24V yuav zoo nyob hauv thaj tsam. Yog tias koj tsis muaj kev paub nrog cov khoom siv hluav taws xob tsis ua si nrog lub zog hluav taws xob. Koj tseem muaj qhov txuas me me uas muaj cov kauj hluav taws xob ntawm 5V lossis 6V. Rau cov kev xa tawm no koj yuav tsis xav tau cais 12V cov khoom tab sis tsuas yog saib cov kauj tsis kam raws li ntau ntawm cov no muaj tam sim no kos ntau dua 100mA. Yog li thiab koj siv 78L05 100mA 5V tus tswj hwm koj yuav xav hloov qhov no mus rau 7805 tus tswj hwm uas tuaj yeem muab tau txog 1 amp. Kev xa tawm yog qhov muaj txiaj ntsig tshwj xeeb rau kev hloov AC - piv txwv li 24VAC lub vaj lub tshuab hluav taws xob, 12VAC lub teeb vaj thiab hluav taws xob ib puag ncig muaj suab nrov xws li tsheb. Lawv kuj tseem muaj txiaj ntsig rau kev tswj hwm kev thauj khoom loj, piv txwv li picaxe muab 20mA ntawm 5V = 0.1W tswj lub transistor 12V ntawm 100mA = 1.2W rau kev xa tawm 24V 100mA = 2.4W rau tus neeg hu xov tooj tsav 3600W twj tso kua mis. Yog tias koj xav tswj lub zog zoo li ntawd ces tau txais tus kws kho hluav taws xob los xaim lub thawv tswj thiab muab koj ob lub xov hlau tawm los (cov xov hlau txuas rau 12V relay) uas koj tuaj yeem tswj tau. Txoj hauv kev no tus kws hluav taws xob tuaj yeem kos npe tawm ntawm lub thawv fais fab thiab koj tuaj yeem ua txhua yam khoom siv hluav taws xob yam tsis tas yuav txhawj xeeb tias raug hluav taws xob. Lwm qhov siv rau kev xa rov qab yog kev thim rov qab rau lub cav. Siv cov tes taw dav dav hloov mus rau hauv mosfet koj tuaj yeem tswj qhov nrawm ntawm DC lub cav, thiab nrog DPDT lub zog txuas koj tuaj yeem hloov qhov kev taw qhia. Nov yog txoj hauv kev yooj yim ntawm kev tswj lub cav loj xws li cov uas siv hauv 'kev ua tsov rog neeg hlau'. Thov tso tawm lus yog tias koj xav tau kev pab tsim ib yam dab tsi.

Pom zoo: