Communication between 2 arduino operating at different voltage

Hello!

I hope someone can illuminate me on some questions I can't find an answer for...

My project is composed of two barebone/breadboard atmega328p (using internal oscillator at 8mhz):

The main one is connected to sensors and a wireless antenna (HS-12 UART for long distances) to transmit data to a central unit. This one is powered by a step-up/down Pololu S7V8A set to about 3.3v output.

The second one is used to control the step-up/down converter enable pin, date and time (DS3231 - ZS-042) and battery charge. This is asleep most of the time (600 sec), but when it wakes up and power up the main one, I need it to communicate to the main 328p some (little) data and vice versa.

Everything is powered with a Panasonic 3.7v 3400mAh 18650 lithium battery (Model: NCR18650B).

The idea is to power up the main 328p, let it power up, read data and transmit to the central unit. When it finished, notify the second 328p that it can cut the power. The second 328p turns off the step-up/down, set an alarm to DS3231 and power itself down waiting for the next interrupt. Like this I have very little current used when in power down mode (estimated to be about 0.2mA).

The questions are:

  • What is the best method to establish a communication between the two 328p? I was thinking about using UART, but as per datasheet, the input voltage on any PIN can't exceed Vcc + 0.5 (page 365) and since one is operating at 3.3v and the other one can operate between (ideally) 4.2v and 2.8v isn't it a bit of a risk?

  • I can modify the project to use only one 328p, but is it safe (and stable) to have 328p operating between 4.2v and 2.8v (depending on battery charge) and sensors fixed to 3.3v thanks to step-up/down? I think some problem may occur when Vcc to 328p is below 3.3v.

Some additional info: - The Pololu S7V8A has an enable PIN that if driven low, will electrical disconnect the Vout. - I need to have the device running for at least 3-4 months with one 18650 (if possible). - For now, sensors are just a DS18B20 and a DHT22. In future I'll add "analog" sensors like rain detector and soil moisture.

Let me know if other information are needed!

Thanks a lot in advance!

Just reading the headline of your post........

A 5v Arduino can read a 3.3v signal on Rx

A 1k/2k voltage divider on the Rx a 3.3v device would enable it to safely read a signal from a 5v Arduino.

I through about using resistors, but there’s one catch… The Arduino operating with “high voltage” (4.2v max) can go down to “low voltage” (about 2.8v) while the other one is running at 3.3v fixed.

Using a voltage divider when battery voltage is below 3.3v might create some problem, or am I wrong?

I think that could be true, but I guess, if you are running an Arduino at 2.8v, the voltage divider will be just a minor problem. I'm afraid I should not have responded to this post. As I said, I was just commenting on the headline. The rest was too convoluted to read.

I am guessing now that you intend to use two Arduinos of the same operating voltage, 3.3v, and the "different voltage" is due to user abuse, rather than board specification. In that event, I think your problems are not in communication, no special effort needed there, and all your problems are to do with power supply.

I understood those Polulus were to provide regulation down to 3.3v or boost up to 3.3v in the event of the battery being below that, so I don't know where the 4.2v and 2.8v are coming from. If your Arduino is a 3.3v device, both voltages would be a bad idea. I also suspect a single 18650 is a bad idea. It's nominal voltage is too close to 3.3v, and running them down too far can be damaging. It is something you need to check.

Your design sounds much more complicated than it needs to be.

You should be able to run everything with a single processor. Tell us what components you have and perhaps we can suggest a solution.

I have very little current used when in power down mode (estimated to be about 0.2mA)

You can do much better than that, by a factor of about 1000.

At the moment the main unit uses these components:

  • one Atmega328P (running with internal oscillator at 8mhz)
  • one DHT22 (Temp/Humidity)
  • one DS18B20 (Temp)
  • one HC-12 (long range UART wireless comm)

Everything get power from the Pololu S7V8A step-up/down converter set to about 3.3v fixed output
Power came from a single 18650 (or even double, quantity is not a big problem if below 3-4 18650s :smiley: ) 3.7v rated 3400 mAh.

I attached a (simplified, no resistors or caps) fritzing of the current main unit status.

I was think about replicating this project for battery save purpose, using another 328p which I already have (I know it’s an overkill, but I don’t have any PIC around).

The problem is how to wake up the unit after put it asleep… I was thinking about using the enable pin of Pololu (orange wire) as a switch, controlled by a second (a lot more basic) controller.

If you haven't seen it already, spend some time with Nick Gammon's excellent power saving tutorial.

My approach for your setup would be to run everything on a 3.3V Pro Mini Arduino (modified to remove the power LED), using 3XAA alkaline cells to power the Arduino via the raw input. Then you could use the 3.3V output for the sensors and possibly the radio.

That way, you can follow Gammon's tutorial to have the processor wake up using the watchdog timer, do what it needs to do and go back to power down mode. If done properly, the power drain most of the time would be around 200 nanoAmperes for the processor, plus the regulator quiescent current. The alkaline batteries might last for years.

With your lithium battery you must observe proper charging and avoid overcharging and overdischarging, both of which can destroy cells almost instantly.

Finally, check the specs on the regulator used in the 3.3V Pro Mini. If it has a large quiescent current, remove it and use a better quality regulator.

Without wishing in any way to dissent from the advice to use a single Arduino, if you really do need to connect two Arduinos using different voltages you could use opto-isolators for the Rx and Tx signals. With opto-isolators there is no need for a common GND between the Arduinos.

...R