2
\$\begingroup\$

I designed a PCB with a SIM868 module for data transmission. On the PCB, the MCU resets randomly on transmission start of the SIM module. On a breadboard setup, it worked just fine, even without caps. The following parts are on the PCB:

  • ATmega328p - MCU
    • both VCC, AVCC and both GNDs are connected
    • There are 0.1uF ceramic caps between VCC, GND and AVCC, GND
    • There is a 10k Ohm pullup between on the RST pin of the ATmega ()
  • 16 MHz crystal quartz - Clock for MCU
    • Both quartz legs are connected to GND by 22pF caps
  • SIM868 - GPS/GPRS module for positioning and data transmission to server
    • The SIM module has current spikes of 2A during transmission (https://www.elecrow.com/download/SIM868_Hardware_Design_V1.01.pdf, p. 20) -> I believe these cause my resets
    • There are 3 caps (C1, C2, C3) between Vcc and GND of the module to smooth the current spikes and voltage drops:
      • C1: 22pF ceramic
      • C2: 1uF ceramic
      • C3: 100uF electrolytic
    • I tried to use a 1k uF electrolytic cap instead of the 100uF cap and it didn't help (Also, it's too big for my design)
    • There is a 2A flywheel diode between the GND pin of the SIM868 and its Vcc pin. This should help with any remaining current flow when the MOSFET is toggled
  • MAX1704 - Li-ion remaining capacity measurement
    • Has a 0.1uF cap between Vcc/GND
    • Has 4.7k Ohm resistors as pullups for I2C communication
  • DS3231 - RTC with interrupt to wake up my MCU from deep sleep periodically
    • Has a 0.1uF cap between Vcc/GND
    • Has 4.7k Ohm resistors as pullups for I2C communication
      • these pullups are driven by the ATmega328p, by the same pin that also supplies the DS3231 with power
    • Power is supplied by pin 17 of the ATmega328p
    • The 99 markings are used to connect Vcc of the DS3231 with pin 17 of the ATmega without poking into the ground plane
    • Has a 2.7k Ohm pull up that is driven by the ATmega328p (SQW pullup)
  • MPU9250 - Accelerometer with interrupt to wake up my MCU from deep sleep on movement
    • Has a 0.1uF cap between Vcc/GND
    • Has 4.7k Ohm resistors as pullups for I2C communication
      • these pullups are driven by the ATmega328p, by the same pin that also supplies the MPU9250 with power
    • Power is supplied by pin 16 of the ATmega328p
  • IRLZ44N MOSFET - As a switch to cut SIM868 from power, driven by the MCU
    • Has a very short trace to the gate driver (pin 15 of the MCU)
    • Pin 15 of the MCU is connected to the gate via a 1k Ohm resistor in order to reduce noise on the MCU
    • The gate is pulled down via a 100k Ohm resistor to GND (connection from hole 29 to GND via resistor)

Three Samsung INR18650 li-ion batteries in parallel supply the setup with power (Vcc = 3.6 - 4.5V).

This is my first PCB design and for speed and cost, I decided to create a 2 layer PCB with a full ground plane on the bottom and all signal/Vcc traces on top. I'll be soldering everything by hand, so I'm not using any SMD resistors/caps etc. During the design, I attempted to follow the following PCB design best practices:

  • Create a GND plane for shorter signal paths, EMI reduction and shielding
  • Create no GND plane beneath the crystal, as it would act as a antenna
  • Make signal and Vcc paths as thick and short as possible
  • Avoided power line chaining of different parts
  • Add decoupling/bypass caps at each Vcc consuming part

The outcome from setting this up and flashing the code to it, is the following:

  • It works perfectly on a breadboard with the same setup as on the PCB
  • Sometimes it works on the PCB, sometimes it resets. By reading the status LED of the SIM868, I can see the exact point in time it happens: When the SIM868 switches from registered in network to transmission. This is per datasheet also the point in time the 2A current spike occurs at. Once the SIM868 succeeds in sending, it usually works over and over again, without any problems.

Schematic:

