NodeMcu TTGO T-Call ESP32 SIM800L Udviklingsboard er et at bedste IoT board. Ved at montere et SIM kort kan den sende SMS, og hente data.
Tekniske detaljer:
- Chipset: ESPRESSIF-ESP32 WROVER-B 240MHz Xtensa® single-/dual-core 32-bit LX6 microprocessor
- FLASH Memory: QSPI flash 4MB / PSRAM 8MB
- SRAM: 520 KB SRAM
- Button: Reset
- USB to TTL IC: CP2104
- Modular interface: UAR, SPI, SDIO, I2C, LED PWM, TV PWM, I2S, IRGPIO, capacitor touch sensor, ADC, DACLNA pre-amplifier
- On-board clock: 40MHz crystal oscillator
- Working voltage: 2.7V-3.6V
- Working current: About 70mA
- Sleep current: About 300uA
- SIM card: Only supports Nano SIM card
- Working temperature range: -40℃ ~ +85℃
- Size&Weight: 74.78mm*29.01mm*8.06mm(11.77g)
Power Supply Specifications:
- Power Supply: USB 5V/1A
- Charging current: 500mA
- Battery: 3.7V lithium battery (Not included)
- JST Connector: 2Pin 1.25mm
- USB: Type-C
Wi-Fi:
- Standard: FCC/CE-RED/IC/TELEC/KCC/SRRC/NCC
- Protocol: 802.11 b/g/n(802.11n, speed up to150Mbps)A-MPDU and A-MSDU polymerization, support 0.4μS Protection interval
- Frequency range: 2.4GHz~2.5GHz(2400M~2483.5M)
- Transmit Power: 22dBm
- Communication distance: 300m
GSM/GPRS SIM800L:
- Quad-band 850/900/1800/1900MHz
- Connect onto any global GSM network with any 2G SIM
- Send and receive SMS messages.
- Send and receive GPRS data (TCP/IP, HTTP, etc.)
- AT command interface with “auto baud” detection.
Bluetooth:
- Protocol: Bluetooth v4.2BR/EDR and BLE standard
- Radio frequency: -97dBm sensitivity NZIF receiver Class-1,Class-2&Class-3 emitter AFH
- Audio frequency: CVSD&SBC audio frequency
Software Specifications:
- Wi-Fi Mode: Station/SoftAP/SoftAP+Station/P2P
- Security mechanism: WPA/WPA2/WPA2-Enterprise/WPS
- Encryption Type: AES/RSA/ECC/SHA
- Firmware upgrade: UART download/OTA (Through network/host to download and write firmware)
- Software Development: Support cloud server development /SDK for user firmware development
- Networking protocol: IPv4, IPv6, SSL, TCP/UDP/HTTP/FTP/MQTT
- User Configuration: AT + Instruction set, cloud server, android/iOSapp
- OS: FreeRTOS
Installere Driver (CP2104)
På nogle computer skal der ikke bruges en driver da Windows selv finder ud af det. men med en CP2104 USB chip skal computer i nogle tilfælde have en driver den kan downloades her.
Programmering
Før du kan starte din programmering skal Arduino’s IDE software hentes. Dette program bruges til at programmere chippen.
Download fra dette link: Downlaod
Inden programmeringen kan udfæres skal den rigtige “COM” port findes. Klik “Værktøj/Port” – og vælg COM port.
Installere ESP package (Arduino IDE)
- Åben Arduino IDE (Download her)
- Klik “Fil/Egenskaber”
- Indtast dette link i feltet “Additionel Board Manager URL’s”
- Link “https://raw.githubusercontent.com/espressif/arduino-esp32/gh-pages/package_esp32_index.json“
- Klik OK
- Åben “Værktøj/Board/Boards manager” (Lad programmet opdatere)
- Find “ESP32” og installere
- Klik derefter “Værktøj/Board” og find (TTGO T1)
- Du er nu klar til at sende en kode
Installere TinyGSM-0.11.5 Library
- Download library (Download)
- Udpak filer
- Flyt/kopir mappen “TinyGSM-0.11.5” til “libraries” som findes i “Arduino IDE” mappen (C:Program Files (x86)Arduinolibraries)
- Åben Arduino IDE software og klik på “Sketch/Include library”
- Klik nu på “Add Zip. library” og find Zip filen du lige har downloaded.
- Åben “Sketch/Include library/Manage Librarys” for at opdatere library.
- Luk, og åben Arduino IDE programmet. (Genstart programmet)
- Nu er “TinyGSM-0.11.5” installeret
Installere OneWire-2.3.7 Library
- Download library (Download)
- Udpak filer
- Flyt/kopir mappen “OneWire-2.3.7” til “libraries” som findes i “Arduino IDE” mappen (C:Program Files (x86)Arduinolibraries)
- Åben Arduino IDE software og klik på “Sketch/Include library”
- Klik nu på “Add Zip. library” og find Zip filen du lige har downloaded.
- Åben “Sketch/Include library/Manage Librarys” for at opdatere library.
- Luk, og åben Arduino IDE programmet. (Genstart programmet)
- Nu er “OneWire-2.3.7” installeret
Eksempel
Her viser vi et hurtig eksempel på hvordan du får modulet til at sende en besked når D2 indgang aktiveres.
Info: Modulet kan godt sende en SMS kun ved USB tilslutningen til computeren.
Status LED:
Der er 2 LED’er på boarded. Den ene skal lyse konstant (Ved knappen) den anden er “Network” den blinker hurtigt hvis der ingen forbindelse er (Gøre den i ca 1 minut efter opstart) hvor den efter skal blinke langsomere.
Du skal bruge:
- SIM kort (Jeg har brugt TDC)
- Push Button PBS-110
- Dupont Breadboard Kabel
Forbind sådan:
- GND (Modul) – Push Button
- 2 (GIOP2 Modul) – Push Button
Info: Modulet kan godt sende en SMS kun ved USB tilslutningen til computeren.
Kode
// variables will change: #define BUTTON_PIN 2 // GIOP21 pin connected to button int lastState = HIGH; // the previous state from the input pin int currentState; // the current reading from the input pin // SIM card PIN (leave empty, if not defined) const char simPIN[] = ""; // Your phone number to send SMS: + (plus sign) and country code, for Portugal +351, followed by phone number // SMS_TARGET Example for Portugal +351XXXXXXXXX #define SMS_TARGET "+4540472134" // Configure TinyGSM library #define TINY_GSM_MODEM_SIM800 // Modem is SIM800 #define TINY_GSM_RX_BUFFER 1024 // Set RX buffer to 1Kb #include <Wire.h> #include <TinyGsmClient.h> // TTGO T-Call pins #define MODEM_RST 5 #define MODEM_PWKEY 4 #define MODEM_POWER_ON 23 #define MODEM_TX 27 #define MODEM_RX 26 #define I2C_SDA 21 #define I2C_SCL 22 // Set serial for debug console (to Serial Monitor, default speed 115200) #define SerialMon Serial // Set serial for AT commands (to SIM800 module) #define SerialAT Serial1 // Define the serial console for debug prints, if needed //#define DUMP_AT_COMMANDS #ifdef DUMP_AT_COMMANDS #include <StreamDebugger.h> StreamDebugger debugger(SerialAT, SerialMon); TinyGsm modem(debugger); #else TinyGsm modem(SerialAT); #endif #define IP5306_ADDR 0x75 #define IP5306_REG_SYS_CTL0 0x00 bool setPowerBoostKeepOn(int en){ Wire.beginTransmission(IP5306_ADDR); Wire.write(IP5306_REG_SYS_CTL0); if (en) { Wire.write(0x37); // Set bit1: 1 enable 0 disable boost keep on } else { Wire.write(0x35); // 0x37 is default reg value } return Wire.endTransmission() == 0; } void setup() { // Set console baud rate SerialMon.begin(115200); // initialize the pushbutton pin as an pull-up input pinMode(BUTTON_PIN, INPUT_PULLUP); // Keep power when running from battery Wire.begin(I2C_SDA, I2C_SCL); bool isOk = setPowerBoostKeepOn(1); SerialMon.println(String("IP5306 KeepOn ") + (isOk ? "OK" : "FAIL")); // Set modem reset, enable, power pins pinMode(MODEM_PWKEY, OUTPUT); pinMode(MODEM_RST, OUTPUT); pinMode(MODEM_POWER_ON, OUTPUT); digitalWrite(MODEM_PWKEY, LOW); digitalWrite(MODEM_RST, HIGH); digitalWrite(MODEM_POWER_ON, HIGH); // Set GSM module baud rate and UART pins SerialAT.begin(115200, SERIAL_8N1, MODEM_RX, MODEM_TX); delay(3000); // Restart SIM800 module, it takes quite some time // To skip it, call init() instead of restart() SerialMon.println("Initializing modem..."); modem.restart(); // use modem.init() if you don't need the complete restart // Unlock your SIM card with a PIN if needed if (strlen(simPIN) && modem.getSimStatus() != 8147 ) { modem.simUnlock(simPIN); } } void loop() { // read the state of the switch/button: currentState = digitalRead(BUTTON_PIN); // To send an SMS, call modem.sendSMS(SMS_TARGET, smsMessage) String smsMessage = "Hello from ESP32!"; if(lastState == LOW && currentState == HIGH){ if(modem.sendSMS(SMS_TARGET, smsMessage)){ SerialMon.println(smsMessage); } else{ SerialMon.println("SMS failed to send"); } } // save the last state lastState = currentState; delay(1000); }
Kontakt os
Du er altid velkommen til at kontakte os på info@ardustore.dk, eller sende os en besked via messenger (Klik her) og vi vil hjælpe dig.
Anmeldelser
Der er endnu ikke nogle anmeldelser.