Arduino and Mikroe pressure sensor integration

Hi everyone!

I'm trying to build a mini PSG (polysomnogram / sleep study device) using an Arduino and various sensors including a pressure transducer for airflow measurement.

I recently acquired this sensor Ultra-Low Press Click | Mikroe. It is designed to work with Mikroe dev boards out of the box but should also work with Arduino since it's an I2C sensor. A basic API is here mikrosdk_click_v2/clicks/ultralowpress at master · MikroElektronika/mikrosdk_click_v2 · GitHub.

I'm new to I2C sensors, especially those without a native Arduino library. Would anyone have some guiding words of wisdom?

Thanks in advance,
mutton

Which Arduino do you have? Your click board will operate from 5V or 3V3. If you have an UNO, then select 5V. A quick look at an image of your click board suggests that you need to solder a link to select 5V or 3V3 power.

Connect supply and GND to your click board as well as SCL and SDA. The LED should light on the click board. Then run an I2C scanner sketch to see if the device is detected.

The library you linked to should provide enough information for you to read the sensor directly in your sketch without any additional library. The SM8436 datasheet should fill in any blanks.

Thanks for the reply.

I have an Arduino Mega, so I guess I can use either the 3V3 or 5V? If so, is there a generally preferable voltage?

Also would you be able to elaborate on from where to where I need to solder the link?

Ok, I figured the voltage selector was set to 3V3 so I connected it up and ran the scanner sketch and it worked! Thanks!
I hope connecting the sensor up via 5V yesterday didn't damage it...

Will try to make the rest of the I2C code work now.

Would that be a MEGA2560? if it is, then the operating voltage is 5V so you need to set the solder jumper for 5V operation, and then connect the click 5V pin to the Mega 5V pin. The sensor should now be operating from 5V and be happy with the 5V logic levels on the SCL and SDA signals.

That shouldn't have caused any problems. However, if you powered the sensor from the 3V3 line on the Mega, then that may be an issue as the SCL & SDA signsls would be using 5V levels but the chip would be expecting 3V3 signal levels.

Yes, my bad, I should've specified that. It's a Mega 2560 R3.

Ah... I've just been using the Mega's 3V3 pin to power the click board. It seems to be producing pressure values fine. What is meant to go wrong this way?

In the meantime I'll try and remove this connector and re-solder it in the 5V position. Is this the right thing to do?

Thanks again!
voltage select on ultra-low pressure board (to solder)

Or I could just create a bridge of solder across where the red arrow is pointing?

If you power the board from the 3V3 power pin on the Mega, then the sensor can be damaged when you apply signals greater than 3V3 to it - i.e. the SCL & SDA signals.

If you are not going to plug the board into a Mega Click shield, and are just using jumper wires, then you can probably leave the 0R shorting link in the 3V3 position and feed the Mega 5V power in on the click 3V3 pin. As long as you know what you've done, then there shouldn't be a problem.

Ok. The data generated by the sensor in the two cases (powering it via 3V3 vs 5V) seems to be similar, so hopefully that means I haven't damaged the sensor!

Thanks for the tip about not needing to solder - makes sense!!