Big LoRa32u4 boards topic

P channel, high side switching is best, IRLML6402 is a P MOSFET that works well for 3.3V devices.

PMOSFET as Switch


Thanks Again @LoRaTracker. I asked a friend and sourced localy AO3413 which he said is equivalent. I’m building that circuit.
But don’t i need the oposite logic for my application? Ex: R2 as Pull Down? 47k Resistor to Ground instead of VCCIN? I need it disconnected when a sleep.

The P-Channel MOSFET in this circuit will only open (‘let through’) when control input is pulled low. To prevent uncontrolled switching/‘oscillating’ when no high or low input signal is present R2 is used pullup the gate to VCCIN.

You cannot make R2 a pulldown instead of a pullup because then VCCOUT would always be on if no high or low input signal is provided.

Well, if you want to turn that MOSFET on with a logic high, then you need a transistor inverter in front of the VCC_CONTROL pin, but whats so difficult about using a logic low to turn it on ?

The pullup to VCC is there for a couple of reasons, one of them to keep the devices your switching off as default when the the microcontroller restarts.

The 32u4 will preserve pin logic states when it’s asleep, so the external devices stay on or off depending on how you leave them.

1 Like

Remember that for typical technologies you must not apply any I/O voltages to the sensors when you de-power them. At best you’ll have power leak as the I/Os try to re-power the sensors, at worst you can get them in an inconsistent state or in theory even damage them.

So you need to take any I/Os that run to the sensors low before you remove power. And if you have any pull-up resistors, you need to disable those, too.

1 Like

Thank you for the schematic again, it works with the AO mosfet too. Pins stay high during deepsleep. But i’m still far from big gains. Just doubled from one week battery to 2 weeks on 800mah.
Soon i’ll reproduce the fet board and reduce the caps to 330nf and try to reduce the 150ms sleep in my schematic to 80ms after deep sleep. Can’t this BSFrance last longer? Are there better alternative boards? I just need lora + lipo batery + 2 analog pins to read 2 sensors.

I’m just reading with analog pins. Do i need to put them in output and low before deep sleep?

I am new to using loRa cards. I currently have two lora32u4 cards (V1.2 and v1.3). When I test my programs to read my sensors (BME280, SHTxx) in I2C, using the same program it works on the V1.2 card but not on V1.3. is this normal?

The boards are not identical and each requires different preparation/configuration.

  1. Read the start topic for differences between these boards.
  2. Have you configured the software correctly for each board?
  3. Have you wired the board(s) correctly (if needed - check start topic)?
  4. What software are you using?
  5. What exactly does not work?
  6. Provide details and don’t make others having to guess.

Hi, I’ve been trying to get my LoRa32u4 ii v1.2 board uploaded with standard blink sketch (“the hello world” of arduino). Im having major issues with getting anything uploaded. This is the error i consisstently get:

avrdude: butterfly_recv(): programmer is not responding
avrdude: butterfly_recv(): programmer is not responding
avrdude: butterfly_recv(): programmer is not responding
avrdude: butterfly_recv(): programmer is not responding
avrdude: butterfly_recv(): programmer is not responding
Found programmer: Id = ""; type = 
    Software Version = .; Hardware Version = .
avrdude: butterfly_recv(): programmer is not responding
avrdude: butterfly_recv(): programmer is not responding
avrdude: error: buffered memory access not supported. Maybe it isn't
a butterfly/AVR109 but a AVR910 device?
avrdude: initialization failed, rc=-1
         Double check connections and try again, or use -F to override
         this check.

avrdude: butterfly_recv(): programmer is not responding
avrdude: error: programmer did not respond to command: leave prog mode
avrdude: butterfly_recv(): programmer is not responding
avrdude: error: programmer did not respond to command: exit bootloader

Ive checked/tried the following:

  • the same usb cable works with other arduinos
  • ive tried the adafruit board
  • ive tried the bsfrance board
  • port is properly selected

Another detail, the LED on my board keeps pulsating regardless if im uploading or not. Ive tried reseting and uploading and double clicking reset and long pressing reset. nothing seems to work

Any help much would be much appreciated.

forgot to mention, ive never seen anything getting outputted to the serial monitor. Ive been doing aloot of arduino over the years and no newbie…this is the first board i have not been able to get working

