Cov txheej txheem:

Mood Projector (Hacked Philips Hawj Teeb Nrog GSR) TfCD: 7 Cov Kauj Ruam (nrog Duab)
Mood Projector (Hacked Philips Hawj Teeb Nrog GSR) TfCD: 7 Cov Kauj Ruam (nrog Duab)

Video: Mood Projector (Hacked Philips Hawj Teeb Nrog GSR) TfCD: 7 Cov Kauj Ruam (nrog Duab)

Video: Mood Projector (Hacked Philips Hawj Teeb Nrog GSR) TfCD: 7 Cov Kauj Ruam (nrog Duab)
Video: Night 2024, Hlis ntuj nqeg
Anonim
Image
Image
Sib nrug ntawm Hue Light
Sib nrug ntawm Hue Light

Los ntawm Laura Ahsmann & Maaike Weber

Lub Hom Phiaj: Tsawg kev xav thiab kev ntxhov siab yog ib feem loj ntawm lub neej niaj hnub nrawm nrawm. Nws tseem yog ib yam uas pom tsis tau rau sab nraud. Yuav ua li cas yog tias peb muaj peev xwm ua tau ob lub qhov muag thiab qhov muag pom peb qhov kev nyuaj siab nrog cov khoom lag luam, kom tuaj yeem qhia koj li cas. Nws yuav ua rau koj yooj yim dua tham nrog cov teeb meem no. Koj tus kheej cov tshuaj tiv thaiv kuj tseem tuaj yeem tsim nyog rau lub sijhawm thaum tau txais kev tawm tswv yim ntawm koj cov qib kev nyuaj siab.

GSR, lossis cov tawv nqaij tiv taus tawv nqaij, ntsuas ntsuas ntawm tus ntiv tes ntawm tus neeg siv, tau ua pov thawj los ua qhov twv ua ntej tiag tiag ntawm kev ntxhov siab. Txij li cov sweatglands hauv txhais tes feem ntau ua rau muaj kev nyuab siab (tsis yog kev tawm dag zog lub cev), cov kev nyuaj siab ntau ntxiv ua rau muaj kev coj ua siab dua. Qhov kev hloov pauv no tau siv hauv txoj haujlwm no.

Lub tswv yim: Yuav ua li cas yog tias peb tuaj yeem txheeb xyuas qhov kev ntxhov siab lossis kev xav sai thiab sawv cev nws nrog lub teeb xim thiab suab paj nruag? Ib qhov system GSR tuaj yeem ua qhov ntawd tshwm sim. Hauv Cov Lus Qhia no, peb yuav ua Arduino raws qhov system los ua qhov ntawd! Ua haujlwm los ntawm ob qho tib si Arduino Software thiab Ua Haujlwm Software, nws yuav txhais cov kev coj ua ntawm daim tawv nqaij mus rau qee lub teeb xim thiab qee yam suab paj nruag.

Koj xav tau dab tsi?

  • Arduino Ib
  • Hlau
  • Philips Hawj txawm lub teeb (Nyob Xim)
  • Peb 100 Ohm resistors (rau RGB LED)
  • Ib 100 KOhm resistor (rau GSR sensor)
  • Ib yam dab tsi los ua tus ntsuas hluav taws xob, zoo li txhuas ntawv ci
  • Arduino Software
  • Ua Software (peb siv v2.2.1, cov tshiab yuav zoo li tsoo)
  • SolidWorks, los tsim lub tsev nyob (xaiv tau)
  • Nkag mus rau CNC zeb (yeem)
  • Ntsuab qauv ua npuas ncauj (EPS)
  • Breadboard (xaiv tau, kuj tseem tuaj yeem siv tau)

Kauj Ruam 1: Tshem Tawm Hue Light

Cov kauj ruam no yooj yim, tsuas yog siv qee qhov quab yuam (lossis tus ntswj taub hau) cia poob thiab tawg qhib lub teeb. Qee qhov kev sib txuas snap tuav cov khoom ua ke, yog li nws yooj yim los sib nrug.

Tam sim no, lub teeb nyob rau sab saum toj tuaj yeem tshem tawm thiab txuas nrog los ntawm cov khoom siv hluav taws xob tas li. Peb tsuas xav tau lub teeb ci thiab lub tsev nyob saum toj. Txuag lossis pov tseg, nws nyob ntawm koj!

Kauj Ruam 2: Npaj Kho Vajtse

Npaj Kho Vajtse
Npaj Kho Vajtse
Npaj Kho Vajtse
Npaj Kho Vajtse
Npaj Kho Vajtse
Npaj Kho Vajtse
Npaj Kho Vajtse
Npaj Kho Vajtse

