Close

Researching

A project log for nTerm2-S

A terminal emulator of my own liking. Using an ESP32, connecting to a VGA screen, and having sound. Based on the uTerm2-S and FabGL.

retep-vRetep V 05/28/2026 at 09:200 Comments

Let's chat some numbers.

I spent some time on researching alternatives for the relay circuit. Because they take up quite some board space, take a while to solder, and I'd like to have some cheaper and solid-state alternative too.

The relay circuit that I'm using now, uses about 15x18 mm of board space, or 270mm^2. The cost of components is about 2.26 euro. The cost of (hand-) soldering is roughly about 7 minutes per circuit. Times 3 is 810mm^2, 6.78 euro, and 15 minutes (soldering all 3 at the same time, soldering is not what takes the time, it's the picking and placing of the components).

Fewer components will be fewer board space, and faster soldering times. And maybe we can do it for cheaper than 6.78 euro too.

Relays have a few big pros: they don't need any supply power, and still they can conduct positive and negative signals ranging from -220V to +220V.

So what kind of circuit can replace a relay? I should state up front that what follows is theoretic research, none of it has really been tested in any setting.

I researched transistors (BJTs), mosfets, SCRs, TRIACs. The first 3 are out, simply because they are unidirectional. The RS-232 V24 is basically an AC signal that can range between -15V and +15V, and we would loose either the negative or the positive part of the RS-232 signal.

A TRIAC though, looks quite promising. TRIACs use current to switch on or off, but we can get around that by using a resistor. However, doing some research, I found a different kind of snag. Without going into detail: TRIACs work in 4 specific quadrants, depending on the gate current and the direction of the current that it is conducting at any point. We want to be switching in Quadrants 2 and 3, where the TRIAC works most reliably. That means we have to switch the gate with a negative voltage in relationship to the center voltage that it is conducting, which is 0V. A GPIO can source and sink current. So, we could sink a current. But in order to sink a current, the GPIO needs to switch to a negative voltage, which it can't. But we do have a negative voltage on-board: we can take the -8V or so from the MAX3232E and switch that with probably a transistor (as the TRIAC's gate operates on current instead of voltage). That seems promising.

Of note is that there are actually 'sensitive-gate triacs' available, which are supposed to be able to work reliably in Quadrants 1 and 4. And for sure I will try out a few of those. Also promising.

There is yet another snag which I almost failed to mention. We need to draw a continuous current from the gate (holding current). And if the current on the load falls below the holding current, the TRIAC might turn of prematurely or not switch at all. So I might not get it to work with RS-232, as it's not a continuous AC signal. But there is enough promise to try it out on the bread board.

An even more promising option is the SMD solid state relay that we have these days. They are opto-isolated, so the GPIO would basically be switching an LED. It seems as if we can drive the led with 10mA. So in worst case this would add a continuous 60mA to our current needs. In reality, we might be able to light the led enough with an even lower voltage. Of note is that the IM41relays only use current when they switch, and after switching we go back to a very tiny current draw. Something to keep in mind. Looking at the pricing, I see that an AQH0223 is 0.86 euro, so that would be 5.16 euro. But it would gain a bunch more board space, and soldering will be much easier.

Now my dirty mind is kicking in. What if, instead of having one MAX3232E (or something equivalent) and the switching circuit after it, I drop the whole switching circuit, use multiple MAX3232E hardwired, and switch them on or off using GPIO pins? But I have 4 modes: 1) RxD, TxD, RTS, CTS straight, 2) RxD, TxD, RTS, CTS cross, 3) RxD, TxD, DTR, DSR straight, and 4) RxD, TxD, DTR, DSR cross. If I hardwire everything, it means I will need to use 4 MAX232E's. Still, at a price of 1.01 a piece, that's only 4 euro. But add the capacitors too: 0.25 euro, times 5, times 4 = 5 euro. Hmm, 9 euro. And would I save much board space this way? I think I will save no board space at all. 

Research continues. But for now I'm going to order a few TRIACs and solid state relays to see how they behave. But to be honest, right now it doesn't look as if my choice for using relays was such a bad choice after all.

Discussions