Cov txheej txheem:

IOT123 - I2C BRICK MASTER JIG: 4 Kauj Ruam
IOT123 - I2C BRICK MASTER JIG: 4 Kauj Ruam

Video: IOT123 - I2C BRICK MASTER JIG: 4 Kauj Ruam

Video: IOT123 - I2C BRICK MASTER JIG: 4 Kauj Ruam
Video: Тива C, эксперимент 17 — I2C 2024, Kaum ib hlis
Anonim
IOT123 - I2C BRICK MASTER JIG
IOT123 - I2C BRICK MASTER JIG
IOT123 - I2C BRICK MASTER JIG
IOT123 - I2C BRICK MASTER JIG
IOT123 - I2C BRICK MASTER JIG
IOT123 - I2C BRICK MASTER JIG

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

Cov Khoom thiab Cov Cuab Yeej
Cov Khoom thiab Cov Cuab Yeej
Cov Khoom thiab Cov Cuab Yeej
Cov Khoom thiab Cov Cuab Yeej
Cov Khoom thiab Cov Cuab Yeej
Cov Khoom thiab Cov Cuab Yeej
Cov Khoom thiab Cov Cuab Yeej
Cov Khoom thiab Cov Cuab Yeej
  1. 4cm x 6cm Uninersal PCB (1)
  2. Hookup hlau (~ 6)
  3. 4K7 Resistors (2) 6
  4. Txiv neej Header (12P, 8P)
  5. Poj Niam Header (9P, lossis 3P, 3P)
  6. Cov laug thiab hlau (1)

Kauj ruam 2: Sib dhos

Los ua ke
Los ua ke
Los ua ke
Los ua ke
Los ua ke
Los ua ke

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.

  1. Hauv qab ntawm PCB, ntxig tus txiv neej lub taub hau (1) (2) thiab muab tshuaj txhuam tso rau saum.
  2. Nyob rau sab saum toj ntawm PCB, ntxig tus poj niam lub taub hau (3) thiab muab tshuaj txhuam tso rau hauv qab.
  3. Nyob rau sab saud, hla-lub qhov xaim liab rau hauv RED1 thiab RED2.
  4. Hauv qab, hla-qhov xaim los ntawm RED1 mus rau RED3.
  5. Hauv qab, dhau los ntawm qhov xaim los ntawm RED2 mus rau RED5, thiab cov laug.
  6. Nyob rau sab saum toj, hla-qhov xaim los ntawm RED3 mus rau RED4, thiab cov laug.
  7. Nyob rau sab saud, hla-lub qhov xaim liab rau hauv RED6 thiab RED7.
  8. Hauv qab, hla-qhov xaim los ntawm RED6 mus rau RED8.
  9. Nyob hauv qab, hla-qhov xaim los ntawm RED7 mus rau RED10, thiab cov laug.
  10. Nyob rau sab saum toj, hla-qhov xaim los ntawm RED8 mus rau RED9, thiab cov laug.
  11. Nyob rau sab saud, hla-lub qhov xaim dub rau hauv BLACK1 thiab BLACK2.
  12. Hauv qab, hla-qhov xaim los ntawm BLACK1 rau BLACK3.
  13. Hauv qab, hla lub qhov hlau los ntawm BLACK2 mus rau BLACK5, thiab cov laug.
  14. Nyob rau sab saum toj, hla-qhov xaim los ntawm BLACK3 mus rau BLACK4, thiab cov laug.
  15. Nyob rau sab saum toj, hla-lub qhov xaim xaim rau hauv BLUE1 thiab BLUE2.
  16. Hauv qab, hla-qhov xaim los ntawm BLUE1 mus rau BLUE3.
  17. Hauv qab, hla-qhov xaim los ntawm BLUE2 mus rau BLUE5, thiab cov laug.
  18. Nyob rau sab saum toj, hla-qhov xaim los ntawm BLUE3 mus rau BLUE4, thiab cov laug.
  19. Nyob rau sab saum toj, hla-lub qhov ntsuab xaim rau hauv GREEN1 thiab GREEN2.
  20. Hauv qab, hla-qhov xaim los ntawm GREEN1 mus rau GREEN3.
  21. Hauv qab, hla-qhov xaim los ntawm GREEN2 mus rau GREEN5, thiab cov laug.
  22. Nyob rau sab saum toj, hla-qhov xaim los ntawm GREEN3 mus rau GREEN4, thiab cov laug.
  23. Nyob rau sab saum toj, dhau los ntawm lub qhov 4K7 resistor rau hauv SILVER3 thiab SILVER4.
  24. Hauv qab, dhau los ntawm qhov xaim los ntawm SILVER3 mus rau GREEN5, thiab cov laug.
  25. Hauv qab, hla-qhov xaim los ntawm SILVER4 mus rau RED10, thiab muab tshuaj txhuam.
  26. Nyob rau sab saum toj, dhau los ntawm lub qhov 4K7 resistor rau hauv SILVER1 thiab SILVER2.
  27. Hauv qab, hla-qhov xaim los ntawm SILVER1 rau hauv BLUE5, thiab cov laug.
  28. Hauv qab, dhau los ntawm qhov xaim los ntawm SILVER2 rau hauv RED10, thiab cov laug.

Kauj Ruam 3: Txoj Cai rau UNO

Code rau UNO
Code 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: