Massi wrote: ↑
Fri Mar 09, 2018 7:12 pm
i have to connect two devices:
- a pzem-004t module (TTL @ 5V)
- a hm-10 module (TTL @3.3V)
This is a remote (BLE) voltage current sensor so i have to limit as much as possible space used. The only cable i'm giving is a cut USB cable sourcing 5V for power.
Now, the easiest thing to do would be adding a level converter module, where i only need to add the 3.3V level reference. i could create this with a couple of resistors.
But, just to take advantage of the problem to learn something new, can you think to a different (better?) way of managing this?
Or would you only manage the TX line of the PZEM module, with a resistive divider to the RX line of the HM-10?
Are these modules being connected to a Pi? It's unclear from what you've written. Is communication with them uni- or bi-directional? Can you post more detail (or a link to more detail) about them. (From the point of view of a Pi's 3.3V GPIO's: Tx'd data from the Pi to a 5V device would require a level converter. Data from a 5V device to the Pi could be either via a resistive divider or a level converter. In practice typical level converter modules have 2, 4, or 8 bi-directional channels: http://www.cpmspectrepi.uk/raspberry_pi ... dules.html
Still running Raspbian Jessie on some older Pi's (an A, B1, B2, B+, P2B, 3xP0, P0W) but Stretch on my 2xP3A+, P3B+, P3B, B+, A+ and a B2. See: https://www.cpmspectrepi.uk/raspberry_pi/raspiidx.htm