I'm trying to get the status of my set top box (on/off).
It does have USB but it's always powered on.
It has optical out that is also always on.
It has an IP address that always responds to ping.

So my next idea is to read the signal in the SCART.
If I read the voltage across pin 8 and 14 I get 0-ish when off and 12 when on.
But when it powers on it spikes at 18 volt (at least what my multimeter can see).

What do I need to do to read this?
If I add a voltage divider with 1 and 4.7 Kohm I get a safe voltage if it does not go above 18 volt at any time.

But what can I do to be sure I don't burn a ESP chip?
Is there any way to make sure it's safe to read even if it spikes at say 25 volts?

  • This is really a question best asked in electronics.stackexchange.com. But you could add a series limiting resistor then back to back zener diodes to ground to control any voltage spikes. Suppose you could get away w/only one zener. But most suppression circuits use two. – st2000 May 5 at 14:05
  • 2
    An optical isolator with appropriate resistors would be my recommendation. – StarCat May 5 at 14:16

I would use something like below. The optical isolator (PC817 or similar) protects your ESP.

  • Use a 1.0-1.5K resistor from the incoming SCART switch signal (SCART pin 8) to the anode of the Opto isolator (pin 1 in case of the PC817). This will limit the current through the PC817 internal LED to about 10mA with a 12V signal but the PC817 can survive up to 50mA, i.e. up to 60V on the SCART plug and even then will not damage your ESP processor.

  • Connect SCART ground (pin 14) to the cathode of the Opto isolator
    (pin 2).

  • Connect a 3.3K - 4.7K resistor to the collector of the phototransistor of the PC817 (pin 4 of the PC817) and connect the other side of this resistor to Vcc of your ESP (+3.3V) as a pullup.

  • Connect pin 3 (emitter) of the PC817 to the Ground of your ESP.

  • Connect a digital input pin of your ESP to pin 4 (phototransistor collector) of your PC817 to create an active-low signal indicating your set top box is active.

This is the schematic you could use:


simulate this circuit – Schematic created using CircuitLab

| improve this answer | |
  • I can't find a opto isolator locally. I can order one, but the shipping is about 40 times higher than the unit price. So I did some testing and with a simple LED and a resistor. The LED turns on and off as it should. Sadly the phototransistor I have can't see that light. But I just need to find the correct combination and it will work. Thank you for the idea and schematic. But sadly due to shipping cost I can't build it like that, I will be DIY-ing one. – Andreas May 6 at 8:03

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.