Over the years, I have been working on several projects with raspberry pis mostly related to some form of environmental sensing. One thing that always bothered me is that there are a lot of sensors that come with off-the-shelf libraries: the obvious advantage is, that everything is relatively easy to implement, however, often I found myself frustrated, as the documentation of these libraries is often scarce or incomprehensible for a beginner, and i felt like not learning anything substantial from simply connecting a sensor and running some functions from a library. Additionally, a lot of parts/sensors do not have libraries and would require a custom made implementation.
I was therefore wondering, whether tutorials or teaching aids exist that are a good introduction to the subject of connecting sensors from scratch?
Addendum: I want to clarify that I'm looking for tutorials or guides on general principles or approaches on how to connect a component using a standardized protocoll or port to the raspberry pi.
An example could be a BME280 humidity, atmospheric pressure and temperature sensor: for me, the general approach would be to read any tutorial (e.g. https://www.raspberrypi-spy.co.uk/2016/07/using-bme280-i2c-temperature-pressure-sensor-in-python/) on how to connect the sensor to the raspberry pi. In the tutorial a script is available to download, which reads out the data. In the script we have several functions that e.g. define registers, read out bytes etc. And that is where my question starts:
- There must be a generalized approach on how to connect a device or component using a given bus (e.g. I2C/UART, etc.)?
- Somehow you must know that when you connect device
d
via I2C that you'll have to check stepsn
tox
to be able to read out the data it sends?
Thank you everybody for answering my question, I realise now, that it was way to broad to give a simple answer to it. I hope i could clarify it a little bit.