Orodha ya maudhui:

Taa ya ujio na Uhuishaji wa POV: Hatua 7
Taa ya ujio na Uhuishaji wa POV: Hatua 7

Video: Taa ya ujio na Uhuishaji wa POV: Hatua 7

Video: Taa ya ujio na Uhuishaji wa POV: Hatua 7
Video: Раскрываю секрет вкусного шашлыка от А до Я. Шашлык из баранины 2024, Novemba
Anonim
Image
Image

Kuendelea kwa Miradi (POV) iko karibu kwa muda mrefu, vifaa rahisi na vya bei rahisi vya DIY vinapatikana hata kwa ununuzi mkondoni. POV inategemea udanganyifu wa macho ambapo tunaona vitu vilivyoangaziwa baada ya kitu hakiangazwe tena hata kama kwa muda mfupi tu. Miradi ya jadi ya POV bado ina picha kulingana na kanuni hii au saa zinazoendesha zaidi. Walakini, hakuna chochote kinachozuia uhuishaji wa mradi kwa kutumia wadhibiti wadogo wa saa za kutosha na mwangaza wa RGB za LED. Uhuishaji huu ni wa mwamba wa Krismasi ulioburuzwa kwa reindeer kwa mapambo ya Ujio ambayo inaweza kudhibitiwa kwa mbali na kifaa chochote cha rununu cha WiFi kilicho na kivinjari cha wavuti. Taa hiyo inaendeshwa na Wemos ESP8266 D1 Mini microcontroller wa familia ya Arduino. Sifa ya fremu za michoro ya reindeer yenye michoro 8-bit inaenda kwa msanii mahiri wa picha Richard Fenyo.

Hatua ya 1: Orodha ya Sehemu

Hatua za Bunge
Hatua za Bunge

Utahitaji kesi kwa mradi huu ambao ni mzito wa kutosha kuweka kitengo kinachozunguka bila kudondoshwa. Kesi ya zamani ya PSU ni kamilifu, kuwa mwangalifu tuache capacitors itoe kabla ya kutenganishwa. Utahitaji pia aina yoyote ya adapta ya umeme ya 5V-12V kwa kuwezesha umeme wa DC. Kweli ujazo wowote kutoka 500mA na hapo juu utafanya hivyo.

Sehemu zinazohitajika zimeorodheshwa hapa chini na viungo vya wavuti na bei za sasa.

  • 2pcs 18650 Betri, USD 4, 78
  • Mmiliki wa Battery kwa 2x18650, USD 0, 63
  • Wemos D1 Mini, USD 2, 14
  • Nyasi Nyeusi, USD 0, 10
  • Sensorer ya kutafakari ya infrared, USD 0, 38
  • Kubadilisha Rocker ya 250V, USD 0, 10
  • Geuza Kubadilisha Slide, USD 0, 02
  • 6-900rpm DC Motor, USD 3, 99
  • Adafruit Neopixel WS2812 8-bit, USD 1, 01

Gharama ya jumla ni chini ya Dola za Kimarekani 15, - lakini utahitaji pia zana kadhaa za mikono, kuchimba visima, gundi moto, pamoja na vifaa vya uuzaji na ustadi.

Hatua ya 2: Hatua za Bunge

Kitengo kinaweza kukusanywa kikamilifu kufuatia hatua hizi.

  1. Kituo cha stationary kimejengwa na motor DC na switch.
  2. Neopixels zinauzwa na kushikamana na shimoni la majani.
  3. Rig inayozunguka imejengwa na microcontroller, switch switch, infra sensor, na shimoni la majani.
  4. Wiring inauzwa kwenye viunganisho vya sehemu za umeme
  5. Nambari ya Arduino imepakiwa kwa mdhibiti mdogo wa Wemos.

Hatua ya 3: 1. Kituo cha stationary na DC Motor

1. Kituo cha stationary na DC Motor
1. Kituo cha stationary na DC Motor
1. Kituo cha stationary na DC Motor
1. Kituo cha stationary na DC Motor
1. Kituo cha stationary na DC Motor
1. Kituo cha stationary na DC Motor
  1. Piga shimo kwenye kasha na urekebishe DC motor ili shimoni ielekee juu.
  2. Solder swichi ya nguvu ya mwamba na adapta ya umeme ya kawaida ya 5V-12V kufuatia mchoro wa wiring hapa chini.
  3. Magari yaliyotajwa ya DC yanazunguka karibu 800 RPM (mizunguko kwa dakika) saa 12V, na kusababisha karibu 10 FPS (muafaka kwa sekunde) katika usanidi wa mwisho kulingana na upinzani halisi wa upepo wa shimoni la majani.
  4. Unganisha adapta ya usambazaji wa umeme kwa duka (110 au 220V).
  5. Washa mwamba na uangalie kazi ya motor DC.

