I want to read serial data by a python script from a light sensor. I have the light sensor BH1750 and a USB-TTL Chip (see image). I have no idea about electronic hardware. Could someone tell me how I connect the pins between these two?
Asked
Active
Viewed 76 times
2 Answers
2
BH1750 uses I2C interface (you can tell by pin names SDA/SCL), but your adapter has UART. You won't be able to connect these two.
If you want to read values from the sensor in your python script, you'll need some kind of man-in-the-middle like an Arduino for example, that will read values from the sensor over I2C and send them over UART to your computer.
Or you need to choose a different sensor that has UART interface.

toolic
- 5,637
- 5
- 20
- 33

floppydisk
- 886
- 4
- 10
-
Sure, natively FTDI chip is an UART. So the first practical "no they can't be connected" answer is true. However, as it happens, most FTDI chips support alternative modes and their serial engines might support I2C natively or via bit-banging. Failing that, the UART handshake pins can be bit-banged as I2C. So while unlikely that it's worth it in this case, in general, they can be connected. Like you said, having a MCU between those boards is likely most sensible thing to do in this case. – Justme Jan 11 '23 at 15:14
-
@Justme yeah I thought about that, however this is an endeavor on itself which I wouldn't recommend to someone who "has no idea about electronic hardware" as OP stated. – floppydisk Jan 11 '23 at 22:56
0
You have the wrong adapter. FTDI offers adapters for I2C, see the selection guide: https://ftdichip.com/wp-content/uploads/2020/08/AN_255_USB-to-I2C-Example-using-the-FT232H-and-FT201X-devices-1.pdf
Good option would be the C232HM-EDHSL-0, where you would connect Orange to SCL, Yellow and Green to SDA and Black to GND.

Ralph
- 3,026
- 1
- 4
- 22