Page 2 of 3
Re: BME280
Posted: Mon Oct 12, 2026 11:52 pm
by medelec35
Sounds good to me.
Is the project file the same as attached to your first post?
The other thing that can be done is used your current board as an I2C sniffer.
You can either use the UART or display to show the results.
The idea is to see if BME280 is detected, if so what address is shown for it.
I can provide examples for you to alter for your setup.
Re: BME280
Posted: Tue Oct 13, 2026 1:01 pm
by B2CAP-V6
Hello Martin, and thanks for the feedback.
The project remains the same, with a few minor changes—including the way the return value is read, which seems to work for you. I’m going to flash the program now and let you know the return value.
I’ve also changed the BME280 address from 0x76 to 0x77. I’ll run a real-world test and keep you posted.
Re: BME280
Posted: Tue Oct 13, 2026 1:25 pm
by B2CAP-V6
Martin,
I’ve just finished testing with the two addresses, 0x76 and 0x77.
Both return a value of 0 (BME initialization).
Re: BME280
Posted: Tue Oct 13, 2026 3:35 pm
by medelec35
So your BME280 is not being detected.
I have a BME280, I will test that on FC11 to make sure the component is working as expected on my target device.
Re: BME280
Posted: Tue Oct 13, 2026 4:10 pm
by B2CAP-V6
OK, thank you very much
Re: BME280
Posted: Tue Oct 13, 2026 4:16 pm
by B2CAP-V6
For your information, it's the same in the Proteus simulation; I get a return value of 0.
Re: BME280
Posted: Tue Oct 13, 2026 10:19 pm
by medelec35
I have just added UART to your project and changed target to 18F46K22 which is the same family as your target device.
Copied all config settings so comparing like for like.
BME280 worked perfect for me with I2C in SW and on CH1.
UART Diag:
Code: Select all
UART Test
BME280 Initialise = pass
Pressure = 1017.380004, Humidity = 53.325195, temperature = 21.500000C
Looks like you have an hardware issue.
Did your protype work?
Your next step would be to use an I2C sniffer.
I have created a pic version, I will see if find and post it.
One thing is clear, the simulation you shown is not what is happing on hardware.
Re: BME280
Posted: Wed Oct 14, 2026 3:35 am
by B2CAP-V6
Thanks Martin,
It looks like you've got a good temperature and low humidity with a pressure of 1017 hPa—all in England,

.
Indeed, the 18F46K22 is identical to the 18F26K22. So, if your BME is working, mine should be too.
To answer your question, I didn't do any prototyping; I went straight to having the PCB manufactured based on my Proteus schematic (ordering 5 prototype-grade PCBs from the manufacturer). While waiting for your sniffer, I'm going to replace the BME. I'll be away this morning and for part of the afternoon, today.
I've already checked the electrical continuity between the traces. It's a very strange problem. A big thank you for everything, and I'll get back to you very soon.
Luc
Re: BME280
Posted: Wed Oct 14, 2026 10:53 am
by medelec35
You're welcome Luc.
My concern would be what the datasheet shows for the minimum voltage for logic 1

- I2C Min High Level.png (73.5 KiB) Viewed 146 times
it should be 0.7 * VDD.
Although there will be some safety margin, if measured voltages are out of tolerance that is a high risk, especially if PCB's.
Perhaps try a silicon diode in between 5V reg and microcontroller if nothing is shown for the results of the sniffer.
What I would suggest is erase the microcontroller so all pins change to inputs, then measure the voltages on I2C pins of both microcontroller and BME280.
Are the voltages enough for logic 1?
It might be a good idea to add low outputs on a blank Flowchart for I2C and check levels of both microcontroller and BME280 I2C pins.
For the LCD sniffer I will test on the 1846K22 and past results.
The LCD can be changed to the 4bit version by using the Replace option.
See
this Wiki page
Personally I prefer UART versions, so have included that as well.
Do you have access to USB to UART bridge or a logic analyser?
Re: BME280
Posted: Wed Oct 14, 2026 5:06 pm
by Bijumon
Hi,
To get the BME280 sensor working correctly in Proteus simulation, connect the CSB pin to +3.3 V to enable I²C mode.
Also, make sure to connect the VDDIO pin to +3.3 V to provide the digital I/O supply voltage.