Running a 3.3v sensor on a 4.2v arduino

Hi all,

I am trying to design a custom atmega328p board directly powered with a li-ion battery, so around 4.2v most of the time and the goal Is to reduce current consumption as much as possible.

I want to connect a temp sensor that runs at max 3.6v. I was planning to use pull up resistors for SCL and SDA connected to a 3.3v ldo. Since the voltage difference isn't that big, the chip should be able to read the voltage highs correctly (0.7x 4.2v = 2.94v). I have read that I have to disable internal pullup resistors in order to avoid too high currents.

The sensor's application circuit is like so with 10k pull up resistors across SCL and SDA:
image
And here's my schematics

  1. Would this work ? Will I get 3.3v on the I2C pins and not 4.2v ?
  2. If so, isn't 10 k too high for my use ? I have seen people suggesting 3k3 or 4k7 pull up resistors for 3.3v and I'm not sure what to pick. Maybe I have to add 3k3 resistors close to the SCL and SDA pins of the atmega in addition to the 10k resistors of the sensor ?

Thanks for your help,

If you are making a custom board run the 328 at 8Mhz - it will then operate at 3.3volts and solve your sensor issues.

Deciding what you do with the measurement (display ,SD card?) will influence things too

I will run it at 8 Mhz with an oscillator but the atmega will be powered directly by the battery and not through the ldo.

It’s (328) still ok upto 5v .

If you are making a low power device, how about 2 AA batteries instead , no voltage issues .

Deciding what you do with the measurement (display ,SD card?) will influence things too

I will be transfering data via a wireless module which operates from 3.4 to 4.4v which is why I can't really use anything else than a li-ion battery.

Use a logic level converter for the 4.2V to 3.3V I2C interface. Example

However, there is no reason to run the MCU on the same voltage as the "wireless" module, and it may be easier to deal with that I/O level conversion.

Post links to the modules for more detailed discussion.

You are definitely right, I had never considered powering both the atmega and the sensor through the ldo. The wireless module is a Sim7080g that apparently uses a 1.8V UART interface and they explain in detail in the hardware design how to use a level shifter circuit for 3.3v to 1.8v so I guess my problem isnt a problem anymore.

That said, I don't quite understand why I need the two 10k I2C pull up resistors in the sensor's reference design if the atmega has inbuilt pull up resistors. Aren't they redundant ?

Only one pair of pullups is required on the I2C bus.

Not every master device has them.

I suspect the SIM700x is going to draw quite a bit of current in bursts… you REALLY need to plan your power and interface circuits properly, or you’ll have all sorts of issues.

I think you will find that the Atmega will draw less current from the battery if you run it at 3.3V. So if you can communicate ok with the wireless module when it is powered directly from the battery, then powering both the sensor and the Atmega through the LDO is probably the optimal solution.

My memory is that Wire.begin turns on the pullup resistors on SDA and SCL. You may be able to run ok with just those enabled, but they are 40K or something like that, so it may be better to have external resistors. You'll see 4.7K in circuits, but I would certainly try 10K to see if that works.

I now remember why I never thought about powering the atmega through the ldo.
It's because I use the internal 1.1v voltage reference to keep watch on my battery voltage.
What can I do to continue monitoring battery voltage before LDO with minimal power consumption ? (few microamps at max)

You would use a resistive divider to bring the maximum battery voltage down to under 3.3V. But to keep power consumption to a minimum, you would switch the divider on only when you need to read the battery. Below is my favorite way of doing that.

It requires an extra GPIO pin to do the switching, and you would have to experiment to find the capacitor value that keeps the mosfet turned on long enough. I think this works with something like a TP2104, or really any cheap P-channel that can be switched with 3.3V. RDSon doesn't matter. The top pullup resistor would be high value - 100K or maybe higher. The capacitor protects D4 from excess voltage.

Thanks for your valuable input.
I found this mosfet that was available on lsdc (RTM002P02T2L) :


Would this one work ?
Here's my updated schematics :

Not sure about the capacitor and resistor values but the voltage divider should drop the battery voltage from 4.2 to 3v max

EDIT : I just saw this :
image
I think the drain and source are reversed.
Is this new schematics better with the source at the top and the drain at the bottom ?

Yes, the source should be connected to the battery. The body diode has to block current flow when the mosfet is off.

The divider resistors would work, but they are not standard values. You're more likely to find 56K and 22K.

I suspect the capacitor could be a lot smaller. Perhaps someone with simulation set up could see what would work.

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.