Reverse Optoisolator

I want to count the frequency of a voltage higher than 5v

most optoislators take a small voltage and allow you to switch a higher one

i want to use it the other way round switch a high voltage down to a smaller one

voltage will be around 55v max

the frequency could be up to 50 khz

can anyone recommend a suitable component

(a bit like a high voltage level shifter)

Like a transistor that you put small current on the gate (55V through a Big resistance) to switch 5V between emitter and collector?

yes - so the big voltage is switching the digital pin (3.3 v)

most optoislators take a small voltage and allow you to switch a higher one

No they don't.

They allow a signal that can light an LED to allow an isolated transistor to turn on and off.

If you want the opto isolator to trigger off a large voltage just put a bigger current limiting resistor in series with the signal.

the frequency could be up to 50 khz

Check the data sheet, not all optical isolators will go that fast.

No. It switches a transistor that allows VCC to flow to or from a pin. The transistor should be a BJT.

Hi,
If you use an opto-isolator, you will have to check is parameters to see if it will work at 50kHz.

What is the application?

Tom.... :slight_smile:

looks like a zero point crossing chip is the way to go

however i need to try one as the signal may not go negative

https://uk.rs-online.com/web/p/solid-state-relays/8113264/

looks like a zero point crossing chip is the way to go

No that is not the way to count a frequency.

Is this an X/Y Problem ?

Are you are really looking frequency counter circuit ?

this will work also

74HC4050

yes a frequency counter at max 30v would do the job

Gadgeroonie:
this will work also

74HC4050

Don't be silly that is just a level shifting chip. Max input voltage 15V.

i think it will work with a Zener and a resistor

Two resistors can convert any high voltage to a lower voltage. Google "voltage divider".

You would use an opto when it is necessary to isolate the ground. For example, connecting your Arduino to a power outlet. You don't want either Active or Neutral connected to the Arduino ground.

Gadgeroonie:
voltage will be around 55v max

Gadgeroonie:
yes a frequency counter at max 30v would do the job

That 25v spread is still within range of just using a 10 to 1 voltage divider circuit. 3-5.5 volts into a digital pin would be considered high (for a 5volt Arduino)

Is it possible that this is an AC signal? It goes from +55 to -55?

Then you need a level shifter or maybe the zero-crossing detector is appropriate.

The waveform is typically square wave but could be sinewave

The amplitude is typically 12v but you may see spikes from time to time

A motor is controlled based on the frequency of the signal

Hi,
What is the source of the signal?
What is the application?

Just answering those two questions will help quite a bit.

Thanks.. Tom... :slight_smile:

Gadgeroonie:
The waveform is typically square wave but could be sinewave

The amplitude is typically 12v but you may see spikes from time to time

A motor is controlled based on the frequency of the signal

So maybe filter the signal and THEN feed it to an isolator since you don't want Arduino to share ground with the AC?

I played with piezos as input devices for a while, they're about all spike when hit. I put the leads through 2 diodes and 1 BJT that filled the jumper between emitter and digital pin and even hitting the disc with a screwdriver handle hard (the table bounced) didn't zap the pin. Diodes can flatten spikes a bit.