ESP32 and BMP180 temperature sensor

Issue #110 resolved
connochaetes created an issue

Hi. I’m using MicroBlocks with this ESP32 from AZDelivery:

https://cdn.shopify.com/s/files/1/1509/1638/files/ESP_-_32_NodeMCU_Developmentboard_Datenblatt_a3bf98d8-6a53-4d26-8f1c-c61b1c82af39.pdf?76837

Since there is the library “BMX280” from José García, I’ll guess that it shouldn’t be too complicated to use a BMP180 temperature sensor. That 's the one, I possess right now. A little help would both

  • on wiring (5V; Gnd; SD_CLK; SD_DATA0 or SD_DATA1?) and
  • on software modifications (it’s a BMP180 and not a BMP280)

would be welcome.

Thanks to the MicroBlocks community for your work. Exploring the WiFi functionality is really nice.

Comments (6)

  1. connochaetes reporter

    I just wanted to add that I just found a TMP36 temperature sensor. So, all I have to do is to figure out a function that gives me the temperature in °C.

    BTW Is it possible that calculations in MicroBlocks are only possible with integers?

  2. connochaetes reporter

    I’m still working on a function that translates analog readings to °C. I found this site:

    https://bigl.es/using-a-tmp36-sensor-with-micro-bit/

    (Please, keep in mind that I’m using an ESP32.) It’s interesting, that the ESP32 gives me the same analog reading - it makes no difference if the TMP36 sensor is connected to 5 V or to 3.3 V. I guess, I have to calibrate the sensor on my own.

    Anyway, I just wanted to let you know that it’s one more thing working with MicroBlocks.

  3. Bernat Romagosa

    Hi!

    As you’ve found out, for the moment, we only support integers. Support for either fixed point or fractional numbers is planned for the future. One trick that we use to gain more precision is to scale things up by a factor that’s reasonable in each particular case. For instance, if you wanted two decimals of precision, you could multiply all your numbers by 100, do all your calculations, then divide the very final result again by 100.

    Sorry we took a bit long to respond. Did you already solve your issue?

  4. connochaetes reporter

    Thanks for your response. I dealt with the integer-only calculations in the way that you described. I just wanted to make sure, if I missed on something. Since it ‘s only a proof of concept at this moment, it ‘s completely OK for me that the TMP36 sensor doesn’t give me the proper temperature in °C. As said, I guess, I’ll have to calibrate it on my own. Since the DHT22 sensor for humidity and temperature is supported by MicroBlocks, I bought this one. Right now, I’m waiting for this device.

  5. connochaetes reporter

    Right now, I’m running some tests with my new DHT22 sensor for humidity and temperature. Everything is working fine - just out of the box. So the one thing, that 's missing in this field would be a sensor capable of detecting air pressure (such as the BMP180). But - to be fair - that 's an issue of minor relevance.

  6. Log in to comment