Hello folks,
I am trying to put my Arduino WAN 1310 into deep sleep, this Arduino uses the SAMD21 processor. I have a circuit that uses multiple sensors but I am starting with one sensor at a time to investigate the deep sleep behaviour.
```
void setup()
{
/// Force one SERCOM to be configured as a UART
Serial1.begin(9600);
// Disconnect sensor power lines only
enablePower(A4, false);
USBDevice.detach();
LowPower.deepSleep(5000);
}```
The enable pin is code used to turn on a pin of the Arduino, it will eventually apply a signal to a MOSFET to switch on power to the sensor.
But no sensor connected just now.
The Arduino is powered by a battery and I am measuring the current draw.
I was noticing some interesting behaviour when printing statements to the serial port. I am using serial1 and using a USB to 485 converter that has two wires, tx and rx that go to the Arduino.
Now even though I am not printing anything to Putty here is what I find.
1. With serial1 in the code, and with the tx and rx wires connected to the Arduino, I get a sleep current of 69uA.
2. With serial1 in the code but the tx and rx wires disconnected, I get a sleep current of 400uA.
3. With serial1 commented out, but with the tx and rx wires connected, I get a sleep current of 200uA.
I really want the lowest sleep current possible. I do not know why serial1 is causing a lot of extra sleep current in different configurations. Any help to figure out what is going on here and on how to minimise the sleep current would be greatly appreciated. Thank you in advance. I have videos of the current consumption too if you would like to see them, I also have a thread on discord regarding the matter.
https://discord.com/channels/420594746990526466/1061989174841970718