ESP32 CAM wiring

How do I add a boost convertor 3.7V- 5 V to the wiring diagram?


Thank you to Max imagination for the image I found on Instructables.

Will it 100% prevent the microcontroller and the TP4056 module to not burnout?

Thank you!

You place it between the switch and LED. Consider also buck converter if 5V is not needed on your circuit.

No, it's not a magical protection device.

how do i 100% protect from burningout

also how do i add a lora to the diagram

Its possible to add and SPI based LoRa module, but only just, since the number of available GPIO pins is very restricted, especially if the SD card is in use.

Might be easier to add one of the UART based LoRa modules then you only need a TX and an RX GPIO pin.

A description of the available GPIO issues on an ESP32CAM is here;

https://stuartsprojects.github.io/2021/11/27/StuartCAM-ESP32CAM-Getting-the-SD-to-Work.html

For what reason?
Doesn't matter since that circuit won't work anyway.

ok , i found it online from a person who supposedly made it
I need to add because the esp32 Cam needs 5V not 3.7 V

Which boost converter do you plan to use?

3.7 V to 5 V boost convertor

Will it supply enough current for the ESP32 cam?

acording to sources i found online

Like this:

I have use the following ESP-CAM pins to connect a RFID reader using SPI

// for ESP32-CAM
#define SCK  14
#define MISO  12
#define MOSI  13
#define CS  15      // RFID-RC522 SDA pin

therefore could probably work with a SPI LoRa module

With an SX127X library used that does not need to read the DIOX pin for TX or RX complete then maybe.

And does not need access to the NRESET pin.

The more modern SX126X modules need an additional GPIO pin, BUSY, too.

And major issues if you want to attempt to use the SD card.

Of course, with no SD card in use, no significant issues, you have access to GPIO 2, 4, 12, 13,14,15 and even 16 if your not using PSRAM.

1 Like

Thank you!!!!

You are welcome
Have a nice day!

1 Like

as an experiment connected a Heltec HT_RA62_SX1262 LoRa module to an ESP32-CAM
code

// ESP32-CAM - Heltec HT_RA62_SX1262 _Transmit_Interrupt
// Tools>Board AI Thinker ESP32-CAM

// File>Examples>RadioLib>SX126x>SX126x_Transmit_Interrupt

// EDITs:
//  radio.begin frequency set to 868.0
//  transmitting byte array and printing it

/*
  RadioLib SX126x Transmit with Interrupts Example

  This example transmits LoRa packets with one second delays
  between them. Each packet contains up to 256 bytes
  of data, in the form of:
  - Arduino String
  - null-terminated char array (C-string)
  - arbitrary binary data (byte array)

  Other modules from SX126x family can also be used.

  For default module settings, see the wiki page
  https://github.com/jgromes/RadioLib/wiki/Default-configuration#sx126x---lora-modem

  For full API reference, see the GitHub Pages
  https://jgromes.github.io/RadioLib/
*/

// include the library
#include <RadioLib.h>
// for ESP32-CAM
#define SCK  14
#define MISO  2
#define MOSI 15
#define CS   13      // 

// HT_62  SX1262 has the following connections:
// NSS pin:   15
// DIO1 pin:  16
// NRST pin:  not used
// BUSY pin:  12
SX1262 radio = new Module(CS, 16, -1, 12);

// or detect the pinout automatically using RadioBoards
// https://github.com/radiolib-org/RadioBoards
/*
#define RADIO_BOARD_AUTO
#include <RadioBoards.h>
Radio radio = new RadioModule();
*/

// save transmission state between loops
int transmissionState = RADIOLIB_ERR_NONE;

// flag to indicate that a packet was sent
volatile bool transmittedFlag = false;

// this function is called when a complete packet
// is transmitted by the module
// IMPORTANT: this function MUST be 'void' type
//            and MUST NOT have any arguments!
//#if defined(ESP8266) || defined(ESP32)
ICACHE_RAM_ATTR
//#endif
void setFlag(void) {
  // we sent a packet, set the flag
  transmittedFlag = true;
}

void setup() {
  Serial.begin(115200);
  delay(2000);
  // initialize SX1262 with default settings
  Serial.print(F("\n\nHT_62 [SX1262] Initializing ... "));
  SPI.begin(SCK, MISO, MOSI, CS);  // set up SPI pins
  int state = radio.begin(868.0);
  if (state == RADIOLIB_ERR_NONE) {
    Serial.println(F("success!"));
  } else {
    Serial.print(F("failed, code "));
    Serial.println(state);
    while (true) { delay(10); }
  }

  // set the function that will be called
  // when packet transmission is finished
  radio.setPacketSentAction(setFlag);

  // start transmitting the first packet
  Serial.print(F("[SX1262] Sending first packet ... "));

  // you can transmit C-string or Arduino string up to
  // 256 characters long
  transmissionState = radio.startTransmit("Hello World!");

  // you can also transmit byte array up to 256 bytes long
  /*
    byte byteArr[] = {0x01, 0x23, 0x45, 0x67,
                      0x89, 0xAB, 0xCD, 0xEF};
    state = radio.startTransmit(byteArr, 8);
  */
}

