Change SSR relays to MOSFET transistor in Raspberry Pi circuit

Thread Starter

Piotr Mackowiak

Joined Aug 17, 2019
9
At this time I use circuit shown below to multiplex data input two 7 segment LED display to one output of ESP8266 chip. It is because I have ESPeasy SW installed on it. Such software can work only with one such display, so I have to "fool" ESPeasy that it only works with one display while de facto works with two. All switchings are done by rules defined in ESPeasy configuration. Relays I use are SSR type, small, fully semiconductor relays (without debunce effect of course). But such solution is too expensive and to big in size comparing to MOSFET transistors like 2N7000.

mosfet.png

Unfortunately, I do not have enough knowledge, hence I ask Colleagues in the forum. How can I replace the relays shown in the diagram above (along with the bipolar transistors controlling them) by MOSFETs?
 

dl324

Joined Mar 30, 2015
9,332
Welcome to AAC!

What is the relationship between the 'cc' and 'dd' outputs? Can they both be the same polarity? In any case, analog switches or tri-state gates could be used.

You can't use just an N channel MOSFET to do the switching.
 

crutschow

Joined Mar 14, 2008
23,779
If those are just logic signals being switched, you can use a CMOS switch, such as a CD4066, which has four switches in one package, or a quad AND gate, such as a CD4081.
Use the 3.3V supply for them and they can be controlled directly by the ESP8266 3.3V outputs.

(Note: Tie any unused control inputs to ground or V+ on CMOS devices.)
 

ci139

Joined Jul 11, 2016
998
random web-search result → https://hackaday.io/page/2024-esp8266-is-5v-tolerant-after-all
______________________________

danjovic wrote 07/26/2016 at 12:22

(edit) Even the 5V tolerant parts should use a resistor in series with the input pins, so the current does not exceed the capacity of the clamping diodes. Such current is around a few milliamps, hence the resistors are typically in the range of hundreds of ohms ( R >= [5-3V3]/Iclampmax).

A further reading on the ESP8266 datasheed shows that the I/O pins are protected for voltages up to 6Volts, (http://download.arduino.org/products/UNOWIFI/0A-ESP8266-Datasheet-EN-v4.3.pdf ) at the bottom of the page 17/31) so connecting it to a +5V output should not be a problem.

______________________________
e.g. ? why you use the relays that way anyway . . . ? does the 3.3 to 5 converter has it's inputs determined when they're ?left floating?

 

Thread Starter

Piotr Mackowiak

Joined Aug 17, 2019
9
I think I found a solution. Let's look at a single channel of 3.3V to 5V converter.

conv1.png

If the gate of the transistor is controlled directly from the GPIO of ESP8266 then we have a multiplexer and converter in one. The converter I have to use despite the fact that TM1637 works correctly when powered and controlled from 3.3V. This is because I use blue displays that light poorly when powered by 3.3V. On Monday I will buy transistors and try.
 

Thread Starter

Piotr Mackowiak

Joined Aug 17, 2019
9
I found an even simpler solution based on a bipolar transistor, which I have in a drawer:

conv2.png

The converter is admittedly unidirectional but I only need it. I connect the base of transistor to GPIO and it should work.
 

ScottWang

Joined Aug 23, 2012
6,843
Using the NPN transistor is easier then NMOSFET, because you can use almost the NPN bjt to do the job, but when you use the NMOSFET then you have to find the Vgs(Vds sat) <= 3.3V.

Edit : the R2 can be smaller as 4.7K.
 

Thread Starter

Piotr Mackowiak

Joined Aug 17, 2019
9
Yep. It works correctly and 10k resistor is not necessary at all. Its because PCB of LED display contains 10k pull-up resistor it both inputs. So whole circuit is ASAP (as simple as possible).
 
Top