Cov txheej txheem:

Tswb Qhov Rooj Nrog ATTiny: 6 Kauj Ruam
Tswb Qhov Rooj Nrog ATTiny: 6 Kauj Ruam

Video: Tswb Qhov Rooj Nrog ATTiny: 6 Kauj Ruam

Video: Tswb Qhov Rooj Nrog ATTiny: 6 Kauj Ruam
Video: Tswv Yim Tws Tas - Macy Hawj (Audio/Lyric Video) 2024, Kaum ib hlis
Anonim
Rooj Tswb Nrog ATTiny
Rooj Tswb Nrog ATTiny

Nyob zoo txhua tus, hauv nplooj ntawv no kuv yuav qhia koj li cas kuv tau ua lub tswb qhov rooj yooj yim uas yog qhov me me, nrov nrov thiab siv roj teeb.

Kauj Ruam 1: Cheeb Tsam

Cheebtsam
Cheebtsam
Cheebtsam
Cheebtsam
Cheebtsam
Cheebtsam
Cheebtsam
Cheebtsam

Muaj cov npe tag nrho ntawm yam koj xav tau rau txoj haujlwm no, kuv tau khaws cov khoom feem ntau los ntawm cov khoom kuv tau tso nyob ib puag ncig, tab sis koj tuaj yeem yooj yim yuav lawv.

  • AtTiny45/85: Lub paj hlwb ntawm txoj haujlwm no, koj tuaj yeem siv txawm tias lub rooj tsav xwm arduino rau qhov no tab sis kuv xav tias nws txoj kev muaj zog dhau.
  • 5V Cov ntsuas hluav taws xob: Kuv siv CJ78M05 muab 5 volts rau Attiny.
  • LM386: op-amp uas yog tus hais lus.
  • Hais lus/Piezo: xaiv lub suab nrov, tsis txhob ua siab dhau.
  • Relay: Hluav taws xob siv hluav taws xob siv los tua Amp txhawm rau txuag lub zog thaum lub tswb nrov nyob ntawm ib leeg, kuv siv TX2-3V txawm hais tias kuv yuav tsav nws nrog 5v, uas yuav tsum zoo.
  • Optocoupler: Ib qho IC me me cais cov kauj ntawm qhov txuas los ntawm Attiny, kuv siv EL817 tab sis koj tuaj yeem siv txhua yam koj xav tau.
  • NPN transistor: tsav lub relay.
  • Diode: los tiv thaiv lub Circuit Court los ntawm qhov hluav taws xob muaj zog loj ntawm cov kauj tso tawm thaum lub relay tawm mus.
  • Reed Hloov: qhov hloov pauv sib nqus txhawm rau txheeb xyuas lub qhov rooj txoj haujlwm siv cov hlau nplaum.
  • Hlau nplaum: Kuv savaged no los ntawm lub qub hard disk.
  • Cov Capacitors: koj yuav xav tau 10 uF ib qho los teeb tsa qhov nce ntawm LM386 thiab ob 300uF, ib qho kom ruaj khov kab thiab ib qho rau cov lus hais tawm.
  • Resistors: ib 1kOhm rau lub hauv paus ntawm transistor, ib qho 1MOhm raws li lub zog tiv thaiv kab mob rau lub laj kab hloov pauv, kuv tau siv qhov kev tiv thaiv siab ib qho kom txuag tau lub zog thaum nyob ntawm ib leeg, thiab tiv thaiv rau cov tswv yim ntawm optocoupler.

Koj yuav tsum suav tus nqi ntawm qhov kawg no raws li cov ntaub ntawv ntawm koj optocoupler: hauv kuv cov ntaub ntawv cov ntaub ntawv qhia pom qhov zoo tshaj tam sim no ntws ntawm 20mA hla lub infrared coj ntawm optocoupler, yog li kuv tau tsav nws nrog 5v kuv suav tsis kam kuv xav tau siv Ohm txoj cai:

R = V/I R = 5v/0, 002A R = 250Ohms

  • Hloov: txuas nrog lub xov tooj ntev los qhib thiab kaw lub tswb.
  • Roj teeb txhuas+roj teeb 9v.
  • Perf board: Kuv tab tom siv ib qho nrog kev txuas hauv av hla ib sab los ua kom lub tshuab ntxhua khaub ncaws (tsis yog ib qho hauv daim duab).
  • header pins rau IC's thiab hais lus, ntsia hlau davhlau ya nyob twg rau qhov hloov: raccomended tab sis tsis nruj me ntsis tsim nyog.
  • Cov ntaub ntawv yas: dua, raccomended tab sis koj tuaj yeem txuas rau ntawm lub qhov rooj txawm tias siv daim kab xev ob tog lossis koj tuaj yeem txawm 3d luam ib qho.

Kauj ruam 2: Program ATTiny45

Program ATTiny45
Program ATTiny45
Program ATTiny45
Program ATTiny45

Raws li koj tau pom koj tsis tuaj yeem ntsaws ATTiny rau hauv koj lub chaw nres nkoj usb rau program nws, koj yuav xav tau ISP programmer. Yog tias koj tsis muaj tus programmer zoo li no koj tuaj yeem yooj yim siv pawg tswj hwm arduino ua ISP programmer li kuv tau ua. Nov yog cov theem koj yuav tsum ua raws:

Tshaj tawm "Arduino ISP" kos duab uas koj tuaj yeem pom hauv cov piv txwv ntawm Arduino IDE rau Arduino board

Txuas ATTiny mus rau Arduino raws li daim duab qhia, koj tuaj yeem ua daim ntaub thaiv zoo li kuv tau ua kom yooj yim rau rov ua dua tshiab yav tom ntej

  • Txuas Arduino mus rau qhov chaw nres nkoj usb thiab qhib IDE,
  • Nyob rau ntawd qhib "Cov cuab yeej" tab thiab "Programmer" thiab xaiv "Arduino li ISP".
  • Qhib "Cov Ntaub Ntawv", "Nyiam" thiab hauv Tus Thawj Saib Xyuas Haujlwm Ntxiv URL muab qhov url no:
  • Qhib "Boards", "Tus Thawj Saib Xyuas Haujlwm" thiab hauv qhov ntawd nqes cov npe uas nws hais tias "kev xav los ntawm Davis A. Mellis". Nyem rau ntawm qhov ntawd thiab nruab nws. Txij ntawm no koj yuav tsum tuaj yeem pom ATTiny hauv daim ntawv teev npe.
  • Tam sim no hauv cov ntawv qhia zaub mov xaiv ATTiny thiab hauv "Processor" xaiv qhov koj muaj, ntawm "Clock" xaiv "Internal 8Mhz" thiab tom qab ntawd nyem "Burn bootloader".

Tam sim no koj tau npaj los rub tawm thiab upload cov cai.

Kauj Ruam 3: Breadboard Circuit

Breadboard Circuit
Breadboard Circuit
Breadboard Circuit
Breadboard Circuit
Breadboard Circuit
Breadboard Circuit

Tam sim no koj yuav tsum ua Breadboard tus qauv raws li cov txheej txheem saum toj no los ntsuas txhua yam ua haujlwm.

Kauj Ruam 4: Perf Board Circuit

Perf pawg thawj coj saib Circuit
Perf pawg thawj coj saib Circuit

Tam sim no ib zaug koj tau sim txhua yam ua haujlwm koj tuaj yeem txav lub Breadboard Circuit mus rau perfboard ib qho. Siv PCB nrog Grounded sab ua rau koj txuag sijhawm thiab chaw ntau, thiab siv lub qhov rau txhua tus IC kuj yog lub tswv yim zoo. ib zaug koj ua tiav qhov kev sim hauv Circuit tseem ua haujlwm raug thiab tom qab ntawd ntxiv qhov hloov pauv hauv kab nrog qhov ua tau zoo ntawm 9v lub roj teeb txuas siv Ntsia Hlau txuas thiab xov hlau ntev.

Kauj ruam 5: Case thiab Mounting

Case thiab Mounting
Case thiab Mounting
Case thiab Mounting
Case thiab Mounting

Yog tias koj nyiam koj tuaj yeem muab txhua yam tso rau hauv rooj plaub lossis lub thawv kom khaws txhua yam zoo thiab kev cog lus, koj tuaj yeem txawm tias 3D luam tawm ib qho zoo ib yam hauv daim duab uas kuv tsim. Mount lub npov saum lub qhov rooj siv daim kab xev ob npaug los yog cov ntsia hlau thiab cov hlau nplaum ntawm lub qhov rooj nws tus kheej hauv kev sib tham mus rau lub reed hloov, nco ntsoov siv cov hlau nplaum muaj zog. Nkaum lub hwj chim hloov chaw lossis ua rau nws nyuaj rau nkag thiab koj tau ua tiav.

Kauj Ruam 6: Koj Ua tiav

Ntawm no koj muaj nws, ntawm qhov no koj yuav tsum muaj lub tswb qhov rooj ua haujlwm nrog lub roj teeb lub neej ntev, kuv thim ib ncig ntawm 1mA hauv kev sawv ntsug thiab siv lub roj teeb 9v uas hais txog muaj 500mAh nws yuav tsum nyob ntev li 500 teev. Yog tias koj xav kom txuag hluav taws xob ntau dua koj tuaj yeem zam qhov ntsuas hluav taws xob thiab lub zog hluav taws xob ncaj qha nrog 5 volts txo lub zog siv hluav taws xob rau qee qhov uA, txawm li cas los xij hauv txoj kev no lub tswb yuav muaj qis dua.

Yog tias koj muaj lus pom lossis teeb meem thaum tsim nws thov siv nqe lus hais qhia, kuv yuav muab kev daws teeb meem rau koj tsis muaj teeb meem.

Pom zoo: