For the novice, are there some good books or online tutorials available that in a generic way demonstrate how one interfaces with I2C capable sensors on the basis of the vendor's specification sheet? Meaning, what information one first has to search for in the specification sheet, how one reads and writes to the sensors' registers, etc.
There are many interesting sensors for which no library and no ready-made breakout board exists and it would be great if I could learn how to go about interfacing with them.
Sometimes, I can find a library, but that is often huge and I may need less information than it extracts from the sensor. Also, I prefer to learn the basics myself from the ground up, rather than enjoying the quick-fix by way of reliance on pre-fabricated code I do not really understand.
I have first worked through Jack Purdum's "Beginning C for Arduino" book, but that does not focus on the Wire library and I2C sensor interfacing.
Give the name of an I2C sensor (like: BME280, MPU6050, ...) or an I2C dvice (like: 24C512 EEPROM, DS3231 RTC, Arduino UNO/NANo/MEGA, ...) based on which you wish to learn the working principles and the programming of the I2C (aks TWI) Bus.
this IC from TI is very interesting for a project I work on (sensing occupation of cushioned seating surfaces). Also, this one from BOSCH is great, I am only interested in its well-benchmarked humidity sensing accuracy. I am using Adafruit's Metro Mini for everything I am doing right now.
You may start writing Register Level Programming codes for the BME280. You will soon discover that a single Arduino/Library Function is doing the same same as has been doing by ~20 lines of Register Level instructions.
thanks; I looked at this "online book" you linked to. That seems fairly sound and trustworthy to begin with, making interfacing with I2C capable sensors sound almost easy. The article falls short on calibration strategy and averaging/filtering the output obtained, but there might be some good online references or books on that topic?
The article falls short on calibration strategy and averaging/filtering the output obtained, but there might be some good online references or books on that topic?
That has nothing to do with I2C. I2C is the communication protocol by which you get some numbers from a chip. Calibration and averaging and filtering are all mathematical operations that you do on your microcontroller after you get those numbers. For those things it doesn't matter what protocol you used to get the numbers communicated. Those things are just math.
What you are asking is like someone saying, "I learned how to count in French, but they didn't teach me to add or subtract. So how do I do math in French." See, the language doesn't affect the mathematics at all, just how you get the numbers. 1 + 1 is 2 no matter what language I say those numbers in.
Ok, a guy at our lab said that rather than doing the math myself, better sensor ICs offer to do it all in the IC itself. I assumed from this that many sensors offer this capability and thus it would constitute part of interacting with these ICs.
I guess I begin with the TI and BOSCH sensors, for which I found some solder-less prototyping sockets (or whatever these pop-in receptacles are called), and that first "howtomechatronics" link and take it from there.
Lagom:
Ok, a guy at our lab said that rather than doing the math myself, better sensor ICs offer to do it all in the IC itself. I assumed from this that many sensors offer this capability and thus it would constitute part of interacting with these ICs.
There may be chips that do that math for you, but that would be a property of the chip and not the communication protocol. That is still separate from how I2C works.
Sure, but to get one's hands on intra-IC math, one needs I2C and interact with some registers ; )
In any case, thanks to forum user wvmarle, I found this receptacle vendor that ships to Sweden. Once the fitting one for the FDC2214 has arrived, I can start learning.