I am using an Arduino UNO and the sensor SFM4100 from Sensirion (mass flow sensor).
According to the datasheet of the sensor, there is a pin called VLS (voltage supply for level shifter).
The datasheet states that this voltage should be in the same communication level as the SCK line.
My SCK line is connected via pullup resistor to the 5Volts of the Arduino.
However I noticed that if the VLS pin isnt connected at all I still get measurements from the sensor, the same goes if it is connected to the 3.3 Volts of the Arduino.
So my question is, what is the purpose of this pin of the sensor and do I have an issue if I have it connected at 3.3 Volts? (because of the circuit there are certain difficulties that dont allow me at the time to move the pin to the 5Volts). I include the datasheet of the sensor. Thanks everyone in advance.
It looks like you have a fun project. You need to connect the VLS pin to the same voltage that the UNO is operating on 5V. If you use the 3.3 Volts it is a very maybe if it will work depending on which side of the moon the sun comes up. Your attachment states in note 7 referenced by the Level Shifter Supply that it must be the same voltage as the communication level of the uP. This pin is used internally to control the interface voltage level sense points and possibly drive voltage. In other words a logic 1 is different on each MOS device, the logic levels are in the range of .4 and .6 of VCC. These levels are approximate and change with time, voltage and especially with temperature. It must have this if it needs this to work properly and in spec. It will probably pseudo work with this line open but definitely would not be reliable. Another note, it is rated at a bus clock of 100kHz, Anything faster then this is a maybe. This is a typical specification, not an absolute.
gilshultz is spot on. That's how it is.
I can add to that, that you may not use an extra level shifter between the Arduino and the sensor. If the 5V is really a big problem, then you can use a 3.3V Arduino board. For example one of the MKR boards. You still have to connect the VLS to the voltage of the processor (3.3V for a 3.3V Arduino board).
Thank you both for your replies, much appreciated ! Spent some time yesterday studying the datasheet and the I2C and from what I understand , the following happens : The SCL and SDA lines are always pulled high to the same voltage (the one that the pullup resistors drive them to, 5 Volts from the Arduino in my case). However for the sensor to determine what a logic High is the VLS pin is used. Having it connected to 3.3 volts means that it considers a logic High at 3.3. When it receives a 5V signal , it still considers it high since it is above its threshold and there is not a problem caused , because the voltage that the sensor can handle is up to 9 volts. Opinions?
Remember when pulling up the lines with the sensor it is also applying that voltage to the arduino unless there is a level sensor in the line. Simple rule to follow: A logic low is below 40% of VCC, a logic 1 is above 60% of VCC, the area in between is undefined.
Good Luck & Have Fun!
Gil
A level shifter is made with two mosfets. The low side voltage (3.3V) is connected to the gates. The high side is just a pullup. There might be some room to fumble with it, but you can damage things.
By applying 3.3V to VLS, and adding extra pullup resistors to 5V at the Arduino, the combined pullup might make it work more reliable.
Sometimes a chip is used for level shifting. Those chips have often the same circuit inside. However, I can not guarantee that this circuit is in the device. There could also be ESD protection diodes and you might lift the voltage of VLS which causes unwanted currents. So you might break something.
I suggest to add two extra 10k pullup resistors at the Arduino to 5V and measure the voltage of SDA and SCL. I hope they are 4.15V when the I2C bus is not busy. They should be at least 3.5V (according to the datasheet the ATmega328P in the Arduino Uno needs 3.5V so see a high on the I2C bus). Any unwanted current will be low.
When I think about this, this is terrible advise. You should do it right, instead of this trick. When other 5V or 3.3V I2C modules are also connected to this bus, then I don't know what will happen. The pullup resistors on cheap modules vary from 1k to 10k.
Koepel:
I suggest to add two extra 10k pullup resistors at the Arduino to 5V and measure the voltage of SDA and SCL. I hope they are 4.15V when the I2C bus is not busy. They should be at least 3.5V (according to the datasheet the ATmega328P in the Arduino Uno needs 3.5V so see a high on the I2C bus). Any unwanted current will be low.
The voltage is indeed 4.16 volts , as is the voltage of the 5v pin. Hijacking my own post, isn't this a bit of a big voltage drop when I supply almost 8volts through the jack? It has caused me issues with the contrast of the LCD shield i have attached on top of the Arduino, it only seems to be functioning correctly when powered with regulated 5volts from the USB
4.16 Volts with 10k pullup resistors ? Then I would continue with that. No problem.
8V into the power barrel jack, through a diode to VIN makes 7.4 or 7.5V, into a voltage regulator to make 5V for the Arduino and the display. That should be no problem.
The backlight of a display requires some current. Perhaps the voltage regulator gets too hot and reduces the current.
When you put your finger on the voltage regulator and you can not keep it there, then it is too hot.
The USB can supply the full 500 mA. That is often more than power via the barrel jack and via the voltage regulator.
Hi. I apologize in advance, since my English is not good and I needed a translator. I bought a SFM4100 sensor and I can't get it to work for me, it doesn't recognize i2c. I have tried with mega arduino, and with esp32. Changed from 5v and 3.3v and it doesn't work and I'm desperate. I would appreciate any help. Thank you for your attention.