Ifuatayo, mkanda wa kupokezana utakusanywa na kuwekwa kwenye shimoni la DC la msingi.

Hatua ya 4: 2. Kiambatisho cha Neopikseli

2. Kiambatisho cha Neopikseli
2. Kiambatisho cha Neopikseli
2. Kiambatisho cha Neopikseli
2. Kiambatisho cha Neopikseli
  1. Kata mwisho wa majani katika pande mbili zinazopingana kwa mwisho mmoja kwa karibu 1.5 cm kama picha inavyoonyesha.
  2. Lace waya tatu ndefu juu ya majani. Hizi zitaunganisha pini za Neopixel kwenye bandari za Wemos kwenye rig.
  3. Weka waya tatu kwenye pini za Neopixel GND, 5V na D-IN.
  4. Gundi moto waya nadhifu na nadhifu kutoka kwa Neopixels zilizouzwa huisha hadi katikati kabisa ya bar ya LED.
  5. Vuta mabawa yaliyokatwa ya majani na uwaunganishe kwa moto kwa ulinganifu halisi kwenye kituo cha bar ya LED (juu ya waya upande mmoja).
  6. Waya hupitia ndani ya majani hadi kwenye rig ili kufikia bandari zinazofanana za Wemos.

Hatua ya 5: 3. Mkutano wa Mbio Inayozunguka

3. Mkutano wa Mzunguko Mzunguko
3. Mkutano wa Mzunguko Mzunguko

Rig nzima inapaswa kukusanywa kabisa kabla ya kurekebisha shimoni la DC. Hiyo ni kwa sababu mahali pa kurekebisha inahitaji kusawazishwa ili mzunguko uwe katikati kabisa bila kutetereka.

  1. Gundi moto moto Wemos D1 Mini microcontroller na swichi ya slaidi upande mmoja wa mmiliki wa betri kama picha inavyoonyesha.
  2. Moto gundi sensor ya kutafakari infra kwa upande mwingine wa mmiliki wa betri.
  3. Weka betri kwenye kishikiliaji.
  4. Weka na funga ncha nyingine ya majani juu ya betri. Screw ndogo au pete ya mpira itaifanya. Hakikisha kwamba haitapotea mara tu rig itaanza kuzunguka saa 10 RPM.
  5. Pata kituo cha rigs nzima cha mvuto upande wa chini. Kusawazisha kwenye ncha ya kidole chako kuifanya.
  6. Fanya shimo ndogo mahali penye chini kabisa ya mmiliki wa betri.
  7. Tumia gundi moto na urekebishe shimoni la motor kwenye shimo hilo. Hakikisha kwamba gundi ya moto haiingii kwenye mwili wa motor. Weka kwa utulivu mpaka gundi itakauka.
  8. Kata kipande kidogo cha karatasi nyeupe na uweke mkanda kwenye kituo cha stationary kama kwamba sensor ya kutafakari ya infrared inageuka karibu na karatasi hiyo. Hii itasababisha kuchora kwa muafaka wa uhuishaji mahali halisi katika kila mzunguko. Picha inaonyesha kipande hiki cha kutafakari kwenye kona ya kushoto ya chini ya msingi.

Hatua ya 6: 4. Wiring wa Vipengele vya Umeme

4. Wiring ya Vipengele vya Umeme
4. Wiring ya Vipengele vya Umeme

Kufuatia mchoro wa wiring, solder vifaa vya umeme katika hatua zifuatazo. Kumbuka kuwa bandari hiyo hiyo ya Wemos D1 Mini microcontroller itauzwa mara nyingi na waya anuwai tofauti. Hiyo inachukua mazoezi kadhaa, au unganisha waya hizi ukitayarisha kabla ya kuingiza kwenye bandari ya Wemos.

  1. Waya tatu (GND, 5V na D-IN) zinauzwa kwenye bandari za Wemos G, 5V, na D3 mtawaliwa.
  2. Waya mbili kutoka kwa Sensor ya Kutafakari ya infrared (VCC, GND, OUT) inauzwa kwenye bandari za Wemos 5V, G, na D2 mtawaliwa.
  3. Waya ya mmiliki wa betri (Nyeusi) inauzwa kwenye bandari ya Wemos G.
  4. Wamiliki wa betri chanya (Nyekundu) waya inauzwa kwenye pini ya karibu zaidi ya swichi ya slaidi.
  5. Bandari ya Wemos 5V inauzwa kwenye pini nyingine ya swichi ya slaidi.