// counter to keep track of transmitted packets
int count = 0;

void loop() {
  // check if the previous transmission finished
  if (transmittedFlag) {
    // reset flag
    transmittedFlag = false;

    if (transmissionState == RADIOLIB_ERR_NONE) {
      // packet was successfully sent
      Serial.println(F("transmission finished!"));

      // NOTE: when using interrupt-driven transmit method,
      //       it is not possible to automatically measure
      //       transmission data rate using getDataRate()

    } else {
      Serial.print(F("failed, code "));
      Serial.println(transmissionState);
    }

    // clean up after transmission is finished
    // this will ensure transmitter is disabled,
    // RF switch is powered down etc.
    radio.finishTransmit();

    // wait a second before transmitting again
    delay(1000);

    // send another one
    Serial.print(F("[SX1262] Sending another packet ... "));

    // you can transmit C-string or Arduino string up to
    // 256 characters long
    //String str = "Hello World! #" + String(count++);
    //transmissionState = radio.startTransmit(str);

    // you can also transmit byte array up to 256 bytes long
    static byte byteArr[] = { 0x01, 0x23, 0x45, 0x67,
                              0x89, 0xAB, 0xCD, 0xEF };
    for (int i = 0; i < sizeof(byteArr); i++)
      Serial.printf("%d ", byteArr[i]);
    transmissionState = radio.startTransmit(byteArr, 8);
    byteArr[0]++;
  }
}

Heltec HT_RA62_SX1262 serial monitor output

HT_62 [SX1262] Initializing ... success!
[SX1262] Sending first packet ... transmission finished!
[SX1262] Sending another packet ... 1 35 69 103 137 171 205 239 transmission finished!
[SX1262] Sending another packet ... 2 35 69 103 137 171 205 239 transmission finished!
[SX1262] Sending another packet ... 3 35 69 103 137 171 205 239 transmission finished!
[SX1262] Sending another packet ... 4 35 69 103 137 171 205 239 transmission finished!
[SX1262] Sending another packet ... 5 35 69 103 137 171 205 239 transmission finished!
[SX1262] Sending another packet ... 6 35 69 103 137 171 205 239 transmission finished!
[SX1262] Sending another packet ... 7 35 69 103 137 171 205 239 transmission finished!
[SX1262] Sending another packet ... 8 35 69 103 137 171 205 239 transmission finished!
[SX1262] Sending another packet ... 9 35 69 103 137 171 205 239 transmission finished!
[SX1262] Sending another packet ... 10 35 69 103 137 171 205 239 transmission finished!

Heltec LoRa V2 SX1276 [SX1276 receiver

Heltec LoRa V2  SX1276  [SX1276] Initializing ... success!
[SX1276] Starting to listen ... success!
[SX1276] Received packet!
[SX1276] Data:		3 35 69 103 137 171 205 239 
[SX1276] RSSI:		-58.00 dBm
[SX1276] SNR:		13.00 dB
[SX1276] Frequency error:	-4104.13 Hz
[SX1276] Received packet!
[SX1276] Data:		4 35 69 103 137 171 205 239 
[SX1276] RSSI:		-59.00 dBm
[SX1276] SNR:		9.75 dB
[SX1276] Frequency error:	-4099.93 Hz
[SX1276] Received packet!
[SX1276] Data:		5 35 69 103 137 171 205 239 
[SX1276] RSSI:		-59.00 dBm
[SX1276] SNR:		10.25 dB
[SX1276] Frequency error:	-4099.93 Hz
[SX1276] Received packet!
[SX1276] Data:		6 35 69 103 137 171 205 239 
[SX1276] RSSI:		-60.00 dBm
[SX1276] SNR:		9.75 dB
[SX1276] Frequency error:	-4099.93 Hz
[SX1276] Received packet!
[SX1276] Data:		7 35 69 103 137 171 205 239 
[SX1276] RSSI:		-59.00 dBm
[SX1276] SNR:		9.75 dB
[SX1276] Frequency error:	-4104.13 Hz

NOTE: the 3.3V output of the ESP32-CAM was insufficient to power the HT-RA62 transmitter - it initialised OK and attempted to transmit the first message but the "transmission finished!" message never appeared
had to power the HT-RA62 from an external 3.3.V supply