sparkfun / SparkFun_IridiumSBD_I2C_Arduino_Library

An Arduino library to support Short Burst Data communication using the Iridium 9602 and 9603N over both Serial and I2C
GNU Lesser General Public License v2.1
15 stars 12 forks source link

Sleep Pin (on/off control) in RockBLOCK 9603 v3.F #15

Closed alexburgis closed 1 year ago

alexburgis commented 1 year ago

Due to supply-chain shortage, some components in RockBLOCK 9603 3.F have been replaced with alternatives. This does not adversely affect the normal operation of the device.

Because of these component changes, 3.F now includes a transistor circuit on the On/Off control pin to ensure correct power up at all supply voltages. The On/Off control pin should not be clamped below the RockBLOCK supply voltage and should be disconnected/left floating to turn on.

Potential issue: This change has introduced an issue when interfacing directly to a 3V3 microcontroller pin while supplying the RB with 5V. The new On/Off circuitry now provides a high impedance (1Meg resistor) to the super cap voltage, equal to the supplied voltage. This may exceed the maximum IO voltage of the micro.

If the RB was supplied by 5V, the connecting device should also be 5V tolerant. If not, it is recommended to use an interfacing circuit, eg MOSFET, transistor, relay, etc. to connect to a microcontroller.

More info:

https://docs.rockblock.rock7.com/docs/power-supply#onoff-control

PaulZC commented 1 year ago

Hi Alex (@alexburgis ),

Good to meet you. Thanks for the update. We were aware of the issue and have been working with @adamgarbo to resolve it on his equipment.

In this library, the setSleepPin function is weak. Users can overwrite it if they want to or need to. As you say, a solution for the RockBLOCK 3.F and 3.3V microcontrollers is to insert an open-drain N-MOSFET or open-collector NPN transistor between the IO pin and the RockBLOCK On/Off pin. You can then invert the IO pin output inside setSleepPin by including the following code:

void IridiumSBD::setSleepPin(uint8_t enable)
{
   if (enable == HIGH)
  {
      digitalWrite(this->sleepPin, LOW);  // LOW = awake. Inverted by N-MOSFET
      diagprint(F("AWAKE\r\n"));
   }
   else
   {
      digitalWrite(this->sleepPin, HIGH); // HIGH = asleep. Inverted by N-MOSFET
      diagprint(F("ASLEEP\r\n"));
   }
}

I'm going to close this issue, but pin it to make it easier for users to find.

Very best wishes, Paul