Hi community,
If I supply the board with power via USB, it works without any problems. However, if I supply it via an external energy source (e.g. a 5V battery) (VIN and GND), the init function starts continuously in the loop. I have built in an extra LED signal to check this. While it only signals once (and correctly) with USB, it does so continuously with the external source and then of course doesn't work either. What am I doing wrong?
Many thanks in advance for your help!
Do you have while(!Serial....) inside your setup()?
This particular lines checks connection to the USB, and if there is no USB connection (like when powering from an external source), well you are stuck...
Thank you for your answer, I will test it and let you know here if it worked.
Hi @hzrnbgy,
I tried what you suggested and also found it in the Arduino documentation, but the effect remains the same. I don't understand what I'm doing wrong.
Here is the code:
void setup() {
// Initialize serial and wait for port to open:
Serial.begin(9600);
// This delay gives the chance to wait for a Serial Monitor without blocking if none is found
delay(1500);
// Defined in thingProperties.h
initProperties();
// Connect to Arduino IoT Cloud
ArduinoCloud.begin(ArduinoIoTPreferredConnection);
setDebugMessageLevel(2);
ArduinoCloud.printDebugInfo();
pinMode(LED_BUILTIN, OUTPUT);
startupy(); // LED-Signal for testing that I'm arriving here (I see it!)
while (!Serial) {
; // Do nothing waiting for the serial port
}
}
Thank you for any suggestions
If the board will not be connected to a computer running serial monitor, take out these lines:
while (!Serial) {
; // Do nothing waiting for the serial port
}
If it really is rebooting, that is an issue with the power supply, or a serious error in the code you forgot to post.
Thank you @jremington for your answer. The code is exactly the one I posted, so that can't be the problem. I also tried removing the serial check, but nothing changed. Is it possible that 5V is too much or too little for the device?
Please post a link to this power source. There is no such thing as a 5V battery, but there are 5V power packs, which contain electronic circuitry.
Hi @jremington,
Please excuse me for not having expressed myself correctly. You are of course right that there are no 5V batteries. I use the part that came with an Arduino starter kit as an external power source. I'll attach two photos so you understand what I mean. The first photo shows the whole part, the second photo shows in detail that I have set the jumper to 5V. Thanks again for your help.
This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.