Water flow sensor I2C adapter using Dasduino LITE

Customer:

I’m trying to make a water flow sensor I2C compatible to save pins on my ESP32. Do you have an adapter for this?

Originally submitted via email support on 29 April 2024. Migrated to the forum for community visibility.

Soldered Support:

You could use the Dasduino LITE and write a simple driver for it to transmit the data over I2C when prompted. Here’s an example sketch: Arduino I2C Slave [Tutorial & Example Code]

Just make sure the value you’re writing to I2C packs and unpacks correctly. For example, if it’s a uint16_t, think about whether you’re going to send the higher byte or lower byte first. However, you should be able to handle this value with just sending one byte (uint8_t) as it will be big enough to contain the value.

You can also use the easyC port if the Dasduino is set in I2C slave mode - it will behave the same as if you used pins.