I'm using Arduino Uno as my microcontroller, but I got a strange behavior. I need to run several function at the same time. One to get GPS and temperature value then send every value to user's phone number when a request received by SIM800L GSM module, and another to display those value on I2C LCD. Everything works fine when my USB port connected to my computer. But when I tried to unplug the USB and using external power source from Li-Po battery I can't get a response from SIM800L module whenever I send a request message.
When I tried to create a separate program (just received a request message and then sent a response by SIM800L) it works fine even though using external power supply (Li-Po battery) without USB port plugged in. Another strange behavior is when I was using both of Li-Po battery and USB port connected then unplugged the USB port it works fine again. But when I unplugged my battery and then plugged it again without USB port connected, SIM800L couldn't send a response. What is wrong ?
What made you think that your question has anything to do with the Website and Forum section which is clearly stated to be for "Improvements for the web system, applications to moderator, spam, etc."? I have suggested to the Moderator to move it to the Programming section.
This sort of carelessness makes unnecessary work for the Moderators.
johnwasser:
It sounds like more of a power problem than a software problem. How is the battery connected to the Arduino and SIM800l (and any other peripherals)?
I'm connecting my battery to a 5V step-down and then I'm supplying 5V Arduino pin from the output of that step-down. I'm not directly connecting step-down output to the 5V and GND pin of Arduino but put it first on a bread-board because I want to supply another sensor pin too. What is the proper way to handle this wiring?
A schematic showing how you have everything hooked up as well would be useful in diagnosing the issue.
Have you tried pressing the reset button after connecting? I've had the same issue with knock-off arduino uno's where they will wait for serial over USB before running...
Which brings me to another question: have you tried removing the Serial.begin() and print commands so that it isn't trying to interface with the computer over the serial port? Have also had issues with this and knock-off boards trying to connect but can't and then hang.
It's here right under setup:
Serial.begin(9600);
Now some concerns:
LiPo is not something to mess around with if you don't have protection for the battery. You could cause a fire and seriously get injured or injure someone if it over discharges.
A lot of buck-converter style boards have an adjustment potentiometer to change the voltage that is supplied. They are highly efficient but if this board has an adjustment, it could be off spec.
Check to make sure that the converter board you are using can supply everything with enough current.
Supernovali:
A schematic showing how you have everything hooked up as well would be useful in diagnosing the issue.
Have you tried pressing the reset button after connecting? I've had the same issue with knock-off arduino uno's where they will wait for serial over USB before running...
Which brings me to another question: have you tried removing the Serial.begin() and print commands so that it isn't trying to interface with the computer over the serial port? Have also had issues with this and knock-off boards trying to connect but can't and then hang.
It's here right under setup:
Serial.begin(9600);
Now some concerns:
LiPo is not something to mess around with if you don't have protection for the battery. You could cause a fire and seriously get injured or injure someone if it over discharges.
A lot of buck-converter style boards have an adjustment potentiometer to change the voltage that is supplied. They are highly efficient but if this board has an adjustment, it could be off spec.
Check to make sure that the converter board you are using can supply everything with enough current.
This is a simple schematic wiring of how do I power up my Arduino Uno and another part. But in this schematic I don't put my LCD-I2C yet
Welcome to the forums. You will find a lot of regulars here who just want to help. In the future, please don't call a Fritzing Lego picture a "schematic". As your projects get more complex, the Fritzing pictures are less useful to useless.
You didn't say which bucking voltage converter that you are using, but I'll guess that it doesn't have the capacity your Arduino and peripherals need.
If I am correct, plugging a 9V battery into the barrel power connector should solve the problem. And unplug the 5V from the Uno to the breadboard since the Arduino would be powered separately.
In general the Arduino boards can only supply enough current from the 5V pin reliably for a few LEDs, or one display, or one micro servo.
Glad you were able to figure it out! Also, in your final version, make sure to remove all Serial.xxx commands. That will help make sure you don't have to reset it every time there is a power cycle. (USUALLY, again, watch out for the knock-off boards).
Now please, for your safety, if you don't already have a protection circuit, put one together.
And, yes, if you can draw some schematics or use a schematic builder, that would be helpful in the future. I personally still like drawing my schematics. There is this awesome product I think all proto-typers should use called a Rocket Notebook which allows you to draw your schematics and then use your phone to automatically upload it to your drive service. Then you use water and a towelette to clean the page and reuse it.
I've attached an image so you can see what one of my schematics look like
What exactly is it about the knockoff Arduinos that makes pressing the reset button necessary? It would seem to be a bootloader issue that could be fixed by burning the right bootloader. Is that right?
Not quite sure. But yeah, I've tried a couple boot loaders that help resolve this issue. Wish I knew but I dont feel like reverse engineering what's going on haha. I do know the Serial.begin() on the knock-offs, depending on who it is, is a surefire way to get it to hang during a power cycle. Without it, it just comes down to the hardware design.
Rule of thumb tho is if you are done debugging, remove serial commands unless you can test and reset the arduino from software.
Supernovali:
Not quite sure. But yeah, I've tried a couple boot loaders that help resolve this issue. Wish I knew but I dont feel like reverse engineering what's going on haha. I do know the Serial.begin() on the knock-offs, depending on who it is, is a surefire way to get it to hang during a power cycle. Without it, it just comes down to the hardware design.
Rule of thumb tho is if you are done debugging, remove serial commands unless you can test and reset the arduino from software.
Thanks for your suggestion. I can remove all of those Serial.xxx except Serial.begin because I still need that for my GPS You might now that we can't use 2 software serial in one program. Actually I have to replace my Arduino Uno with Arduino mega or teensy instead because they have more than 1 serial pin but I can't do this because of budget limitation
dinihuygens:
Thanks for your suggestion. I can remove all of those Serial.xxx except Serial.begin because I still need that for my GPS You might now that we can't use 2 software serial in one program. Actually I have to replace my Arduino Uno with Arduino mega or teensy instead because they have more than 1 serial pin but I can't do this because of budget limitation
dinihuygens:
Thanks for your suggestion. I can remove all of those Serial.xxx except Serial.begin because I still need that for my GPS You might now that we can't use 2 software serial in one program. Actually I have to replace my Arduino Uno with Arduino mega or teensy instead because they have more than 1 serial pin but I can't do this because of budget limitation
I've never tried it, but this link suggests you can use two software serial ports on the Uno if you don't use them at the same time:
Serial is only an object in the Arduino IDE. You can make multiple serial objects. If you are using the same serial for your sensors as you are for the usb port. You can get unpredictable results if one hasnt cleared the buffer and another one starts reading/writing. In order to prevent this, do a Serial.begin() for the serial monitor, then do something like GPSserial.begin() for your gps serial so the buffers dont get scrmabled.