Cov txheej txheem:

Wireless Accelerometer Tswj Rgb-LED's: 4 Cov Kauj Ruam
Wireless Accelerometer Tswj Rgb-LED's: 4 Cov Kauj Ruam

Video: Wireless Accelerometer Tswj Rgb-LED's: 4 Cov Kauj Ruam

Video: Wireless Accelerometer Tswj Rgb-LED's: 4 Cov Kauj Ruam
Video: 100 Coolest NEW Gadgets You Didn't Know Existed! 2024, Kaum ib hlis
Anonim
Wireless Accelerometer Tswj Rgb-LED's
Wireless Accelerometer Tswj Rgb-LED's
Wireless Accelerometer Tswj Rgb-LED's
Wireless Accelerometer Tswj Rgb-LED's

MEMS (Micro-Electro-Mechanical Systems) Accelerometers tau siv dav raws li qaij-ntsuas hauv lub xov tooj ntawm tes thiab lub koob yees duab. Yooj yim accelerometers muaj ob qho tib si raws li ic-chip's thiab pheej yig txhim kho pcb-boards.

Cov chips tsis muaj nqi kuj tseem pheej yig thiab muaj nyob hauv cov kab hluav taws xob sib dhos, nrog cov kav hlau txais xov sib txuas ua ke thiab txiav tawm-lub kaus mom nyob hauv. Hook ob lub wireless board thiab accelerometer nce mus rau microcontroller ntawm serial interface thiab koj muaj lub wireless tswj nrog nintendo-wii ua haujlwm. Tom qab ntawd tsim tus txais nrog tib hom wireless wireless thiab pwm-tswj rgb-LEDs, voila, koj muaj wireless, qaij-tswj xim chav chav xob laim. Khaws cov qib xa mus-qib nrog lub rooj noj mov tig thiab LED yog txias xiav, tsuas yog xiav coj los ua haujlwm. Tom qab ntawd qaij tus xa mus rau hauv ib qho kev qhia thiab koj sib xyaw ua xim liab lossis ntsuab nyob ntawm qhov kev taw qhia koj qaij nws. Qaij txhua txoj kev mus rau 90 degrees, thiab koj mus hla txhua qhov sib xyaw ntawm liab thiab xiav lossis ntsuab thiab xiav kom txog thaum tsuas yog liab lossis ntsuab ua haujlwm ntawm 90 degrees qaij. Qaij me ntsis hauv ob qho kev qhia x thiab y thiab koj tau txais kev sib xyaw ntawm txhua qhov xim. Ntawm 45degrees hauv txhua qhov kev qhia lub teeb yog sib xyaw sib xyaw ntawm liab, ntsuab thiab xiav, ua lwm yam, lub teeb dawb. Cov khoom siv tau muaj los ntawm internet nyiam ua haujlwm-khw muag khoom hluav taws xob. Yuav tsum yog tus cim ntawm qee cov duab.

Kauj Ruam 1: Tshaj Tawm Nrog Accelerometer

Transmitter Nrog Accelerometer
Transmitter Nrog Accelerometer
Transmitter Nrog Accelerometer
Transmitter Nrog Accelerometer
Transmitter Nrog Accelerometer
Transmitter Nrog Accelerometer
Transmitter Nrog Accelerometer
Transmitter Nrog Accelerometer

Tus xa tawm yog ua raws li Atmel avr168 microcontroller. Lub rooj sib tham liab yooj yim nrog 168 yog arduino-board nrog tus tswj hluav taws xob thiab rov pib dua-Circuit. Lub ntsuas hluav taws xob tau txuas nrog avr nrog me ntsis-tsoo lub npav i2c, thiab lub rooj sib tham wireless tau txuas nrog kho vajtse SPI, (Serial Peripheral Interface).

Lub khob cij tau ua tiav tsis siv nrog 4, 8V lub roj teeb ntim rau hauv qab. Lub Rooj Tswjhwm Saib wireless thiab lub arduino wee lees txais txog 9 V thiab muaj onboard linear voltage regulator, tab sis tus ntsuas hluav taws xob xav tau 3, 3V los ntawm txoj kev tsheb nqaj hlau tswj ntawm lub suab.

Kauj Ruam 2: Txais Nrog RGB-LED

Txais Nrog RGB-LED
Txais Nrog RGB-LED
Txais Nrog RGB-LED
Txais Nrog RGB-LED
Txais Nrog RGB-LED
Txais Nrog RGB-LED