What IDE (Arduino, PlatformIO, other) are you using and which version?
What board have you selected in the IDE and which Arduino Core are you using (in Arduino IDE check with Boards Manager)?

Which LED, the orange power or the white user LED?

Which board exactly?
Selected as board in the IDE or did you use a real Adafruit board (and if so what was the result)?
Have you succesfully flashed any ATmega32u4 before or is this your first 32u4 experience?

  • ive tried both arduino ide and platform io (both latest version)
  • im on osx 10.15.1
  • white user LED
  • ada feather 32u4
  • my first 32u4 experience that i can remember

im starting to think my bootloader is missing or corrupt somehow. Whats the best way to load a new boatloader for the LoRa32u4 ii (bsfrance)?

If the white LED is already blinking then the Blink sketch is already working… :sunglasses:
(just kidding)

That also came to my mind as a possibility.

I have no experience with putting a bootloader on the BSFrance LoRa32u4.
The site is currently not available (nginx bad gateway error) so not possible to look for support there. They also do not have a bootloader available on GitHub.

It’s possible that an Adafruit Feather 32u4 bootloader would work but I’m not sure.
Probably the easiest to get it onto your board is use the Arduino IDE, use the Adafruit AVR Boards Arduino core and select the Adafruit Feather 32u4 board and then use Burn bootloader from the tools menu. This does require a suitable programmer though, e.g. USBasp (uses SPI for firmware upload) to upload the bootloader to the board.

The (Caterina) bootloader hex file is already included in the Arduino core.

k. ill try that. thx!! : )

Just to be sure … Did you play with reset?

Dear all,

First of all, I would like to thank for the post because it has helped me a lot during my first steps with LoRaWAN and my BSFrance LoRa32u4 II module.
On the other hand, I am a little frustrated with the progress since I cannot get my device to work properly and that is why I would greatly appreciate it if someone could help me.
The idea I had is very simple, to be able to send the temperature and humidity data with the DHT22 sensor to TTN. The BSFrancee board version that I have is 1.3.
First of all I started with the LMIC library but from what I saw and have read in several posts, it is a problem since it takes up a lot of memory and the microcontroller does not have much memory (32KB). Therefore, for future projects and with the idea of expanding the project with more sensors it would surely be a problem.
On the other hand, I have used the TinyLora library that is presented in the Adafruit tutorial and I have seen that the memory used was much less, around 10KB, so it is ideal.
However, in TTN I only receive the first message. I have to disconnect the node and reconnect it to receive a new message, but the same thing happens, messages are not send one after the other. In the serial port it remains in the print “Sending LoRa Data …”, so I understand that there is a problem in the code in the following part. I add the lines of code in this part (although it can be seen in the sketch “tinylora_dht22.ino” from the TinyLora library):

" Serial.println(“Sending LoRa Data…”);
lora.sendData(loraData, sizeof(loraData), lora.frameCounter);
Serial.print("Frame Counter: “);Serial.println(lora.frameCounter);

I would greatly appreciate your help :smiley:.

I am not familiar with TinyLora but IIRC it is not (fully) LoRaWAN compliant.

For more advanced applications the ATmega32u4 in combination with SPI LoRa module and LMIC is indeed limited due to its limited resources.

We have a successful project with this device for a long time now. Not sure if the github is very up to date. There is a doc folder to explain things in depth.

To be honest, in this topic there was earlier feedback on my project. Most of it boils down to a question whether the code is still supported. And clearly a number of people looked into the code inside our minimized library - not too happy that what we have does not follow all rules. We would like to see a clean-up but suggestion was to go to a better cpu. There it is, the version is what it is now. I love this brave little device.

Search github for juniorIOT or look at our page

Thanks for your messages @bluejedi @marcovanschagen. I have reviewed the code and it seems that I have already detected the problem :sweat_smile:. First of all it was a pin maping bug of mine and on the other hand, I hadn’t deleted the line of code “// while (! Serial);” and therefore the messages were only sent once the serial port was connected open. Now it works perfectly and I am receiving the data in TTN. Thanks for the information @marcovanschagen , it is a very interesting and complete project of yours. I have seen that you also propose the MH-Z19 sensor but there was no information yet. I used it a few years ago so if you need I could dust off what I had.

Thank you, I hope it helps you. The MH-Z19 we have used in a different project, but not needed to use in this context. Hence the reference as a reminder.

Thank you!