Cov txheej txheem:

SOLAR WIRELESS LAMP NROG MAGNETIC FLEXIBLE ARM: 8 Kauj Ruam (nrog Duab)
SOLAR WIRELESS LAMP NROG MAGNETIC FLEXIBLE ARM: 8 Kauj Ruam (nrog Duab)

Video: SOLAR WIRELESS LAMP NROG MAGNETIC FLEXIBLE ARM: 8 Kauj Ruam (nrog Duab)

Video: SOLAR WIRELESS LAMP NROG MAGNETIC FLEXIBLE ARM: 8 Kauj Ruam (nrog Duab)
Video: Мужская команда Casio G-Shock Land Land Cruiser Rangeman | GPR-B1000TLC-1 Toyota Auto ... 2024, Kaum ib hlis
Anonim
SOLAR WIRELESS LAMP nrog MAGNETIC FLEXIBLE ARM
SOLAR WIRELESS LAMP nrog MAGNETIC FLEXIBLE ARM
SOLAR WIRELESS LAMP nrog MAGNETIC FLEXIBLE ARM
SOLAR WIRELESS LAMP nrog MAGNETIC FLEXIBLE ARM

Txoj haujlwm no tau tsim los ntawm lub teeb tawg & nodeMCU. Lub teeb zoo nkauj no tuaj yeem hloov kho hauv ib qho kev qhia & txuas ntawm cov khoom sib nqus lossis muab tso rau ntawm lub rooj. Nws tuaj yeem tswj tau hauv ob hom raws li hauv qab no:

- Wireless tswj hom, raws li YouTube txuas hauv qab no:

- Hom kev sib tham sib, raws li YouTube txuas hauv qab no:

Kauj Ruam 1: Nqi Cov Khoom Siv

B. O. M lis:

Duab
Duab

Txog kev sib tham sib tham, Kuv siv MPU6050 kom tau txais cov ntaub ntawv gyro los ntawm NodeMCU los tswj lub teeb xim.

Cov ntaub ntawv duab rau txoj haujlwm no:

Duab
Duab

Kauj Ruam 2: CIRCUIT

CIRCUIT
CIRCUIT

Qhov no yog qhov yooj yim Circuit Court, raws li Fritzing schematic saum toj no, nrog 1 RGB Led hom anode yam, peb txwv tam sim no resistors R100 & MPU6050.

Lub teeb pom kev zoo yog siv los ntawm ib lub teeb tawg & txuas nrog nodeMCU puag los ntawm 2 tus ntsia hlau los yog lo lawv nrog cov kua nplaum muaj zog.

Kev teeb tsa ua haujlwm:

Duab
Duab
Duab
Duab

Schematic hauv qab no:

Duab
Duab

Kauj Ruam 3: MAGNETIC BASE - FLEXIBLE ARM

MAGNETIC BASE - FLEXIBLE ARM
MAGNETIC BASE - FLEXIBLE ARM

Cov caj npab yoog tau tuaj yeem rov siv tau los ntawm cov kais dej hloov pauv tau. Tej yam zoo li no:

Duab
Duab

Nrog qee cov lus qhia, peb sim txuas lawv mus rau lub hauv paus hlau nplaum ruaj khov hauv qab ntawm caj npab hloov pauv. Nyob rau sab saum toj, peb tau ua qhov tho qhov txuas rau peb lub rooj sib tham hauv Circuit Court thiab lub hnub ci/lub roj teeb them. Ua lub hauv paus no, peb tuaj yeem tso teeb rau saum npoo zoo li lub rooj, pem teb …; lossis nws tuaj yeem txuas nrog cov khoom sib nqus zoo li steel ncej, qauv hlau.

Kauj Ruam 4: SOLAR - Roj teeb CHARGER

SOLAR - roj teeb CHARGER
SOLAR - roj teeb CHARGER

