1

I am working on a project with Arduino MKR 1400 GSM and I would like to power the arduino board using an external power source (https://www.reichelt.de/raspberry-pi-netzteil-5-1-v-3-0-a-usb-type-c-eu-stecker-s-rpi-ps-15w-bk-eu-p260010.html?PROVID=2788&gclid=CjwKCAjwy7CKBhBMEiwA0Eb7ah0tvjJTgi1IruE69oZEm51ONn9dgkCZK45JE1EU5hNgoXfJ1CA8NBoCJLgQAvD_BwE) via the VIN pin without an additional 3.7V battery.

I have copied the code that I am using and the board resets and restarts every time the board tries to initiate GSM connection (gsmAccess.begin(PINNUMBER) == GSM_READY). According to the documentation, this operation needs more current and the board restarts when it does not get enough current for this operation and 5V 3A power supply should be enough to power the board for cellular transmission without the need for an additional battery. However, I am not able to start GSM connection with this power source. I have cut the micro USB end and connect GND from the power source to GND on the arduino board and VCC from the power source to 5V/VIN on the arduino board. As mentioned, the board is not able to initiate the GSM connection with this set up.

I have gone through all the suggestions on the forum and I have not been able to resolve this. Could you please let me know the best way to power the arduino MKR 1400 GSM via VIN such that GSM connection is initiated.

The board works with the additional 3.7V battery (https://www.amazon.de/VinCorp-2500mAh-Stecker-Empf%C3%A4nger-Quadrocopter/dp/B0863PZPSM/ref=asc_df_B0863PZPSM/?tag=googshopde-21&linkCode=df0&hvadid=447410901006&hvpos=&hvnetw=g&hvrand=1221952135560228729&hvpone=&hvptwo=&hvqmt=&hvdev=c&hvdvcmdl=&hvlocint=&hvlocphy=9044320&hvtargid=pla-925522392231&psc=1&th=1&psc=1)

Please let me know if you need more information from my side.

Please ignore the values given for the variables server and path

#include <MKRGSM.h>
#include <ArduinoHttpClient.h>
#include <ArduinoJson.h>
// PIN Number

const char PINNUMBER[]     = "";

const char GPRS_APN[]      = "";
const char GPRS_LOGIN[]    = "";
const char GPRS_PASSWORD[] = "";


GSMClient client;
GPRS gprs;
GSM gsmAccess;
String currentBarcode;


char server[] = "test.net";
char path[] = "/test";
int port = 80;


StaticJsonDocument<200> jsonBuffer;
HttpClient httpClient = HttpClient(client, server, port);
JsonObject root = jsonBuffer.to<JsonObject>();
int count = 0;

void setup() {
  Serial.begin(9600);
  boolean connected = false;
  while (!connected) {
    if ((gsmAccess.begin(PINNUMBER) == GSM_READY) &&
        (gprs.attachGPRS(GPRS_APN, GPRS_LOGIN, GPRS_PASSWORD) == GPRS_READY)) {
      connected = true;
    } else {
      delay(1000);
    }
  }
}

void loop() {
  root["boxid"] = "Test";
  root["gtin"] = "Test";
  if (client.connect(server, port)) {
    postToWia(root);
    delay(1000);
  } else {
  }


  if (!client.available() && !client.connected()) {
    client.stop();
    for (;;)
      ;
  }
}

void postToWia(JsonObject& data) {
  String dataStr = ""; 
  serializeJson(data, dataStr);
  httpClient.beginRequest();
  httpClient.post(path);
  httpClient.sendHeader("Content-Type", "application/json");
  httpClient.sendHeader("Content-Length", dataStr.length());
  //httpClient.sendHeader("Authorization", "Bearer " + String(device_secret_key));
  httpClient.beginBody();
  httpClient.print(dataStr);  
  httpClient.endRequest();

}
sud.ng7
  • 31
  • 4
  • Do you have a multimeter? Are you able to measure the current draw on the VIN pin at the time of the GSM connection. Firstly using the battery (working scenario) then using the modified wall wart (failing scenario). – RowanP Sep 29 '21 at 11:56
  • 1
    Thank you for the response, the multimeter fluctuates between 400mA and 600mA when I power the arduino using the modified wall wart (rated 5V, 3A). When I connect an additional battery (3.7V LiPo battery) to this set up, the multimeter reads 900mA and the GSM handshake is successful. Is it possible that the flow of current is regulated when powered through the VIN pin. As mentioned, I would like to remove the dependency on the battery. Please let me know if you need more information from my side. – sud.ng7 Sep 29 '21 at 12:22
  • USB C wall warts can be pretty sophisticated these days (e.g., with USB power delivery variable output). Are you sure that after chopping off the USB-C plug, that your wall wart is still making 3A available? Do you have a test load you could try it on? I >think< the RPi wall wart you referenced is an old school straight supply, but given your failure scenario it might be good to test? – RowanP Sep 29 '21 at 12:24
  • The MKR 1400 GSM (https://store-usa.arduino.cc/products/arduino-mkr-gsm-1400) is specifically designed to take a higher current in the VIN pin for the scenario you describe. My suspicion is that the limitation is the modified wall wart, not the Arduino. – RowanP Sep 29 '21 at 12:30
  • I have tried this with different adapters as well. I used a samsung adapter(5V, 2A), apple charger (5V, 1A) and Amoner adapter (5V, 3A) without any success. – sud.ng7 Sep 29 '21 at 12:38
  • Fiddling with this sort of problem is why I invested in a bench power supply. A handy bit of kit for testing and figuring out power requirements. – RowanP Sep 29 '21 at 13:07
  • Thank you for the response, do you have any recommendation how I can achieve the required current in my setup. According to the documentation this should work however, I am not sure what I am doing wrong. – sud.ng7 Sep 29 '21 at 13:16
  • I think you are on the right track. Maybe try your Amoner adapter and again measure the current drain. Adding some pictures of your setup and the details of your measurements to your question may assist someone else to identify what’s going on . – RowanP Sep 29 '21 at 13:34

0 Answers0