Rau qhov haujlwm no, peb tau siv lub teeb Philips Hawj txawm, los ua kom lub cev zoo nkauj dua thiab sai dua. Txawm li cas los xij koj tseem tuaj yeem siv ib txwm RGB LED, raws li qhia hauv daim duab nrog lub khob cij.

Txhawm rau ua haujlwm RGB LED, txuas cov pins rau peb qhov sib txawv PWM chaw nres nkoj ntawm Arduino (qhia tsis yog ~). Siv 100Ohm resistors rau qhov txuas no. Txuas tus pin ntev tshaj plaws rau 5V tso tawm ntawm Arduino. Txhawm rau pom tus pin sib raug rau cov xim twg, saib daim duab kawg ntawm cov kauj ruam no.

Rau Hue Light, tib cov kauj ruam mus. LED tau txuas nrog Arduino tau yooj yim los ntawm kev xaim hluav taws xob txuas rau qhov chaw xaiv, saib daim duab thib peb hauv qib no. Cov qhov qhib muaj R, G thiab B, qhia tias cov hlau yuav tsum mus qhov twg. Nws kuj tseem muaj + thiab a - qhov, kom txuas nrog 5V ntawm Arduino thiab hauv av ntawm Arduino, feem. Thaum koj txuas tus LED, koj tuaj yeem ntsia hlau rov qab rau hauv tsev.

Txhawm rau txuas tus GSR lub ntsuas hluav taws xob, ua los ntawm cov ntawv ci txhuas (lossis siv cov ntim alumium ntawm tealights, uas zoo li me ntsis zoo dua), muab tshuaj txhuam lossis kaw lawv rau xaim thiab txuas ib qho rau 5V. Txuas lwm tus mus rau tus tiv thaiv ntawm 100KOhm thiab lub peev xwm ntawm 0, 1mF (sib luag), uas yuav tsum txuas nrog rau hauv av thiab A1 qhov ntawm Arduino. Qhov no yuav muab cov txiaj ntsig ntawm qib kev nyuab siab, uas tom qab ntawd yuav siv los ua cov tswv yim rau lub teeb xim thiab suab paj nruag. Peb kaw lub ntsuas hluav taws xob rau lub teeb, yog li nws dhau los ua cov khoom lag luam zoo rau thaum ntsuas koj qhov kev ntxhov siab. Ceev faj txawm li cas los xij uas cov sensors tsis kov!

Daim duab kawg qhia yuav ua li cas nws tuaj yeem ua yam tsis muaj lub khob cij.

Kauj Ruam 3: Ntsuas Kev Nyuaj Siab

Ntsuas Stresslevel
Ntsuas Stresslevel

Ntsuas qhov kev nyuab siab nrog tsuas yog cov ntsuas hauv tsev no yuav tsis muab qhov ntsuas tseeb ntawm qhov kev nyuab siab koj raws nraim. Txawm li cas los xij, thaum ntsuas tau raug, nws tuaj yeem kwv yees kwv yees.

Txhawm rau ntsuas GSR qib, peb yuav siv cov lej hauv qab no, hauv Arduino ib puag ncig. Txhawm rau kom ntsuas qhov hloov pauv tsawg dua, ib qho avatar tau ua txhua 10 nyeem.

const int numReadings = 10; int nyeem [numReadings]; // tawm tswv yim los ntawm A1 int index = 0; // qhov ntsuas ntawm kev nyeem tam sim no int tag nrho = 0; // qhov khiav tag nrho tsis tau kos npe ntev nruab nrab = 0; // ua avg

int inputPin = A1;

tsis muaj dabtsis teeb tsa GSR ()

{// teeb tsa txhua qhov nyeem rau 0:

rau (int i = 0; kuv <numReadings; i ++) nyeem = 0; }

unsigned ntev khiav GSR () {

tag nrho = tag nrho - nyeem [index]; // nyeem los ntawm GSR sensor nyeem [index] = analogRead (inputPin); // ntxiv kev nyeem ntawv tshiab rau tag nrho tag nrho = tag nrho + nyeem [index]; // txoj hauj lwm tom ntej ntawm array index = index + 1;

// xeem kawg ntawm array

yog (index> = numReadings) // thiab pib dua qhov ntsuas = 0;

// dab tsi yog avg

nruab nrab = tag nrho / numReadings; // xa nws mus rau lub khoos phis tawj raws li ASCII tus lej rov qab nruab nrab;

}