Hatua ya 7: 5. Msimbo wa Arduino

5. Msimbo wa Arduino
5. Msimbo wa Arduino

Nambari hii maalum ni ya toleo la bits 24 za Taa ya POV, inaweza kudhibitiwa kwa mbali na vifaa vyovyote vya rununu na vivinjari vya wavuti na inaangazia athari kama Ramani ya Dunia, Athari ya Uhuishaji ya Matrix, na uhuishaji wa Reindeer Sleight. Jisikie huru kurekebisha idadi ya saizi, vigezo vya athari, au kiolesura cha mbali cha WiFi kwa mahitaji yako kwenye nambari ya chanzo.

// 24 bits POV Taa - 2019 Peter Csurgay

# pamoja na ESP8266WiFiMulti.h

# pamoja na mteja wa WiFi.h # pamoja na ESP8266WebServer.h # pamoja na WebSocketServer.h # pamoja na Adafruit_NeoPixel.h

#fafanua DEBUG 1

Nakala ya kamba [3] = {"INSTRUCTABLES", "ARDUINO", "CONTEST"};

palette ya const uint8_t [8] [3] = {

{0, 0, 0}, // 0 - Uwazi {0, 0, 127}, // 1 - Bluu {127, 0, 0}, // 2 - Nyekundu {127, 127, 0}, // 3 - Njano {0, 127, 0}, // 4 - Kijani {127, 24, 0}, // 5 - Chungwa {127, 0, 127}, // 6 - Magenta {127, 127, 127} // 7 - Nyeupe};

const unsigned char world [24] [42] PROGMEM =

{ { 0, 0, 0, 1, 1, 1, 1, 1, 1, 0, 0, 1, 0, 0, 1, 1, 0, 0, 0, 0, 0, 1, 1, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0 }, { 0, 0, 1, 1, 1, 1, 1, 1, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 0, 0, 0, 0 }, { 0, 0, 1, 1, 1, 1, 1, 1, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0 }, { 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0 }, { 0, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0 }, { 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0 }, { 1, 1, 1, 1, 1, 1, 1, 0,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0, 1, 0, 0, 0, 1, 0, 0, 0, 0 }, { 0, 0, 1, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0 }, { 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0 } } };

#fafanua INFRATRIGGER_PIN D2

#fafanua NEOPIXELS_PIN D3 #fafanua NEO_NUMPIXELS 24

Saizi za Adafruit_NeoPixel = Adafruit_NeoPixel (NEO_NUMPIXELS, NEOPIXELS_PIN, NEO_GRB + NEO_KHZ800);

Anwani ya IPP anwani ya anwani;

Anwani ya IPAdressress; Seva ya WiFiServer (80); WebSocketServer webSocket = WebSocketServer (81); turubai ya uint8_t [24] [65]; uint8_t ushirikiano = 0; eneo la uint8_t = 0; uint8_t numScenes = 5; Matukio ya kamba [6] = {"ULIMWENGU", "SANTA", "PEPPER", "TEXT", "MATRIX"}; uint8_t zunguka = 1; nambari za uint8_t = 0; // Nambari ya MATRIX ya mistari inayoanguka uint8_t wiki [64] [2]; // MATRIX bila mpangilio pos x na y ya mistari inayoanguka

usanidi batili () {

ikiwa (DEBUG) {Serial.begin (9600); Serial.println ("Anza…"); } kuchelewa (3000);

ESP8266WiFiMulti wifiMulti;

wifiMulti.addAP ("wifissid", "pwd"); wifiMulti.addAP ("mobilessid", "pwd"); wifiMulti.addAP ("laptopssid", "pwd"); ikiwa (DEBUG) Serial.print ("Kituo cha Kuunganisha kwa"); wakati (wifiMulti.run ()! = WL_CONNECTED) {kuchelewesha (1000); ikiwa (DEBUG) Serial.print ("."); } ikiwa (DEBUG) Serial.println (""); ikiwa (DEBUG) Serial.print ("WiFi imeunganishwa: SSID ="); ikiwa (DEBUG) Serial.println (WiFi. SSID ()); anwaniIPaddress = WiFi.localIP (); ikiwa (DEBUG) Serial.print ("Anwani ya IP ya Kituo cha Mitaa:"); ikiwa (DEBUG) Serial.println (localIPaddress);

anza ();

ikiwa (DEBUG) Serial.println ("Server (80) ilianza"); webSocket.begin (); WebSocket.onEvent (webSocketEvent); ikiwa (DEBUG) Serial.println ("WebSocket (81) ilianza"); uint8_t coli = 0; kwa (int i = 0; i <24; i ++) {kwa (int j = 0; j <64; j ++) {canvas [j] = coli ++; coli = coli% 7; } turubai [64] = 0; } pinMode (INFRATRIGGER_PIN, INPUT); ambatishaKukatiza (digitalPinToInterrupt (INFRATRIGGER_PIN), rangi, KUPANDA); saizi. anza (); saizi. onyesha (); ikiwa (DEBUG) {Serial.print ("Neopixel imeanza, NUMPIXELS:"); Serial.println (saizi.numPixels ()); }}