Nws tuaj ntawm lub teeb uas them nyiaj puas. Kuv ntxiv qhov qhib/tua hluav taws xob thiab cov xov hluav taws xob muab rau nodeMCU. Nws kuj tseem muaj ib qho chaw nres nkoj USB thiab ib lub ntsaws rau lub roj teeb them.

Kauj Ruam 5: Txuas txhua yam ua ke

Txuas txhua yam ua ke
Txuas txhua yam ua ke

Txuas txhua ntu: NodeMCU & lub teeb pom kev zoo, hnub ci & roj teeb hlwb, hloov caj npab ua ke.

KAWG

Duab
Duab

CHARGING MODE

Duab
Duab

Kauj Ruam 6: KEV PAB CUAM TSEV KAWM NTAWV

Cov xim yuav raug hloov pauv thaum peb hloov kho caj npab lossis hloov lub teeb.

LAMP INTERACTIVE

#suav nrog
// MPU6050 Qhua Chaw Nyob
const uint8_t MPU6050SlaveAddress = 0x68;
// Xaiv SDA thiab SCL pins rau I2C kev sib txuas lus - Pin default in WIRE LIBRARY: SCL - D1 & SDA - D2 ntawm NODEMCU
// const uint8_t SCL = D1;
// const uint8_t SDA = D2;
cov int R = 14;
const int G = 12;
cov int B = 13;
// MPU6050 ob peb teeb tsa npe chaw nyob
const uint8_t MPU6050_REGISTER_SMPLRT_DIV = 0x19;
const uint8_t MPU6050_REGISTER_USER_CTRL = 0x6A;
const uint8_t MPU6050_REGISTER_PWR_MGMT_1 = 0x6B;
const uint8_t MPU6050_REGISTER_PWR_MGMT_2 = 0x6C;
const uint8_t MPU6050_REGISTER_CONFIG = 0x1A;
const uint8_t MPU6050_REGISTER_GYRO_CONFIG = 0x1B;
const uint8_t MPU6050_REGISTER_ACCEL_CONFIG = 0x1C;
const uint8_t MPU6050_REGISTER_FIFO_EN = 0x23;
const uint8_t MPU6050_REGISTER_INT_ENABLE = 0x38;
const uint8_t MPU6050_REGISTER_ACCEL_XOUT_H = 0x3B;
const uint8_t MPU6050_REGISTER_SIGNAL_PATH_RESET = 0x68;
int16_t AccelX, AccelY, AccelZ, Kub, GyroX, GyroY, GyroZ;
void teeb tsa () {
pinMode (R, OUTPUT);
pinMode (G, OUTPUT);
pinMode (B, NTAWV);
//Serial.begin(9600);
Wire.begin (SDA, SCL);
MPU6050_Init ();
}
void voj () {
uint16_t Ax, Ay, Az, T, Gx, Gy, Gz;
uint16_t Liab, Ntsuab, Xiav;
Nyeem_RawValue (MPU6050SlaveAddress, MPU6050_REGISTER_ACCEL_XOUT_H);
// Siv tus nqi meej
Ax = myAbs (AccelX);
Ay = myAbs (AccelY);
Az = myAbs (AccelZ);
// Nplai hauv ntau
Liab = daim ntawv qhia (Ax, 0, 16384, 0, 1023);
Ntsuab = daim ntawv qhia (Ay, 0, 16384, 0, 1023);
Xiav = daim ntawv qhia (Az, 0, 16384, 0, 1023);
// Serial print los xyuas
//Serial.print("Red: "); Serial.print (Liab);
//Serial.print("Green: "); Serial.print (Ntsuab);
//Serial.print("Blue: "); Serial.print (Xiav);
// Sau analog rau LED
analogWrite (R, Liab); // R ib
analogWrite (G, Ntsuab); // G
analogWrite (B, Xiav); // IB
ncua (200);
}
void I2C_Write (uint8_t deviceAddress, uint8_t regAddress, uint8_t cov ntaub ntawv) {
Wire.beginTransmission (chaw nyob);
Wire.write (regAddress);
Wire.write (cov ntaub ntawv);
Wire.endTransmission ();
}
// Nyeem tag nrho 14 qhov sau npe
void Read_RawValue (uint8_t deviceAddress, uint8_t regAddress) {
Wire.beginTransmission (chaw nyob);
Wire.write (regAddress);
Wire.endTransmission ();
Wire.requestFrom (deviceAddress, (uint8_t) 14);
AccelX = (((int16_t) Wire.read () << 8) | Wire.read ());
AccelY = (((int16_t) Wire.read () << 8) | Wire.read ());
AccelZ = (((int16_t) Wire.read () << 8) | Wire.read ());
Kub = (((int16_t) Wire.read () << 8) | Wire.read ());
GyroX = (((int16_t) Wire.read () << 8) | Wire.read ());
GyroY = (((int16_t) Wire.read () << 8) | Wire.read ());
GyroZ = (((int16_t) Wire.read () << 8) | Wire.read ());
}
// Kho MPU6050
void MPU6050_Init () {
ncua (150);
I2C_Write (MPU6050SlaveAddress, MPU6050_REGISTER_SMPLRT_DIV, 0x07);
I2C_Write (MPU6050SlaveAddress, MPU6050_REGISTER_PWR_MGMT_1, 0x01);
I2C_Write (MPU6050SlaveAddress, MPU6050_REGISTER_PWR_MGMT_2, 0x00);
I2C_Write (MPU6050SlaveAddress, MPU6050_REGISTER_CONFIG, 0x00);
I2C_Write (MPU6050SlaveAddress, MPU6050_REGISTER_GYRO_CONFIG, 0x00); // teeb tsa +/- 250 degree/thib ob puv nplai
I2C_Write (MPU6050SlaveAddress, MPU6050_REGISTER_ACCEL_CONFIG, 0x00); // teeb tsa +/- 2g puv teev
I2C_Write (MPU6050SlaveAddress, MPU6050_REGISTER_FIFO_EN, 0x00);
I2C_Write (MPU6050SlaveAddress, MPU6050_REGISTER_INT_ENABLE, 0x01);
I2C_Write (MPU6050SlaveAddress, MPU6050_REGISTER_SIGNAL_PATH_RESET, 0x00);
I2C_Write (MPU6050SlaveAddress, MPU6050_REGISTER_USER_CTRL, 0x00);
}
// Tsis Muaj Nqis
ntab myAbs (ntab hauv) {
return (hauv)> 0? (hauv):-(hauv);
}

saib rawINTERACTIVE LAMP PROGRAM tuav nrog ❤ los ntawm GitHub

Kauj Ruam 7: WIRELESS CONTROL PROGRAM THIAB ANDROID APPLICATION

WIRELESS CONTROL PROGRAM THIAB ANDROID APPLICATION
WIRELESS CONTROL PROGRAM THIAB ANDROID APPLICATION

Lwm txoj hauv kev, peb tuaj yeem siv Android App los tswj RGB LED nrog Android hauv WiFi Network. Txuas Android App: NODEMCU tswj RGB LED APP

Rau Arduino program, koj tuaj yeem xa mus rau:

microcontrollerkits.blogspot.com/2016/05/es…

Tom qab rub cov program mus rau NodeMCU, thawj zaug yuav muab rau peb NodeMCU tus IP chaw nyob ntawm cov ntawv luam tawm. Hauv kuv qhov xwm txheej, nws yog: 192.164.1.39 ntawm chaw nres nkoj 80.

Duab
Duab

Tam sim no, peb tuaj yeem tswj lub teeb wireless nrog lub khoos phis tawj/ ntsiav tshuaj/ xov tooj ntawm tes los ntawm kev nkag mus rau qhov chaw nyob saum toj no rau hauv internet tshawb.

Duab
Duab

Los yog siv Android app:

Duab
Duab

Kauj Ruam 8: NTUJ DUAB

Pom zoo: