Cov txheej txheem:
- Kauj Ruam 1: Cov Ntaub Ntawv thiab Cov Cuab Yeej
- Kauj ruam 2: Sib dhos
- Kauj Ruam 3: Txoj Cai rau UNO
- Kauj Ruam 4: Cov Kauj Ruam Tom ntej
Video: IOT123 - I2C BRICK MASTER JIG: 4 Kauj Ruam
2024 Tus sau: John Day | [email protected]. Kawg hloov kho: 2024-01-30 09:29
Thaum txhim kho ASSIMILATE SENSORS thiab ACTORS, Kuv khaws UNO yooj yim rau xa adhoc I2C cov lus txib rau cov qauv tsim. Ib qho txiaj ntsig ntawm I2C BRICKS yog tus qauv pinouts. Ntau dua li siv cov xov tooj hluav taws xob txhua lub sijhawm (saib Fritzings), siv daim ntaub lo-tech ruaj khov.
Kauj Ruam 1: Cov Ntaub Ntawv thiab Cov Cuab Yeej
- 4cm x 6cm Uninersal PCB (1)
- Hookup hlau (~ 6)
- 4K7 Resistors (2) 6
- Txiv neej Header (12P, 8P)
- Poj Niam Header (9P, lossis 3P, 3P)
- Cov laug thiab hlau (1)
Kauj ruam 2: Sib dhos
Yog tias koj siv 2 tawm 3P poj niam lub taub hau hloov ntawm 1 tawm 9P tus poj niam lub taub hau, ASSIMILATE SENSOR/ACTORS yuav haum rau ntawm JIG yam tsis tau muab sib dhos.
Nrog txoj hlua, tshem tawm txog 10mm ntawm qhov kawg thiab tin kawg.
- Hauv qab ntawm PCB, ntxig tus txiv neej lub taub hau (1) (2) thiab muab tshuaj txhuam tso rau saum.
- Nyob rau sab saum toj ntawm PCB, ntxig tus poj niam lub taub hau (3) thiab muab tshuaj txhuam tso rau hauv qab.
- Nyob rau sab saud, hla-lub qhov xaim liab rau hauv RED1 thiab RED2.
- Hauv qab, hla-qhov xaim los ntawm RED1 mus rau RED3.
- Hauv qab, dhau los ntawm qhov xaim los ntawm RED2 mus rau RED5, thiab cov laug.
- Nyob rau sab saum toj, hla-qhov xaim los ntawm RED3 mus rau RED4, thiab cov laug.
- Nyob rau sab saud, hla-lub qhov xaim liab rau hauv RED6 thiab RED7.
- Hauv qab, hla-qhov xaim los ntawm RED6 mus rau RED8.
- Nyob hauv qab, hla-qhov xaim los ntawm RED7 mus rau RED10, thiab cov laug.
- Nyob rau sab saum toj, hla-qhov xaim los ntawm RED8 mus rau RED9, thiab cov laug.
- Nyob rau sab saud, hla-lub qhov xaim dub rau hauv BLACK1 thiab BLACK2.
- Hauv qab, hla-qhov xaim los ntawm BLACK1 rau BLACK3.
- Hauv qab, hla lub qhov hlau los ntawm BLACK2 mus rau BLACK5, thiab cov laug.
- Nyob rau sab saum toj, hla-qhov xaim los ntawm BLACK3 mus rau BLACK4, thiab cov laug.
- Nyob rau sab saum toj, hla-lub qhov xaim xaim rau hauv BLUE1 thiab BLUE2.
- Hauv qab, hla-qhov xaim los ntawm BLUE1 mus rau BLUE3.
- Hauv qab, hla-qhov xaim los ntawm BLUE2 mus rau BLUE5, thiab cov laug.
- Nyob rau sab saum toj, hla-qhov xaim los ntawm BLUE3 mus rau BLUE4, thiab cov laug.
- Nyob rau sab saum toj, hla-lub qhov ntsuab xaim rau hauv GREEN1 thiab GREEN2.
- Hauv qab, hla-qhov xaim los ntawm GREEN1 mus rau GREEN3.
- Hauv qab, hla-qhov xaim los ntawm GREEN2 mus rau GREEN5, thiab cov laug.
- Nyob rau sab saum toj, hla-qhov xaim los ntawm GREEN3 mus rau GREEN4, thiab cov laug.
- Nyob rau sab saum toj, dhau los ntawm lub qhov 4K7 resistor rau hauv SILVER3 thiab SILVER4.
- Hauv qab, dhau los ntawm qhov xaim los ntawm SILVER3 mus rau GREEN5, thiab cov laug.
- Hauv qab, hla-qhov xaim los ntawm SILVER4 mus rau RED10, thiab muab tshuaj txhuam.
- Nyob rau sab saum toj, dhau los ntawm lub qhov 4K7 resistor rau hauv SILVER1 thiab SILVER2.
- Hauv qab, hla-qhov xaim los ntawm SILVER1 rau hauv BLUE5, thiab cov laug.
- Hauv qab, dhau los ntawm qhov xaim los ntawm SILVER2 rau hauv RED10, thiab cov laug.
Kauj Ruam 3: Txoj Cai rau UNO
Daim duab kos ntawm no yog qhov tsis tseem ceeb. Nws tso cai rau koj siv Console Input, kom UNO xa I2C cov lus mus rau I2C ATTINY85 BRICK.
Txhua cov lus qhia tau luam tawm rau lub vijtsam, nrog rau cov kev txhawb nqa.
I2C BRICK adhoc cov lus txib rau qhev los ntawm UNO tus tswv
#suav nrog |
const byte _num_chars = 32; |
char _received_chars [_num_chars]; // ib qho array khaws cov ntaub ntawv tau txais |
boolean _has_new_data = tsis tseeb; |
voidsetup () { |
Serial.begin (9600); |
Serial.println (); |
Serial.println ("ASSIMILATE IOT ACTOR/SENSOR EEPROM EDITOR"); |
Serial.println ("xyuas kom meej kab tshiab xaiv hauv lub qhov rai console"); |
Serial.println (); |
Serial.println ("ADDRESS 1 CONFIRM METADATA RECEIPT N/A (FOR M2M)"); |
Serial.println ("ADDRESS 2 ACTOR COMMAND"); |
Serial.println (); |
Serial.println ("ADDRESSES ON BUS:"); |
scan_i2c_addresses (); |
Serial.println (); |
Serial.println (""); |
} |
voidscan_i2c_addresses () { |
int ntaus_count = 0; |
rau (byte chaw nyob = 8; chaw nyob <127; chaw nyob ++) |
{ |
Wire.beginTransmission (chaw nyob); |
const byte yuam kev = Wire.endTransmission (); |
yog (yuam kev == 0) |
{ |
Serial.println (chaw nyob); |
} |
} |
} |
voidloop () { |
recv_with_end_marker (); |
xa_to_i2c (); |
} |
voidrecv_with_end_marker () { |
zoo li qub byte ndx = 0; |
char end_marker = '\ n'; |
caj rc; |
thaum (Serial.available ()> 0 && _has_new_data == tsis tseeb) { |
rc = Serial.read (); |
yog (rc! = end_marker) { |
_received_chars [ndx] = rc; |
ndx ++; |
yog (ndx> = _num_chars) { |
ndx = _num_chars - 1; |
} |
} |
lwm tus { |
_received_chars [ndx] = '\ 0'; // txiav txoj hlua |
nnx = 0; |
_has_new_data = tseeb; |
} |
} |
} |
voidsend_to_i2c () { |
char param_buf [16]; |
const String received_string = Txoj hlua (_received_chars); |
yog (_has_new_data == muaj tseeb) { |
int idx1 = tau txais_string.indexOf (''); |
Txoj hlua chaw nyob = tau txais_string.substring (0, idx1); |
int address_int = chaw nyob.toInt (); |
yog (address_int <8 || address_int> 127) { |
Serial.println ("Qhov chaw nyob tsis raug nkag mus:"); |
Serial.println (chaw nyob); |
rov qab; |
} |
int idx2 = tau txais_string.indexOf ('', idx1+1); |
Txoj hlua; |
yog (idx2 == -1) { |
code = tau txais_string.substring (idx1+1); |
lwm yam { |
code = tau txais_string.substring (idx1+1, idx2+1); |
} |
int code_int = chaws.toInt (); |
yog (code_int <0 || code_int> 5) { |
Serial.println ("INVALID CODE INPUT:"); |
Serial.println (chaws); |
rov qab; |
} |
bool has_parameter = idx2> -1; |
Txoj hlua parameter; |
yog (muaj_parameter) { |
parameter = tau txais_string.substring (idx2 + 1, idx2 + 17); // 16 kab ntawv max |
yog (parameter.length () <1) { |
Serial.println ("PARTAMETER MIN. LENGTH 1"); |
_has_new_data = tsis tseeb; |
rov qab; |
} |
lwm yam { |
yog (code_int> 1) { |
Serial.println ("PARAMETER YUAV TSUM!"); |
_has_new_data = tsis tseeb; |
rov qab; |
} |
} |
Serial.println (); |
Serial.print ("keeb kwm input ="); |
Serial.println (tau txais cov hlua); |
Serial.print ("chaw nyob ="); |
Serial.println (chaw nyob); |
Serial.print ("chaws ="); |
Serial.println (chaws); |
Serial.print ("ntsuas ="); |
Serial.println (qhov ntsuas); |
// Xa VIA I2C |
Wire.beginTransmission (address_int); |
Wire.write (code_int); |
yog (muaj_parameter) { |
parameter.trim (); |
strcpy (param_buf, parameter.c_str ()); |
Hlau.write (param_buf); |
} |
Wire.endTransmission (); |
Serial.println (); |
Serial.println ("Xa VIA I2C!"); |
Serial.println (); |
Serial.println (""); |
_has_new_data = tsis tseeb; |
} |
} |
saib rawuno_i2c_command_input.ino tuav nrog ❤ los ntawm GitHub
Kauj Ruam 4: Cov Kauj Ruam Tom ntej
Los ntawm cov khoom tsim tawm, muaj qhov txaus txav mus rau koj los tsim koj tus kheej ASSIMILATE IOT NETWORK.
Txhua tus ntawm tus kheej lub luag haujlwm ntawm cov nodes (sensors thiab cov ua yeeb yam) tuaj yeem tswj tau hauv kev faib ua pawg, tsis yog nyob ntawm MCU tus tswv kom muaj kev paub txog cov yam ntxwv txhawb.
Ib qho app txuas rau MQTT broker tuaj yeem tswj/saib xyuas txhua qhov tshwj xeeb ntawm IOT Node. Ntawd yog M2M, daim ntawv thov web, IFTTT thiab ntxiv rau. Yooj yim dua (lossis zoo dua yog tias koj nyiam) cuam tshuam rau koj lub ntiaj teb IOT.
Pom zoo:
IOT123 - ATTINY85 ONBOARD PROGRAMMING JIG: 3 Kauj Ruam
IOT123 - ATTINY85 ONBOARD PROGRAMMING JIG: Ntawm BRICK tus qauv, Kuv tau hais txog qhov hla qhov uas nyob ib sab ntawm ATTINY85 tau tso tseg tsis siv, txhawm rau ua kom tus pogo tus lej programmer thaum DIP8 tau muab muag rau PCB. Qhov no yog pogo pin programmer. Qhov no tiag tiag tsuas yog ib qho adapter coj los ntawm
IOT123 - LIR2032 BATTERY BRICK: 4 Kauj Ruam
IOT123 - LIR2032 roj teeb lub teeb: IOT123 BRICKS yog DIY chav nyob sib dhos uas tuaj yeem sib xyaw ua ke nrog lwm IOT123 BRICKS, txhawm rau ntxiv kev ua haujlwm rau ntawm qhov chaw lossis hnav tau. Lawv tau ua raws li lub xwmfab nti, ob tog sib thooj protoboards nrog kev sib txuas sib txuas los ntawm qhov … Txawm hais tias cov lus qhia
IOT123 - 3.3V POWER BRICK: 4 Cov kauj ruam
IOT123 - 3.3V POWER BRICK: IOT123 BRICKS yog DIY chav nyob uas tuaj yeem sib xyaw nrog lwm IOT123 BRICKS, txhawm rau ntxiv kev ua haujlwm rau ntawm qhov chaw lossis hnav tau. Lawv tau ua raws li lub xwmfab nti, ob tog sib thooj protoboards nrog kev sib txuas sib txuas los ntawm qhov … Txawm hais tias cov lus qhia
IOT123 - 5PIN ATTINY85 NRF24L01 BRICK: 4 Kauj Ruam
IOT123 - 5PIN ATTINY85 NRF24L01 BRICK: Hloov tshiab: Qhov teeb tsa no yog kev kawm ntau lossis lub hauv paus rau kev sim software/fais fab mov. Txawm hais tias thaum PB5 yog neeg xiam oob qhab raws li RESET, nws tsis nyeem qhov tseem ceeb raug siv analogRead: rooj plaub siv tseem ceeb rau kev nyeem ntawv sensor. Yuav saib mus rau ATTINY84 teeb tsa
IOT123 - ATTINY85 SOFTWARE SERIAL JIG Sib dhos: 4 Kauj Ruam
IOT123 - ATTINY85 SOFTWARE SERIAL JIG Assembly: Kuv tau siv ATTINY85's rau lub zog qis sensor mashups. Thaum xub thawj kuv xav tias tsis muaj txoj hauv kev debug cov chips siv lub console thiab siv qee qhov zoo nkauj " nyob ntawd " cov txheej txheem los saib seb muaj dab tsi tshwm sim rau lub sijhawm ua haujlwm. Tom qab ntawd kuv tau hla SoftwareSeria