Hello, I have a following problem:
in my project I use
Leonardo
128x64 LCD display with ST7565R controller // operating on SPI
DHT22 // operating on I2C
TSL235R // operating on I2C
BMP180 // operating on I2C
DS18B20 // operating on 1wire
The best operating voltage for all those peripherals is 3.3V.
I know I have two ways to solve the problem (under every option I put some questions):
Undervolt the Arduino by changing 7CE50Z to a 3V3 regulator (by the way can You propose any model?)
should I change any other elements on-board?
after changing to 3.3V - how am I able to lower the clock to ensure more stable operation?
Buy and use level shifter (can You propose any model? is 74AHC125 OK?)
maybe I should buy one logic converter for SPI 3.3<->5 and for I2C/TWI stay with 5V. However, what about BMP180 which is only operating up to 3.6V. Would it be able to send its data on 5V I2C/TWI?
Do 3.3 and 5 volt high levels differ really that much that communication is impossible?
After lowering the voltage, you Must lower the clock to 8 MHz for stable operation. Serial in particular is susceptible. See Figure 29-2. Maximum Frequency vs. VCC, ATmega16U4/ATmega32U4.
Graph is same as this one.
Does Leonardo support 8 MHz operation? Might need a boards.txt entry change and re-Make the bootloader to support the slower speed.
Same graph, but 2.7V is at 8 MHz, vs 10 on the 328P, and the chart does not go lower than 2.7V.
I think some reading will show that 2.7V is the lowest allowed for proper USB operation.
So level shifters might be the best option for you.
For I2C, all devices only pull down, a pullup resistor on the bus creates a high. Pullup to 3.3V is fine.
You'll probably want to turn off the internal pullups on the 32U4 so it is not pulling the SCL/SDA lines to 5V.
CrossRoads:
Same graph, but 2.7V is at 8 MHz, vs 10 on the 328P, and the chart does not go lower than 2.7V.
I think some reading will show that 2.7V is the lowest allowed for proper USB operation.
So level shifters might be the best option for you.
Thank you for the answer. I am a newbie and want to clarify some things:
So you say that changing to other clock speeds is difficult?
Is any biderectional level shifter OK for using SPI?
CrossRoads:
For I2C, all devices only pull down, a pullup resistor on the bus creates a high. Pullup to 3.3V is fine.
You'll probably want to turn off the internal pullups on the 32U4, so it is not pulling the SCL/SDA lines to 5V.
So, apparently 3.3V-fed device (BMP180) will successfully communicate with 5V Arduino on I2C, while others (DHT22, TSL235R) are pulled up to 5V I2C? Can it damage anything?