schematicV3

Here is the top layer + silkscreen of my PCB:

top layer and silkscreen of PCB

This is the ground plane and second layer of my PCB:

ground plane and second layer of PCB

Now I'm stuck while figuring out, what the differences are between my breadboard and my PCB setup, and what differences matter for the reset problem. As I'm pretty sure that the current surge of 2A is the culprit in this setup: What property helps the breadboard to cope with the surge, that the PCB doesn't have?

Thanks!

Update: I've updated the schematic to include suggestions of this thread and make it more readable.

\$\endgroup\$
20
  • \$\begingroup\$ You can't use an N-FET here, because you have logic signals going into the SIM868 which provide an alternate power return even when you think you've turned it off with your attempted low side switch. Trying to externally turn it off is probably mistaken to begin with, it already has its own power switch function (these things are actually "feature phone" guts), but if you really want to do it you need to redesign with a high side switch. \$\endgroup\$ May 11, 2019 at 16:14
  • \$\begingroup\$ ΔV=IcΔt/C+Ic*ESR What does this work out for you? \$\endgroup\$ May 11, 2019 at 16:29
  • \$\begingroup\$ Schematic would be helpful... \$\endgroup\$
    – filo
    May 11, 2019 at 17:32
  • \$\begingroup\$ @ChrisStratton Good call! The main reason I do not use the module power off/down, is that the attached active GPS antenna draws around 7mAh. I want my application to be super low power to last for a year or so. \$\endgroup\$ May 12, 2019 at 12:29
  • \$\begingroup\$ @SunnyskyguyEE75 My max current Ic = 2A during the spike, t =0.1s, C = ~101uF and my cap has an ESR of about 2 Ohms below 10V. This works out to: 2 * (0.1 / 101 * 10 ^ -6) + 2 * 2 = 1984.19. Is that correct? What does this mean for my application? \$\endgroup\$ May 12, 2019 at 12:43

1 Answer 1

2
\$\begingroup\$

Replace the fet for an MIC94064 or other smart high side switch. That's just very easy for starters.
Little detail often omitted is that you have to put the pins of the atmega in high-z when you turn off the SIM868. Otherwise you might power the module via your IO pins.

Add decoupling, at least 100nF and 1uF after the switch, near the pins of the SIM8686. And also 100nF on* the MCU power pins.
The 100uF to reduce the ESR for the batteries is fine. Research decoupling if you are unsure. Murata has an excellent document about this.

Also don't operate the MCU above 10 Mhz when you're at 3.6V. See Figure 28-1. Maximum Frequency. This might be the root cause of your problem.

Other than that there are a lot of thing not ideal on your board that it is hard to point to a definitive culprit.

*as close to, preferably on the bond pads.

\$\endgroup\$
6
  • \$\begingroup\$ Would 11MHz also suffice? (11.0592MHz to work with UART to be exact) Looking at the figure in the 328p datasheet, it seems like I should be fine with anything below about 13MHz at 3.6V. I've bought different values and am trying this right now. \$\endgroup\$ May 15, 2019 at 11:20
  • \$\begingroup\$ I'll get my hands on a high side switch asap and try it with that. I'm now also putting all pins of the mcu that are connected to the sim868 into high z. \$\endgroup\$ May 15, 2019 at 11:21
  • \$\begingroup\$ Should I keep the 100uF before the switch in addition to moving the caps after the switch? Thank you for the document and thank you for taking the time and helping! \$\endgroup\$ May 15, 2019 at 11:21
  • \$\begingroup\$ @BracketJohn Yes, the graph is not specific enough. But vague enough to say max wont work. The 100uF may stay. \$\endgroup\$
    – Jeroen3
    May 15, 2019 at 11:44
  • \$\begingroup\$ got it, then I will continue with 11MHz, as it seems to be stable so far. Will 2uF in ceramic caps be enough for the sim868 or should I add an additional higher value, maybe electrolyte, cap to mitigate the current burst during transmission even further? \$\endgroup\$ May 15, 2019 at 12:15

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.