utupu wa WebSocketEvent (uint8_t num, WStype_t type, uint8_t * payload, size_t length) {

ikiwa (aina == WStype_TEXT) {Kamba req = Kamba ((const char *) malipo ya malipo); ikiwa (DEBUG) {Serial.print ("81 Req:"); Serial.println (req); } mchakatoReq (req); }}

Kamba rip2 (Kamba s) {

Kamba res; int i = 0; wakati (s ! = '/') i ++; i ++; wakati (s ! = '/') i ++; i ++; wakati (s ! = '/' && s ! = "&& s ! = '\ r' && s ! = '\ n') res + = s [i ++]; kurudi res; }

mchakato batiliReq (String req) {

ikiwa (req.indexOf ("/ rotate")! = -1) {rotate = 1; } kingine ikiwa (req.indexOf ("/ scene")! = -1) {rotate = 0; Kamba sc = rip2 (req); ikiwa (isDigit (sc [0])) eneo = sc.toInt (); mwingine {eneo = 0; kwa (int i = 0; i

kitanzi batili () {

WebSocket.loop (); Mteja wa Wateja wa WiFi = seva haipatikani (); ikiwa (! mteja) {kurudi; } Kamba req = mteja.readStringUntil ('\ r'); ikiwa (DEBUG) {Serial.print ("80 Req:"); Serial.println (req); } mchakatoReq (req);

mteja.flush ();

Kamba s = "HTTP / 1.1 200 sawa / r / n Aina ya Yaliyomo: maandishi / html; charset = UTF-8 / r / nFikia-Udhibiti-Ruhusu-Vichwa vya habari: Aina ya Maudhui / r / n Ufikiaji-Udhibiti-Ruhusu-Asili: * / r / nUunganisho: funga / r / n / r / n "; s + = "localIP:" + ipToString (localIPaddress) + ""; s + = "apIP:" + ipToString (apIPaddress) + ""; alama za mteja; kuchelewesha (100); mteja.acha (); }

rangi batili () {

kwa (int i = 0; i <65; i ++) {kwa (int j = 0; j <24; j ++) {unsigned char ind = canvas [j] ; saizi.setPixelColor (j, saizi. Color (palette [ind] [0], palette [ind] [1], palette [ind] [2])); saizi. onyesha (); kuchelewesha Microsconds (10); } ushirikiano = (ushirikiano + 1)% 40; ikiwa (zunguka) {ikiwa (co == 0) {eneo = (eneo + 1)% numScenes; ikiwa (DEBUG) {Serial.print ("Onyesho:"); Serial.println (eneo); }} ikiwa (co == 0) mzigoCanvas (pazia [eneo]); } ikiwa (pazia [eneo].indexOf ("SANTA")! = -1) {for (int i = 0; i <8; i ++) ya (int j = 0; j = co && j

tupu mzigoCanvas (Kamba nini) {

waziCanvas (); ikiwa (DEBUG) {Serial.print ("loadCanvas:"); Serial.println (nini); } ikiwa (what.indexOf ("TEXT")! = -1) {for (int l = 0; l <3; l ++) for (int n = 0; n = 12 && j <51) canvas [j] = pgm_read_byte_near (pilipili + j-12); } kingine ikiwa (what.indexOf ("WORLD")! = -1) {for (int i = 0; i <24; i ++) ya (int j = 0; j = 11 && j <53) canvas [j] = pgm_read_byte_near (ulimwengu + j-11); }}

batili clearCanvas () {

ikiwa (DEBUG) Serial.println ("clearCanvas"); kwa (int i = 0; i <24; i ++) kwa (int j = 0; j <65; j ++) canvas [j] = 0; }

Kamba ipToString (IPAddress ip) {

Kamba s = ""; kwa (int i = 0; i <4; i ++) s + = i? "." + Kamba (ip ): Kamba (ip ); kurudi s; }

Ilipendekeza: