Cov txheej txheem:
- Khoom siv
- Kauj ruam 1: Pi Teeb
- Kauj Ruam 2: Coj thiab Lub Teeb Sensor
- Kauj Ruam 3: Servo Motor
- Kauj Ruam 4: RFID Reader RC522
- Kauj Ruam 5: Load Cell HX711
- Kauj Ruam 6: LCD (16*2)
- Kauj Ruam 7: Puv Circuit Court
- Kauj Ruam 8: Pib Qhov Case
- Kauj Ruam 9: Muab Nws Ua Ke
- Kauj ruam 10: Lub Vev Xaib
Video: Tsis Siv Neeg Dog Dispenser: 10 Kauj Ruam
2024 Tus sau: John Day | [email protected]. Kawg hloov kho: 2024-01-30 09:26
Nrog kuv qhov project kuv paub tseeb tias thaum koj tso koj tus dev nyob ib leeg hauv tsev, nws / nws yeej tsis muaj zaub mov noj.
Lub tshuab pub mis tsis siv neeg yuav "hacked" los ntawm lub tshuab xa cov pob kws. Lub tshuab xa khoom yog lub chaw tso khoom rau dev noj, lub log nyob hauv qab yuav txuas nrog lub cav servo uas cia li poob zaub mov thaum lub txaj txaj yuav luag tas thiab thaum tus dev nyob ze txaus. Hauv qab ntawm lub dispenser yuav muaj PVC raj txuas uas yuav tso cov khoom noj dev zoo rau hauv txaj. Vim li no txoj haujlwm no yuav muaj 3 lub ntsuas hluav taws xob, 2 qhov uas tsis suav nrog hauv chav kawm thiab 1 uas yog tus ua haujlwm.
Thawj lub sensor yog RFID nyeem ntawv. Qhov ntsuas no ntsuas thaum tus dev los ze rau lub txaj. RFID yuav suav nrog hauv tus dev lub dab tshos. Yog tias lub ntsuas ntsuas pom tias tus dev nyob ze txaus, nws yuav xa lub teeb liab mus rau lub cim thib ob. Qhov ntsuas thib ob yog lub ntsuas qhov hnyav (tsis suav nrog hauv chav kawm) uas ntsuas cov zaub mov hauv lub txaj, yog lub ntsuas ntsuas pom tias qhov hnyav qis dhau, nws yuav xa lub teeb liab mus rau lub tshuab servo uas yuav tso zaub mov rau hauv txaj (nrog kev lees paub ntawm RFID thiab qhov ntsuas qhov hnyav). Hauv ntej, tus dev tsuas tau txais zaub mov ntxiv thaum nws nyob ze txaus rau lub txaj thiab thaum lub txaj txaj yuav luag tas. Tau kawg tseem muaj qhov txwv txwv uas koj tuaj yeem teeb tsa koj tus kheej ntawm lub web server; kom tus aub tsis noj zaub mov ntau dhau ib hnub. Qhov ntsuas thib peb yog lub teeb pom kev zoo uas pom lub teeb ci LED thaum nws tsaus ntuj ib ncig ntawm lub txaj. Yog li tus actuator yuav yog lub cav servo txuas nrog lub log hauv lub tshuab xa khoom.
Txoj haujlwm no yog txhais rau cov dev, koj tseem tuaj yeem siv nws rau lwm yam tsiaj me.
Khoom siv
Raspberry Pi 3
Thauj khoom ntawm tes (1KG)
HX711 load cell amplifier
Lub tais zaub mov
Cereal dispenser
Ntoo (+ ntsia hlau thiab ntsia hlau)
Lub teeb sensor
Coj
RFID nyeem ntawv rc522
Jumper xov hlau
16*2 LCD (zaub)
Servo tsav
5V zog adapter
Kev tiv thaiv 470 Ohm
PVC cev
Breadbord
Potentiometer
Pom
Sanding ntawv
Silicon phom
Kauj ruam 1: Pi Teeb
Teeb
Txhawm rau pib peb yuav tsum xub teeb tsa koj Pi.
Koj yuav xav tau ob yam:
- Win32 Disk Imager los ntawm
- Raspbian OS duab los ntawm
Rub tawm ZIP cov ntaub ntawv thiab rho tawm nws mus rau qhov twg koj xav tau.
Kev teeb tsa
1. Xaiv koj cov duab los ntawm daim nplaub tshev icon
2. Xaiv koj daim npav SD ntawm qhov nco tseg
3. Nyem rau sau
Tam sim no peb yuav tsum tau ua qee qhov tinkering ntxiv nrog qee qhov chaw yog li peb yuav tuaj yeem nkag mus rau Pi.
1. Mus rau daim npav SD daim ntawv teev npe khau raj
2. Qhib cov ntawv "cmdline.txt"
3. Ntxiv ip = 169.254.10.1 Thaum kawg ntawm kab ntawv ntev ntawm cov ntawv sib cais nrog ib qho chaw (ntawm kab ib yam).
4. Txuag cov ntawv.
5. Tsim cov ntaub ntawv npe ssh uas tsis muaj kev txuas ntxiv hauv tib phau ntawv
Tam sim no koj tuaj yeem tshem daim npav SD thiab muab tso rau hauv koj Pi.
Txuas
Tam sim no peb yuav tsum teeb tsa software.
Ua ntej txuas rau hauv LAN cable, ib kawg ntawm koj lub desktop/laptop thiab lwm qhov hauv koj Pi.
Tam sim no khau raj Raspberry Pi.
1. Nruab Putty los ntawm
2. Nkag mus rau 169.254.10.1 hauv IP kem.
3. Nco ntsoov xaiv SSH thiab chaw nres nkoj 22 tau sau rau.
4. Nyem qhib
5. Sau tus username: pi
6. Sau tus password: raspberry
Raspi-teeb tsa
Qhib Raspi-teeb tsa kev siv hluav taws xob los ntawm kev siv:
sudo raspi-teeb tsa
Pab kom cov kev xaiv hauv qab no hauv pawg cuam tshuam
- 1-Hlau
- TSI SPI
Lov tes taw cov kev xaiv hauv qab no hauv qeb xaiv khau raj
- Splash npo
Thaum kawg teeb tsa Desktop/CLI teeb tsa hauv qeb xaiv khau raj rau Desktop Autologin.
WiFi
Rau tus dev pub mis peb yuav tsum muaj kev sib txuas wifi yog li ua kom koj muaj koj li ntawv pov thawj wifi kaw.
1. Mus rau hauv paus hom
sudo -i ua
2. Muab kab ntawv no tso tab sis nco ntsoov tias SSID thiab Password tau ob qho tib si sau rau hauv
wpa_passphrase "SSID" "PASSWORD" >> /etc/wpa_supplicant/wpa_supplicant.conf
3. Nkag mus rau WPA Client.
Wpa_cli
4. Xaiv lub interface
Kev sib txuas wlan0
5. Rov ua dua qhov teeb tsa
Rov kho dua
Nco ntsoov tias koj tau txuas nrog raug los ntawm kev ntaus ip a thiab pom yog tias koj muaj IP ntawm WLAN0 cuam tshuam.
Pob
Tam sim no peb tau txuas nrog internet peb yuav tau teeb tsa qee pob khoom.
Ua ntej peb yuav xav tau hloov kho cov npe pob rau qhov tshiab kawg.
sudo apt hloov tshiab
Nab hab sej
Peb yuav yuam Raspbian siv Python 3
hloov kho-lwm txoj hauv kev-nruab/usr/bin/sej python /usr/bin/python2.7 1
hloov kho-lwm txoj kev-nruab/usr/bin/nab nab sej/usr/bin/python3 2
MariaDB
Muab tshuaj txhuam cov kab hauv qab no los teeb tsa lub database.
sudo apt nruab mariadb-server
Tom qab ntawd peb yuav tsum muaj kev ruaj ntseg rau peb kev teeb tsa.
mysql_secure_installation
Nws yuav nug peb rau lo lus zais hauv paus tam sim no vim tias peb tsis muaj ib tus nias nkaus xwb.
Tom ntej no nws nug yog tias peb xav tau lub hauv paus lo lus zais hom hauv y txij li peb xav tau ib tus.
Rau cov lus nug tom ntej no tsuas yog nkag rau Y.
Tom ntej no peb yuav tsim tus neeg siv uas peb yuav siv tau rau daim iav.
Nkag mus rau lub plhaub mysql los ntawm kev ua:
- Txhawb peb tus kheej rau hauv paus
Sudo -ib
- Nkag mus rau lub plhaub mysql
Mysql
- Hloov nrog koj tus kheej lub npe siv thiab zoo ib yam nrog
muab txhua txoj cai rau *. * rau ''@'%' txheeb xyuas los ntawm '';
- muab txhua txoj cai rau *. * rau ''@'%' txheeb xyuas los ntawm '';
Tom ntej no peb yuav ntxiv peb cov ntaub ntawv.
Apache Webserver
Txhawm rau nruab Webserver khiav kab hauv qab no.
sudo apt nruab apache2 -y
Nab hab sej pob
Peb tab tom yuav teeb tsa cov pob khoom no
- Lub hwj
- Flask-Cors
Flask-MySQL
- Flask-SocketIO
- PyMySQL
- Gevent
Gevent-websocket
- Httplib 2
Python-socketio
- Thov
- Wsaccel
- Ua
Los ntawm kev ua
pip nruab Flask Flask-Cors Flask-MySQL Flask-SocketIO PyMySQL gevent gevent-websocket httplib2 python-socketio thov wsaccel ujson mfrc522 hx711 Adafruit-CharLCD
Kauj Ruam 2: Coj thiab Lub Teeb Sensor
Hooking txog tus coj
- S -> GPIO15 (rxd0)
- + -> 5V
- G -> Resistor 470 ohm thiab GND
Hooking li lub teeb sensor
- Tawm -> GPIO17
- VCC -> 3.3V
- GND -> GND
Tam sim no peb tuaj yeem sim yog tias peb coj thiab lub teeb pom kev ua haujlwm nrog tsab ntawv me me no
ntshuam RPi. GPIO li GPIO GPIO.setmode (GPIO. BCM)
GPIO.setup (15, GPIO. OUT)
GPIO.setup (17, GPIO. IN)
sim: thaum Tseeb:
yog GPIO.input (17) == 0:
GPIO.output (15, GPIO. HIGH)
yog GPIO.input (17) == 1:
GPIO.output (15, GPIO. LOW)
tshwj tsis yog KeyboardInterrupt: GPIO.cleanup ()
Kauj Ruam 3: Servo Motor
Hooking li servo motor
- Tawm -> GPIO18
- VCC -> 5V
- GND -> GND
Tam sim no peb tuaj yeem sim yog tias peb coj thiab lub teeb pom kev ua haujlwm nrog tsab ntawv me me no
ntshuam RPi. GPIO ua GPIOimport lub sijhawm
GPIO.setmode (GPIO. BCM)
GPIO.setup (18, GPIO. OUT)
p = GPIO. PWM (18, 50)
p. pib (12.5)
sim:
thaum Muaj Tseeb:
p. ChangeDutyCycle (12.5)
sijhawm.sleep (1)
p. ChangeDutyCycle (2.5)
sijhawm.sleep (1)
tshwj tsis yog KeyboardInterrupt:
p.stop ()
GPIO.cleanup ()
Kauj Ruam 4: RFID Reader RC522
Hooking txog RFID
- RST -> GPIO6
- MISO -> GPIO9 (MISO)
- MOSI -> GPIO10 (MOSI)
- SCK -> GPIO11 (SPISCLK)
- SDA -> GPIO8 (SPICS0)
- 3.3V -> 3.3V
- GND -> GND
Tam sim no peb tuaj yeem sim yog tias peb tus nyeem ntawv RFID ua haujlwm nrog tsab ntawv me me no
ntshuam RPi. GPIO ua GPIO
los ntawm mfrc522 ntshuam SimpleMFRC522
nyeem ntawv = SimpleMFRC522 ()
text = input ('Cov ntaub ntawv tshiab:')
print ("Tam sim no tso koj daim ntawv sau")
nyeem ntawv.write (ntawv nyeem)
print ("Sau")
Kauj Ruam 5: Load Cell HX711
Hooking txog Load cell rau HX711 tus tsav tsheb
- Liab -> E+
- Dub -> E-
- Ntsuab -> A+
- Dawb -> A-
Hooking li Load cell
- DT-> GPIO27
- SCK -> GPIO22
- RED -> 3.3V
- GND -> GND
Tam sim no peb tuaj yeem sim yog tias peb lub cell load ua haujlwm nrog tsab ntawv me me no
ntshuam RPi. GPIO li GPIOimport lub sij hawm ntshuam sys los ntawm klasses. HX711 ntshuam HX711
def cleanAndExit (): print ("Cleaning …") GPIO.cleanup () print ("Bye!") sys.exit ()
hx = HX711 (22, 27)
hx.set_reading_format ("LSB", "MSB")
hx.set_reference_unit (2167)
hx.reset ()
hx.tare ()
thaum Muaj Tseeb:
sim:
val = max (0, int (hx.get_weight (5)))) cov
print (nqi)
hx.power_down ()
hx.power_up ()
sijhawm.s pw (0.5)
tshwj tsis yog (KeyboardInterrupt, SystemExit): cleanAndExit ()
Kauj Ruam 6: LCD (16*2)
Txuas lub LCD
- RS -> GPIO21
- RW -> GND
- E-> GPIO20
- D0 -> GPIO16
- D1 -> GPIO12
- D2 -> GPIO6
- D3 -> GPIO24
- D4 -> GPIO23
- D5 -> GPIO26
- D6 -> GPIO19
- D7 -> GPIO13
- VSS -> GND
- VDD -> 5V
- A -> 5V
- K -> GND
- V0 -> nruab nrab potentio tus pin
Tam sim no peb tuaj yeem sim yog tias peb lub vijtsam LCD ua haujlwm nrog tsab ntawv me me no
ntshuam Adafruit_CharLCD li LCDlcd_rs = 21
lcd_cov = 20
lcd_d4 = 23
lwd_d5 = 26
lcd_d6 = 19
lcd_d7 = 13
lcd_cov = 16
lcd_rows = 2
lcd = LCD. Adafruit_CharLCD (lcd_rs, lcd_en, lcd_d4, lcd_d5, lcd_d6, lcd_d7, lcd_columns, lcd_rows)
lcd.message ('169.254.10.1')
Kauj Ruam 7: Puv Circuit Court
ntawm no koj tuaj yeem tshawb xyuas ntxiv yog tias tag nrho cov Circuit raug
Kauj Ruam 8: Pib Qhov Case
Kuv siv lub tshuab ua pob kws ua pob kws los ua khoom rau dev noj
Kuv txuas lub log hauv lub tshuab xa mus rau kuv lub cav servo
Tam sim no kuv tuaj yeem tswj lub log nrog kuv lub cav servo thiab tso zaub mov tawm ntawm lub pas dej
Qhov kawg ntawm lub pas dej muaj cov raj PVC txuas nrog uas tso cov zaub mov zoo rau hauv txaj
Kuv siv ntoo li casing
Kauj Ruam 9: Muab Nws Ua Ke
Kauj ruam 10: Lub Vev Xaib
Tam sim no peb lub tshuab ua haujlwm peb xav tau lub vev xaib mus rau pi. Tam sim no txhua yam tau nce thiab khiav qee qhov kev qhia ntawm qhov chaw ua haujlwm li cas.
Koj tuaj yeem txuas koj li pi mus rau wifi los ntawm kev ntsaws rau hauv ib qho hdmi cable thiab qhib txoj hauv kev no
Thawj nplooj ntawv yog home page, ntawm no koj tuaj yeem pom:
- Cov lus qhia tiag txog lub teeb
- Cov lus qhia txog lub sijhawm tiag tiag txog cov zaub mov uas tshuav hauv lub tais
- Koj tuaj yeem tso zaub mov tseg
- Cov ntaub ntawv hais txog tus dev
Nplooj ntawv thib ob yog nplooj ntawv kho, ntawm no koj tuaj yeem hloov kho:
- lub npe ntawm koj tus tsiaj
- hnub nyoog ntawm koj tus tsiaj
- qhov hnyav ntawm koj tus tsiaj
- daim duab ntawm koj tus tsiaj
Nplooj ntawv thib peb yog nplooj keeb kwm, ntawm no koj tuaj yeem pom:
- thaum lub teeb tau mus ntxiv
- thaum tus dev tau noj
- thaum cov zaub mov poob lawm
Nplooj ntawv plaub yog nplooj ntawv teeb tsa, ntawm no koj tuaj yeem hloov kho:
- thaum cov zaub mov xav tau poob
- cov zaub mov kom poob
- khoom noj khoom haus/hnub
- lub teeb
Pom zoo:
Tsis Siv Neeg Tshuab Luam Ntawv Tsis Siv Neeg Gumball: 18 Kauj Ruam (nrog Duab)
Tsis Siv Neeg Tshuab Luam Ntawv Tsis Siv Neeg Gumball: Peb tau Ua Kov Tsis Pub Siv Gumball Siv lub micro: me ntsis, Crazy Circuits Bit Board, ntsuas qhov deb, siv servo, thiab duab los qhia. Ua nws thiab siv nws yog "BLAST" "! ? ? Thaum koj tso koj txhais tes rau hauv lub hauv paus ntawm lub foob pob hluav taws, lub ntsuas qhov deb
Tsis siv neeg xab npum Dispenser Siv Arduino: 8 Kauj Ruam
Tsis Siv Neeg Soap Dispenser Siv Arduino: Tsis siv neeg xab npum dispenser siv arduino: Yog li ntawd txiv leej tub zoo siab txais tos rov qab rau kab lus tshiab hauv kab lus no peb yuav ua lub tshuab xab npum Tsis siv neeg siv arduino lub xab npum dispenser no yooj yim heev Ua rau hauv ob peb kauj ruam koj tuaj yeem ua qhov no Tsis siv neeg xab npum dispenser
Tsis Siv Neeg Qhov Muag Tsis Pom Kev Siv EV3: 6 Cov Kauj Ruam
Tsis Siv Neeg Qhov Muag Qhov Muag Siv EV3: Kuv muaj txheej txheej qhov muag tsis pom qhov muag hauv kuv chav pw uas kuv feem ntau tsis hnov qab qhib lossis kaw thaum sawv ntxov lossis yav tsaus ntuj. Kuv xav kom siv qhov qhib thiab kaw, tab sis nrog kev thim rov qab thaum rau thaum twg kuv tab tom hloov pauv
Yooj Yim Tsis Siv Neeg Hloov Neeg Hlau Siv Arduino & L293d IC: 6 Kauj Ruam
Yooj Yim Tsis Siv Neeg Hloov Neeg Hlau Siv Arduino & L293d IC: Nov yog lub hauv paus neeg hlau ua haujlwm los ntawm arduino thiab nws ua dab tsi yog tias nws tsuas yog ncig ib puag ncig thiab ua raws txoj hauv kev ncig los ntawm txoj cai tab sis koj tuaj yeem hloov kho cov cai kom hloov txoj hauv kev yooj yim. Nws yog txoj haujlwm yooj yim uas txhua tus tuaj yeem tsim .. Yog li Yog Koj Ev
Ib qho yooj yim heev/yooj yim/Tsis yooj yim txoj hauv kev kom tib neeg/tib neeg/tsiaj/neeg hlau zoo li lawv muaj txias tiag tiag/Lub zeem muag tshav kub kub (Xim ntawm Koj Xaiv) Siv GIMP: 4 Cov Kauj Ruam
Ib qho yooj yim heev/yooj yim/Tsis yooj yim txoj hauv kev kom tib neeg/tib neeg/tsiaj/neeg hlau zoo li lawv muaj txias tiag tiag/Lub zeem muag tshav kub kub (Xim ntawm Koj Xaiv) Siv GIMP: Nyeem … lub npe