Hauv lwm lub tab (kom khaws cov khoom sib koom ua ke), peb yuav ua tus cai kom ua raws li qhov ntsuas, saib cov kauj ruam tom ntej!

Kauj Ruam 4: Tswj Lub Teeb

Kev Tswj Teeb
Kev Tswj Teeb
Kev Tswj Teeb
Kev Tswj Teeb
Kev Tswj Teeb
Kev Tswj Teeb

Txhawm rau tswj cov teeb, peb yuav tsum xub ntsuas qhov ntsuas. Txheeb xyuas dab tsi qhov kev txwv qis yog rau koj qhov kev ntsuas los ntawm kev qhib lub ntsuas saib. Rau peb qhov kev ntsuas yog qee yam hauv nruab nrab ntawm 150 (thaum peb tau sim so kom txaus) thiab 300 (thaum peb sim tiag tiag ua rau muaj kev nyuab siab).

Tom qab ntawd, txiav txim siab tias xim twg yuav tsum sawv cev rau qib siab. Peb tau ua nws kom:

1. Tsawg stresslevel: lub teeb dawb, hloov mus rau lub teeb ntsuab nrog kev nce kev ntxhov siab

2. Nruab nrab stresslevel: lub teeb ntsuab, hloov mus rau hauv lub teeb xiav nrog nce kev ntxhov siab

3. High stresslevel: lub teeb xiav, hloov mus rau liab nrog kev ntxhov siab ntxiv

Cov cai hauv qab no tau siv los ua cov kev ntsuas thiab hloov lawv mus rau qhov muaj txiaj ntsig xa mus rau LED:

// MASTER #define DEBUG 0

GSR = A1

int gsrVal = 0; // Hloov pauv los khaws cov tswv yim los ntawm cov ntsuas

// Raws li tau hais, siv Pulse-width Modulation (PWM) pins

int redPin = 9; // Liab LED, txuas nrog tus lej digital 9 int grnPin = 9; // Ntsuab LED, txuas nrog tus lej digital 10 int bluPin = 5; // Xiav LED, txuas nrog tus lej digital 11

// Program hloov pauv

int redVal = 0; // Variables khaws cov txiaj ntsig xa mus rau tus pin int grnVal = 0; int bluVal = 0;

unsigned ntev gsr = 0;

void teeb tsa ()

{pinMode (bluPin, OUTPUT); tus pinMode (grnPin, OUTPUT); pinMode (redPin, OUTPUT); pinMode (A1, INPUT);

Serial.begin (9600);

teeb tsa GSR (); }

void lub voj ()

{gsrVal = gsr; yog (gsrVal <150) // Qhov qis tshaj thib peb ntawm gsr ntau (0-149) {gsr = (gsrVal /10) * 17; // Normalize rau 0-255 redVal = gsrVal; // tawm rau tag nrho grnVal = gsrVal; // Ntsuab los tawm rau puv bluVal = gsrVal; // Xiav tawm kom puvTxoj hlua SoundA = "A"; Serial.println (SoundA); // rau siv tom qab hauv kev siv suab paj nruag} lwm yog (gsrVal <250) // Nruab nrab thib peb ntawm gsr ntau (150-249) {gsrVal = ((gsrVal-250) /10) * 17; // Normalize rau 0-255 redVal = 1; // Liab tawm grnVal = gsrVal; // Ntsuab los ntawm puv rau bluVal = 256 - gsrVal; // Xiav tawm ntawm tag nrho txoj hlua SoundB = "B"; Serial.println (SoundB); } lwm // Upper thib peb ntawm gsr ntau (250-300) {gsrVal = ((gsrVal-301) /10) * 17; // Normalize rau 0-255 redVal = gsrVal; // Liab tawm ntawm tag nrho grnVal = 1; // Ntsuab tawm kom puv bluVal = 256 - gsrVal; // Xiav los ntawm tag nrho mus rau txoj hlua SoundC = "C"; Serial.println (SoundC); }

analogWrite (redPin, redVal); // Sau qhov tseem ceeb rau LED pins analogWrite (grnPin, grnVal); analogWrite (bluPin, bluVal); gsr = runGSR (); ncua (100); }

Yog li tam sim no LED tau ua rau koj qhov kev nyuab siab, cia ntxiv qee cov nkauj los sawv cev rau koj txoj kev xav, hauv qib tom ntej.

Kauj ruam 5: Tswj Music

Tswj lub Suab Nkauj
Tswj lub Suab Nkauj

Peb tau xaiv los sawv cev rau 3 qib kev nyuaj siab nrog cov nkauj hauv qab no:

1. Qib qis (A): hu nkauj tais thiab noog quaj, suab nrov heev

2. Qib nruab nrab (B): suab paj nruag melancholic, lub suab hnyav dua me ntsis

3. Qib kev ntxhov siab (C): Cua daj cua dub, lub suab tsaus ntuj (txawm hais tias so heev)

Cov cai tau sau hauv Kev Ua, software los muab cov software tawm tswv yim ib feem ntawm Arduino:

ntshuam ua tiav.serial.*; ntshuam ddf.minim.*;

Yam tsawg kawg nkaus;

AudioPlayer cov neeg ua si;

int lf = 10; // Linefeed hauv ASCII

Txoj hlua myString = tsis muaj; Serial myPort; // Qhov chaw nres nkoj serial int sensorValue = 0;

void teeb tsa () {

// Sau tag nrho cov muaj nyob hauv cov chaw nres nkoj printArray (Serial.list ()); // Qhib qhov chaw nres nkoj koj siv ntawm tus nqi ib yam li Arduino myPort = Serial tshiab (qhov no, Serial.list () [2], 9600); myPort.clear (); // ntsuas qhov tseeb myString = myPort.readStringUntil (lf); myString = tsis muaj; // peb dhau qhov no rau Minim kom nws tuaj yeem thauj cov ntaub ntawv minim = Minim tshiab (qhov no); players = tshiab AudioPlayer [3]; // Hloov lub npe ntawm cov ntaub ntawv audio ntawm no thiab ntxiv rau cov tsev qiv ntawv [0] = minim.loadFile ("Hu nkauj-tais-thiab-noog-chirping-pw tsaug zog-music.mp3"); players [1] = minim.loadFile ("Melancholic-piano-music.mp3"); players [2] = minim.loadFile ("Storm-sound.mp3"); }

void kos () {

// kos yog tias muaj tus nqi tshiab thaum (myPort.available ()> 0) {// khaws cov ntaub ntawv hauv myString myString = myPort.readString (); // kos yog tias peb muaj qee yam tiag yog (myString! = tsis muaj) {myString = myString.trim (); // kos yog tias muaj qee yam yog (myString.length ()> 0) {println (myString); sim {sensorValue = Integer.parseInt (myString); } ntes (Kev zam e) {} yog (myString.equals ("A")) // pom dab tsi qhov kev nyuab siab nws ntsuas {players [0].play (); // ua si raws suab paj nruag} lwm {players [0].pause (); // yog tias nws tsis ntsuas qib kev ntxhov siab tsawg, tsis txhob ua raws txoj nkauj} yog (myString.equals ("B")) {players [1].play (); } lwm tus {players [1].pause (); } yog (myString.equals ("C")) {players [2].play (); } lwm {players [2].pause (); }

Txoj cai no yuav tsum ua suab paj nruag raws li qib kev nyuab siab ntawm peb lub laptop hais lus.

Kauj Ruam 6: Tsim Tus Qauv

Image
Image
Tsim Tus Qauv
Tsim Tus Qauv

Peb tau siv sab saud ntawm Philips Hawj Hawj Lub Teeb, tab sis cnc'd ntsuab hauv qab. SolidWorksfile nyob ntawm no, tab sis nws kuj tseem tuaj yeem lom zem los ntsuas lub teeb koj tus kheej thiab tsim qee yam rau koj nyiam!

Peb siv daim duab saum toj ntawm lub teeb ua tus underlayer hauv SW, kom paub tseeb tias cov duab hauv qab ua raws txoj kab nkhaus ntawm sab saum toj (saib thawj daim duab).

Txhawm rau kom muaj tus qauv cnc'd, khaws nws ua STL cov ntaub ntawv thiab nrhiav koj lub tshuab hauv zos (ntawm uni piv txwv).

Kauj Ruam 7: Cov peev txheej

Yog tias koj xav tau cov ntaub ntawv ntau ntxiv ntawm cov ncauj lus no, lossis pom ntau cov lej rau ntsuas kev ntxhov siab, saib cov vev xaib thiab cov haujlwm hauv qab no:

  • Kev piav qhia ntau ntxiv ntawm ua rau cov ntaub ntawv audio hauv Kev Ua (uas peb tau siv)
  • Phau ntawv zoo ntawm GSR
  • Txias sib txawv mus kom ze rau txoj kev xav
  • Tias txias txias ntsuas nrog ntau lub ntsuas (qhov kev tshoov siab loj rau txoj haujlwm no)
  • Suab (tsis txhob ntxhov siab) lub projector nrog RGB LED
  • Tshooj lus zoo txog GSR

Pom zoo: