Ci-dessous, les différences entre deux révisions de la page.
Les deux révisions précédentesRévision précédenteProchaine révision | Révision précédente | ||
projets:atb:index [2021/03/04 01:32] – f1sls | projets:atb:index [2021/03/04 02:06] (Version actuelle) – f1sls | ||
---|---|---|---|
Ligne 1: | Ligne 1: | ||
====== ATB : APRS TELEMETRY BOX ====== | ====== ATB : APRS TELEMETRY BOX ====== | ||
+ | |||
+ | {{: | ||
+ | <catlist -forceHeadTitle -exclupage -sortAscending -hideNotFoundMsg -columns:1 -maxDepth:1 -noHead -noAddPageButton> | ||
+ | ---- | ||
===== AX.25 MODEM ===== | ===== AX.25 MODEM ===== | ||
Ligne 7: | Ligne 11: | ||
==== 4~20 mA CURRENT LOOP ==== | ==== 4~20 mA CURRENT LOOP ==== | ||
- | |||
- | ==== TEMPERATURE & HUMIDITY ==== | ||
- | {{: | ||
- | |||
- | === CHARACTERISTICS === | ||
- | * Operating Voltage 3.3V to 5.5V | ||
- | * Humidity measurement range 20% to 90% RH | ||
- | * Humidity measurement accuracy ±5% RH | ||
- | * Humidity measurement resolution 1% RH | ||
- | * Temperature measurement range 0ºC to 50ºC [32ºF to 122ºF] | ||
- | * Temperature measurement accuracy ±2ºC | ||
- | * Temperature measurement resolution 1ºC | ||
- | * Signal transmission range 20m | ||
- | |||
- | === ARDUINO WIRING === | ||
- | {{: | ||
- | |||
- | === CODE SAMPLE === | ||
- | <code c> | ||
- | int DHpin = 8; // input/ | ||
- | byte dat[5]; | ||
- | |||
- | byte read_data() | ||
- | { | ||
- | byte i = 0; | ||
- | byte result = 0; | ||
- | for (i = 0; i < 8; i++) { | ||
- | while (digitalRead(DHpin) == LOW); // wait 50us | ||
- | delayMicroseconds(30); | ||
- | if (digitalRead(DHpin) == HIGH) | ||
- | result |= (1 << (8 - i)); //High in the former, low in the post | ||
- | while (digitalRead(DHpin) == HIGH); //Data ' | ||
- | } | ||
- | return result; | ||
- | } | ||
- | |||
- | void start_test() | ||
- | { | ||
- | digitalWrite(DHpin, | ||
- | delay(30); //The delay is greater than 18 ms so that DHT 11 can detect the start signal | ||
- | digitalWrite(DHpin, | ||
- | delayMicroseconds(40); | ||
- | pinMode(DHpin, | ||
- | while(digitalRead(DHpin) == HIGH); | ||
- | delayMicroseconds(80); | ||
- | | ||
- | if(digitalRead(DHpin) == LOW) | ||
- | delayMicroseconds(80); | ||
- | for(int i = 0; i < 5; i++) //Receiving temperature and humidity data, check bits are not considered; | ||
- | dat[i] = read_data(); | ||
- | pinMode(DHpin, | ||
- | digitalWrite(DHpin, | ||
- | } | ||
- | |||
- | void setup() | ||
- | { | ||
- | Serial.begin(9600); | ||
- | pinMode(DHpin, | ||
- | } | ||
- | |||
- | void loop() | ||
- | { | ||
- | start_test(); | ||
- | Serial.print(" | ||
- | Serial.print(dat[0], | ||
- | Serial.print(' | ||
- | Serial.print(dat[1], | ||
- | Serial.println(' | ||
- | Serial.print(" | ||
- | Serial.print(dat[2], | ||
- | Serial.print(' | ||
- | Serial.print(dat[3], | ||
- | Serial.println(' | ||
- | |||
- | byte checksum = dat[0] + dat[1] + dat[2] + dat[3]; | ||
- | if (dat[4] != checksum) | ||
- | Serial.println(" | ||
- | else | ||
- | Serial.println(" | ||
- | |||
- | delay(1000); | ||
- | } | ||
- | </ | ||