LoRa, Sensor, TTGO-LORA32, pins and buss

Hi

I have learned that buy HW before reading is not the best way to get stuff to work. On top I'm not so experienced with Arduino so now I ask for some basic help, or I think its basic.... :slight_smile:

Have tried for days to understand how to connect a DHT20 to my TTGO LoRa32 board.

HW:
image image

DHT20 (SEN-18364)
image

Links
DHT20
TTGO

Pin layout:


image

MY PROBLEM
The sketches I have tried it seems to be a I2C bus or some pin assignments I dont grasp

In example under void setup() the LoRa pins are 18,14,26, an example, My DHT20 only have 2 pins SDA and SCL and i have connected them to 21 and 22 as in pin layout picture.

Question 1 is then, am I totally out of control, or is there a simple solution?
I hope for an answer that gives me folloving input/help:
SDA you connect to pin X
SCL you connect to pin Y
and in void loop you write: LoRa.setPins(?, ?, ?)

Thanks up front!
M

#include <SPI.h>
#include <LoRa.h> //https://github.com/sandeepmistry/arduino-LoRa

void setup() {
  Serial.begin(115200);
  Serial.println("LoRa Receiver");
  LoRa.setPins(18, 14, 26);  <-----------------------------------HERE IS FIRST QUESTION
  if (!LoRa.begin(433E6)) {
    Serial.println("Starting LoRa failed!");
    while (1);
  }
}

void loop() {
  // try to parse packet
  int packetSize = LoRa.parsePacket();
  if (packetSize) {
    // received a packet
    // Serial.print("Received packet ");

    // read packet
    while (LoRa.available()) {
      Serial.print((char)LoRa.read());
    }

    // print RSSI of packet
    Serial.print(" RSSI was: ");
    Serial.println(LoRa.packetRssi());
  }
}

Read this tutorial, the pin numbers might be slightly different, but the setup is better explained;

Note in particular the use of;

//SPI LoRa pins
  SPI.begin(SCK, MISO, MOSI, SS);
  //setup LoRa transceiver module
  LoRa.setPins(SS, RST, DIO0);

In setup();

There are details on how to use the pin allocations for the various TTGO models on their product support page, see the download links halfway down;

http://www.lilygo.cn/prod_view.aspx?TypeId=50003&Id=1271&FId=t3:50003:3

Before buying more hardware I suggest you view some tutorials on I2C, DHT20, DHT22, TTGO and Arduino as a starting point. This will give you an idea of what you have and how it works. You state: My DHT20 only have 2 pins SDA and SCL and i have connected them to 21 and 22 as in pin layout picture." That does not compute, your picture shows the device with 4 leads and no power to your system. Start drawing a schematic, not a frizzy picture and post that.

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.