How does exactly the analog electronics work?

This Forum is about the Opentherm gateway (OTGW) from Schelte

Moderator: hvxl

Post Reply
noether
Starting Member
Starting Member
Posts: 10
Joined: Fri Mar 13, 2015 12:46 pm

How does exactly the analog electronics work?

Post by noether »

Hello,

I am new in the forum and recently I have purchased an opentherm gateway. Looking briefly at the communication protocol and at the design http://otgw.tclcode.com/schematic.html#schematic , I would like to know how the analog circuits for the master and the slave actually work since there is not a detailed explanation here. Maybe it is in another post but I did not find it, sorry if this is the case.

I see that R5 and R8 is a tension division for measuring the voltage at the slave.
I see (I guess) that OK1B is involved in sensing the current at the master.

I would like to know "roughly" what each component is doing somehow. In particular how to drive the voltage without disturbing the current (and being able to measure such current in the same circuit). The same for the dual, measuring voltage and drive the current.

Thank you so much in advance!
hvxl
Senior Member
Senior Member
Posts: 1965
Joined: Sat Jun 05, 2010 11:59 am
Contact:

Re: How does exactly the analog electronics work?

Post by hvxl »

Let's start on the boiler interface. The boiler provides some current to indicate a high or low logical level. The Opentherm specs say low is 5-9mA and high is 17-23mA. Transistor Q1 starts working when its emitter to base voltage reaches 0.65V. Once that point is reached, the emitter-base voltage will not increase much more. So around 2mA (I=U/R) from the boiler will go through R1. The rest goes through Q1. A BC558A has a gain of around 100, which means that the current out of the collector is 100x the current out of the base. The base current is therefor pretty much negligible. For simplicity we can assume that the boiler current minus 2mA is coming out of the Q1 collector. In the low state, that will cause a voltage across R2 and R3 (U=I*R) of between 0.96 and 2.24 V. Across R2 that's between 0.3 and 0.7 V. This is not enough to light up the LED in OK1B (which needs around 1.2V). If all of the current of the logical high level would go through R3 and R2, the voltage across those two resistors would be somewhere between 4.8 and 6.72 V, but D9 limits that to 4.7 V. In turn, OK1B limits the voltage across R2 to 1.2 V. So, there's 3.5 V across R3, which means 15.9 mA is running through R3. With 1.2V across R2, 12 mA is going through R2, and the difference (3.9 mA) goes through OK1B, switching it on and pulling the RA1 pin of the PIC above the reference voltage.

In the idle state, the PIC will hold its RA3 pin at 5 V, thus activating OK1A. This results in a remaining voltage of around 0.2 V at the output of OK1A. Add to that the voltages across D11 (4.3 V), Q1 (0.6 V), D5/D6 (0.7 V), and D7/D8 (0.7 V) and you'll get around 6.5 V on the line to the boiler. It must be below 7 V for a valid low level according to the Opentherm specs, but also has to be high enough to leave 4.7V across R2+R3. For a high level, the PIC pulls its RA3 pin low. This switches off OK1A. Now the line voltage is controlled by D10. Again the voltages across Q1, D5/D6 and D7/D8 have to be added, resulting in 17V, nicely between the 15V and 18V limits outlined in the Opentherm spec for a logical high level.

On the thermostat side, as you already figured out, the line voltage is divided by R5 and R6 to produce less than 0.9 V on the RA0 pin of the PIC for a logical low level, and between 1.87 V and 2.24 V for a logical high level. A comparator compares that to a reference voltage of 1.25 V to produce a binary 0 or 1.

Q2 and Q3 create a current source. As before, there is 0.65 V between the emitter and base of Q3. When the RA4 pin of the PIC is at 5 V, Q4 will be off, which also means that Q5 is off. So there is only a current of 6.5 mA running through R11. If we again ignore the base currents (actually the base currents of the two transistors cancel each other out), this 6.5 mA is going onto the line to the thermostat. When the PIC pulls its RA4 pin low, Q4 and Q5 switch on. In that state there is something like 0.2 V across the emitter and collector of Q5. The remaining 0.45 V across R12 causes a current of 11.5 mA, which is added to the 6.5 mA of R11, giving a total of 18 mA going out on the opentherm line.

See also this jeelabs post for a more elaborate look at the current source.

Does that clear things up a bit?
Schelte
noether
Starting Member
Starting Member
Posts: 10
Joined: Fri Mar 13, 2015 12:46 pm

Re: How does exactly the analog electronics work?

Post by noether »

This is a really nice explanation!

It is been a long time I do not deal with analog electronics, thanks a lot, I have understood it pretty well.
Post Reply

Return to “Opentherm Gateway Forum”