Using 3.3V and 5V sensors on same project, from 3.3V board

Hi,
I’m getting conflicting information.

I’ve got 2 sensors I’d like to connect to a feather board, one requiring 3.3V (light sensor) and (turbidity sensor) needing 5V. I need to increase the voltage to the turbidity sensor to keep it’s accuracy, and the signal coming back. A level shifter (here) was recommended by a salesman when I mentioned my issues, but also a step up/down (here), so the power runs through the step up/down, the signal through the level shifter. The little reading I’ve done seems to suggest the step up is redundant (not to mention complex to wire), that the level shifter will shift the power too?

Would the diagram I’ve attached work?

Thanks

Edit: grammar

Can you use a voltage divider?

The level shifter will not supply the 40mA of current the turbidity sensor needs for power. You would need a step-up converter which would get input directly from the battery if possible, and output 5V.

Another possibility would be to power the sensor directly from the battery. It wouldn’t be 5V, but the sensor might have enough leeway to still work ok at, say, 3.8V or more from the battery. You would have to experiment.

It’s not clear what data communications are going on with the sensor. Is it all one-way from the sensor to the processor? Are you using the sensor analog output or the digital? From the listing, it looks like the digital output is just high or low, and for that all you would need is a resistor divider or a diode, not a level shifter module.

The level shifter will not supply the 40mA of current the turbidity sensor needs for power. You would need a step-up converter which would get input directly from the battery if possible, and output 5V.

Another possibility would be to power the sensor directly from the battery. It wouldn't be 5V, but the sensor might have enough leeway to still work ok at, say, 3.8V or more from the battery. You would have to experiment.

Thanks, I wasn't aware how much power the level shifter could manage, that makes sense. From what I've read (incl. here) the accuracy of the sensor relies on a 5V input, so I'd need a step up.

It's not clear what data communications are going on with the sensor. Is it all one-way from the sensor to the processor? Are you using the sensor analog output or the digital? From the listing, it looks like the digital output is just high or low, and for that all you would need is a resistor divider or a diode, not a level shifter module.

I'd like to use the analogue mode, which comes through the A0 pin as pure voltage, which you can figure turbidity from. The digital mode is a yes/no option where you can change the threshold. This is less useful to me.

So re: the level shifter, I gather it uses 2 input voltages to determine what the shift is, so I need to input 3.3V on one side and 5V on the other? So a 5V input to both the level shifter and the sensor, from the step up?

I don’t think you really need an official level shifter. The sensor analog output ranges from 0 to 4.5V per the wiki. You just need it to range from 0 to 3.3V. You should be able to use a simple resistor divider. You come out of the sensor analog output through a 47K resistor, then through a 100K resistor, to ground. Then the midpoint of the resistors is tapped into A0. If the analog output is at 4.5V, A0 will be at 3.06V, and the ADC function will measure that at about 949 (out of 1023 maximum at 3.3V). The wiki has a formula for converting the voltage to turbidity, but you would need to divide the voltage at A0 by 0.68 to get the actual voltage

I don’t think you really need an official level shifter. The sensor analog output ranges from 0 to 4.5V per the wiki. You just need it to range from 0 to 3.3V. You should be able to use a simple resistor divider. You come out of the sensor analog output through a 47K resistor, then through a 100K resistor, to ground. Then the midpoint of the resistors is tapped into A0. If the analog output is at 4.5V, A0 will be at 3.06V, and the ADC function will measure that at about 949 (out of 1023 maximum at 3.3V). The wiki has a formula for converting the voltage to turbidity, but you would need to divide the voltage at A0 by 0.68 to get the actual voltage

Ok, thanks, sounds like a better option. I’ll try to figure out it.