I need a simple temp sensor to operate a relay. Its on an ESP32 board.
I wanted to use the DS18B20, as I have some of those. But... the onewire library it uses won't play friends with the DMX and Oled library I am using.
I tried the MCP9700, but the output was basically unusable for some reason... even with multiple sampling.
Any suggestions for other sensors?
Or, anyone have code for using a DS18B20 without needing the onewire library?
Analog Devices (formerly Maxim; manufacturer of DS18B20, et al) publish some "bare metal" code:
It does require some precise timing - maybe that's the root of the conflict with your other libraries...?
Maxim also had (hopefully, AD still have) some app notes on accessing the sensor via UART, which takes the timing burden off the processor. Could probably also be done with SPI...?
There are also bridge chips between 1-Wire and things like I2C...
A film NTC in resistive divider mode and measuring readings with the support of a measurement filter like the one suggested in this tutorial: Smoothing
So why does everybody rave about the ESP32... so far, I ain't all that impressed.
Looking at the BMP280 breakout boards.... the purple ones with 6 pins.
No wonder beginners have trouble getting stuff to work. Three different webpages have 3 differing opinions on what the pins do.
Some say to leave CSB and SDO alone (when using I2C), some have them held high or low and some have them completely the opposite way around.
2. Fig-3 says that for "I2C Mode Connection" the CSB-pin of the Breakout board/Sensor should be at HIGH state which can be achieved by leaving the pin open as it has a pull-up resistor (Fig-2).
3. Fig-3 says that for "I2C Mode Connection" the SDO-pin of the Breakout board/Sensor should be at LOW state for "Slave Address of 0x76" and it can be achieved by leaving the pin open as it has a pull-down resistor (Fig-2). By strapping SDO-pin at HIGH state, another sensor could be run in parallel by assigning 0x77 as the "Slave Address".