Code will load and run once but not again

The device is supposed to connect to wifi, collect the readings of temperature/humidity, display them on the LCD screen, and then send the data to Firebase. The *** are in place of personal information. Any help would be appreciated.

When the Arduino UNO Rev 2 is connected via USB as the power supply, the code will upload and run. However, when the Ardunio is disconnected and then promptly connected via another power supply, i.e. 9V power supply via the adaptor, the program does not run. I have included the code below. Currently, there is the SHT31-D humidity and temperature sensor connected to the board, as well as, an LCD screen. Both are using have breakout boards for easier connection/wiring.

I am also having issues with powering the device. Currently, the sensor is using the 3.3V rail on the board to be powered and the LCD screen is using 5V on the board.

When you say "does not run" do you see the "Hello" message on the LCD?

The LCD screen will light up, however, it does not display anything. Occasionally it would display an "h".

Sounds like it is resetting, likely due to a power issue. I had similar issues when running servos and Arduino from same battery pack.

If it were me I would disconnect the LCD and sensor, download the Blink program, connect your 9V power and see if it blinks.

1 Like

Yes, that was my first thought process, just to ensure that the Ardunio is working correctly.

hopefully it clear how to externally power an Arduino (see Feeding power to Arduino)

i would try running a simple program, for example simply flashes the built-in LED (pin 13)

Will do. I have uploaded a vague wiring schematic above.

How did you solve this issue?

Yes, the Arduino blinks.

try connecting all the other devices and see if it still blinks

I decided to change out the sensor. The code works with an external power supply (batteries).

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