5V power does not start a sensor wothout reset button

I've discussed this topic in the Covid area, but we can't get to the bottom of it, and it seems to be a specific Every issue. Apologies to those who participate in both areas, I'm closing the other thread.

I am developing a CO2 monitor for classrooms. My setup works with a Nano Every, and connects to an RTC, a microSD card reader, a DHT22 temp/humidity sensor and three CO2 sensors. That works well with a USB power source. When connecting a 9V walwart to Vin and Gnd it all works except the DHT22 sensor. I replaced the sensor, no change. I measured voltages and get 4.8V where I expect 5V and 3.28V where I expect 3.3V.

An advise was to replace the 9V with a +5V/Gnd pin to a 5V regulated power supply. No change.

I was asked and tested without the CO2 sensors connected, a very good question, for an unexpected reason. The short answer is "yes", the DHT22 sensor works without the CO2 sensors. But I noticed that when I switched from the 5V power supply to the USB that the non-functioning temp sensor would remain non-functioning. It would come on after pushing the reset button on the Nano Every. So I wired all sensors up again, runs fine from USB (no surprise). Swap to 5V and the temp sensor reports 0. Reset button once: same zero result. Reset button again: temperature reading is working.
Reset button again: good temp reading.
Power cycle: zero reading. Reset button: good temp reading.
Power cycle, with 15 seconds wait time before reconnecting: zero reading. Reset button: temp ok
Power cycle, with 2 minutes wait time: zero reading. Reset button: temp ok.

My question: what is different in the power-up process when using 5V as opposed to USB? Or am I overlooking something?

Thanks for all suggestions, Hubert

I've checked your previous posts and it looks like you have these devices connected:

One RTC: 1mA
One microSD card reader: 80mA to 200mA
Four CO2 detectors: 125mA + 155mA + 85mA + 60mA totals to 425mA
One DHT22 temp/humidity sensor: 2mA

Total load current = 508 to 628mA (this doesn't include the Nano Every)

Note that the microSD card reader draws considerable current - this current varies based on what its doing - initializing, reading, writing, idle.

Note that even though the Nano Every has a 1.2A rated DC-DC converter, thermal shutdown may kick in at a much lower current than this. (there's is no visible cooling copper areas on the circuit board).

If you've tried an external 5V supply and its rated for 500mA, then this is insufficient and could cause intermittent issues. I would use a 1A or 2A (preferred) rated 5V supply.

You should use a separate ground wire for each device ... all connecting to a common point at the DC supply. Its good practice not to connect from one ground to the next as this will create a ground loop.

Thank you DLoydd, also for making the effort the read the other posts,

The power supply is 3A. And I indeed have the 5V and the Gnd wire from every sensor to the ground wire on the board.

I measured temperatures: 25-30C for the Every(using a Flir camera), which I assume is fine (it is 28C in the room).

I'm not experiencing a shutdown though, just the one sensor not starting until I push the reset button.

Do you have suggestions at what I can/should be looking at?

--Hubert

And I indeed have the 5V and the Gnd wire from every sensor to the ground wire on the board.

I meant to the DC supply, like this:

I’m not experiencing a shutdown though, just the one sensor not starting until I push the reset button.

Maybe now this issue will be resolved, especially since it didn’t happen with USB power.

Perhaps there be something that could be improved in your code.

Hmm … I wonder if everything works if the SD Card is temporarily disconnected (as a test).

I guess if the problem persists, it would be good to get a link to the sensor’s datasheet and post your circuit diagram and code.

Thanks again, I will test your suggestions and report back, that could take a day or so. This thing called "work" keeps getting in the way :slight_smile:

I found a bit of time, here's what I did:

Yes, the wiring is as per your drawing. The problem persists on multiple units.

SD Card: I disconnected it, took the code out, also the libraries, no difference the DHT22 doesn't start until a reset button click.

I'm almost done with my diagram. I will post it when I'm ready.

Do you really want to read 1000 lines of code?
For completeness, I get the warning "candidate 1: uint8_t TwoWire::requestFrom(int, int) .... candidate 2: virtual uint8_t TwoWire::requestFrom(uint8_t, size_t) - I understands where it comes from and have put the right parameter formats (uint8_t) in my code. After the first compile the warning does not return. I don't believe that it has to do with my problem, but would like to be corrected if it does.

The schematic of the sensor (ignore the LED, it is not present):

In the datasheet for the DHT22, it shows a much stronger pullup resistor (1K) for the data line.

Shoot, I know better then to just copy a picture from the interwebs. Value says 472 - 4k7 for the pull-up.

While the DHT22 doesn't mention start up time, the lower accuracy DHT11 does, and you are need to wait 1 second before it is capable of accepting a command. Perhaps the DHT22 is the same? In that case the extra delay performing the reset might be why it works when you perform a reset.

Just try adding delay(1000) at the top of the setup function and see if that fixes it.

That works! I will keep testing on other units, but where I was able to recreate the problem, now I cannot. Woohoo!

I’ll read another chapter from your books tonight, as a thank-you :slight_smile:

–Hubert