Forum: Haus & Smart Home Heatronic 3 Adapter (Junkers Heizung) fuer Raspberry Pi


Announcement: there is an English version of this forum on EmbDev.net. Posts you create there will be displayed on Mikrocontroller.net and EmbDev.net.
von Norbert S. (junky-zs)


Lesenswert?

Luca schrieb:
> I'd like to get the simulation working correctly so I can swap the
> optocouplers with different ones I have available and see if the
> waveform is still acceptable.
I'm not sure you'll find that used optokopplers in LTspice.

It's better to compare the datasheets of that selected optokopplers I'll 
think.
Most important is the rise- and fall-time to get the best serial 
signalisation.

Regards Norbert

von Luca (olivluca)


Lesenswert?

Oh, I found a model online for the H11L1, the optocoupler I have 
available has no schmitt trigger and even if it is slower it gave an 
apparently good enough result in the receiver, but I'd like to simulate 
the transmitter.

von Luca (olivluca)


Angehängte Dateien:

Lesenswert?

I came up with this circuit (I have some 4N25 around), do you think it 
could work?

von Luca (olivluca)


Angehängte Dateien:

Lesenswert?

Mmh, I put V1 on the bus side so I was losing the isolation provided by 
the opto.
This is a revised version with the transmitter and receiver.
What do you think?

von Norbert S. (junky-zs)


Lesenswert?

Luca schrieb:
> This is a revised version with the transmitter and receiver.
> What do you think?
Your simulated 4N25 seems to be fast enough to do the job.
But there are some problems with that design:
1. Q1 is closed (default current-flow) if V2 is low or disconnected.
-->> No 'failsave' available and blocking the heater-bus on failures.
2. D6 not required, but use the resistor-value with higher value.
3. UART-signals from MCU have high-levels in idle-mode, so your design 
is wrong.
Please look at my design, strip it down and simulate this with the 4n25.

Regards Norbert

: Bearbeitet durch User
von Luca (olivluca)


Lesenswert?

Hello,

thank you for your feedback, really appreciated.

Regarding 1., I didn't think of that, but since my bus is currently 
unused and I will only connect this interface, in turn permanently 
connected to an esp32 (so that V2, aka tx, will be idle high, 
phototransistor of U2 closed, Q1 open, bus high), I'm not sure it is a 
problem.

Regarding 2., good, I'll remove the zener and adjust the resistor.

Regarding 3., maybe the ltspice model I found of the H11L1 is wrong, but 
when I simulated your transmitter it gave me the same result as my 
circuit: tx high, (idle) green trace) -> bus high (blue trace), tx low 
(transmitting) -> bus low.
Same for the receive side: bus high -> rx high, bus low -> rx low.
Should they be inverted?

von Luca (olivluca)


Angehängte Dateien:

Lesenswert?

Latest iteration with the zener removed and changes in the simulation 
(V2 simulates the transmission for a short while and after that V4 
simulates the reception).

Edit: in the real circuit the GND in the middle won't be connected, but 
AFAIK in ltspice it's needed otherwise it cannot simulate the circuit.

: Bearbeitet durch User
von Luca (olivluca)


Angehängte Dateien:

Lesenswert?

This is my attempt to simulate your circuit.
As I said in my first message, the voltage swing is very low, but the 
current in the bus seems ok (70mA, not really sure it's actually ok).
But I see that it follows the input (input high -> optocoupler high -> 
bus high, input low -> optocopler low -> bus low).

Bitte melde dich an um einen Beitrag zu schreiben. Anmeldung ist kostenlos und dauert nur eine Minute.
Bestehender Account
Schon ein Account bei Google/GoogleMail? Keine Anmeldung erforderlich!
Mit Google-Account einloggen
Noch kein Account? Hier anmelden.