Tus Txais Txais yog ua raws atmel avr169 demoboard hu ua npauj npaim. Pawg thawj coj muaj ntau yam tsis siv hauv txoj haujlwm no. Lub wireless tranceiver txuas nrog PortB thiab pwm-tswj coj yog txuas nrog PortD. Lub zog tau muab los ntawm ISP-header, 4.5V txaus. Lub rooj tsav xwm wireless tuaj yeem tiv taus 5V ntawm i/o pins, tab sis xav tau 3.3V cov khoom siv uas tau muab los ntawm tus tswj hwm onboard.

Hloov kho lub taub hau-cable rau rf tranceiver yog qhov yooj yim heev, thiab txuas wireless board nrog lub zog thiab kho vajtse spi maub los ntawm npauj npaim. Shiftbright yog rgb-coj mem tes dav tes taws los piav tswj uas lees txais 4 byte hais kom ua uas tau kaw rau hauv thiab tom qab ntawd kaw tawm ntawm tus pin tso tawm. Yooj yim heev los txuas rau hauv koob. Tsuas yog hloov tawm ntau lo lus txib, thiab thawj qhov kev tawm mus yuav xaus rau qhov kawg txuas nrog LED hauv daisy-saw.

Kauj Ruam 3: C-programming

Cov cai tau sau hauv C vim tias kuv tsis quav ntsej rau kev kawm cov lus "yooj yim dua" ua cov lus uas arduino ua raws. Kuv sau SPI thiab rf tranceiver interface kuv tus kheej rau kev kawm-kev paub, tab sis qiv cov i2c assembler-code los ntawm avrfreaks.net. Lub shiftbright interface yog bitbanged hauv C-code. Ib qho teeb meem uas kuv tau ntsib yog qhov sib txawv me me ntawm qhov sib txawv ntawm qhov ntsuas hluav taws xob-qhov tso tawm, qhov no ua rau lub teeb ci ntau. Kuv daws qhov no nrog software qis-dhau lim. Qhov hnyav hnyav nruab nrab ntawm qhov ntsuas qhov ntsuas qhov ntsuas. Rf-tranceiver txhawb nqa kho vajtse crc thiab ack nrog pib rov xa tawm, tab sis rau txoj haujlwm no lub sijhawm tiag tiag, hloov kho tshiab ntawm cov leds tseem ceeb dua. Txhua pob ntawv nrog tus ntsuas qhov ntsuas tsis tas yuav tsum tuaj txog ntawm tus txais, tsuav yog cov pob ntawv tsis zoo raug muab pov tseg. Kuv tsis muaj teeb meem nrog poob RF pob ntawv tsis pub dhau 20 meters kab pom. Tab sis txuas ntxiv qhov txuas txuas tsis ruaj khov, thiab cov leds tsis hloov tshiab tas li. Lub ntsiab lus tseem ceeb ntawm tus xa tawm hauv pseudo-code: pib (); thaum (tseeb) {Qhov muaj txiaj ntsig = abs (tau x, y, z qhov ntsuas qhov ntsuas qhov tseem ceeb))); RF_send (Qhov tseem ceeb); ncua (20ms);} Lub ntsiab voj ntawm tus txais hauv pseudo-code: initialize (); thaum (tseeb) {newValues = blocking_receiveRF ()); rgbValues = rgbValues + 0.2*(newValues-rgbValues); sau rgbValues rau shiftbrigth;}

Kauj Ruam 4: Qhov tshwm sim

Qhov tshwm sim
Qhov tshwm sim
Qhov tshwm sim
Qhov tshwm sim
Qhov tshwm sim
Qhov tshwm sim
Qhov tshwm sim
Qhov tshwm sim

Kuv xav tsis thoob tias qhov kev tswj tau zoo thiab raug li cas. Koj yeej muaj ntsis ntiv tes kom raug tswj cov xim. Pwm-LED-maub los muaj 10 qhov kev daws teeb meem rau txhua xim, uas ua rau ntau lab ntawm cov xim muaj peev xwm. Hmoov tsis tus accelerometer tsuas muaj 8 qhov kev daws teeb meem uas coj tus lej ntawm cov xim theoretical mus rau ntau txhiab. Tab sis nws tseem tsis tuaj yeem pom tias muaj kev hloov pauv xim. Kuv muab tus txais rau hauv IKEA-teeb thiab nqa daim duab ntawm cov xim sib txawv hauv qab no. Kuj tseem muaj cov vis dis aus, (zoo li phem heev)

Pom zoo: