how to use 6.3vac circuit as digital input on arduino

I'm tying to integrate an arduino in a pinball machine and use the pinball lamp circuit to trigger the arduino to do various tasks. The lamp matrix outputs 6.3vac to each #44 bulb. How could I connect this on an arduino input pin to tell if the lamp circuit for a particular bulb is on or off?

Opto coupler. Lots of examples on these forums, do some searching.

PerryBebbington:
Opto coupler. Lots of examples on these forums, do some searching.

There are sometimes easier ways, depending on the circuit, but opto coupler circuits are usually the most foolproof (i.e. forgiving).

Use a protection circuit to protect from negative voltages and from voltages over +5V. (As you may know, 6.3V RMS actually peaks at about positive & negative 9V.)

Your power supply will have no trouble "powering" 100 Ohms, but I'd increase the current limiting resistor to between 1K & 10K.

It will only be positive enough to read high for part of the cycle so you'll have to read in a "fast loop" whenever you want to check for a high, or you'll have to add a few more components to make a low-pass filter so you can get DC when power is on.

The Arduino reads voltage relative to its ground so you need a common ground with the 6.3VAC. That could be a problem if the bulb is wired as part of a matrix. In that case, an optical isolator doesn't need a common ground on both sides and it can also provide protection.

aarg:
There are sometimes easier ways, depending on the circuit, but opto coupler circuits are usually the most foolproof (i.e. forgiving).

I figured that if someone needs to ask how to get from 6V3 AC to an Arduino input then their level of knowledge is such that the simplicity and safety of an opto coupler is probably going to serve them best.

Use a PC814 optocoupler which is designed specifically for an AC input.

A simple 1k series resistor will limit the current to less than 10 mA, and the CTR will be entirely adequate to pull down an Arduino input using INPUT_PULLUP with the output transistor connected between the input and ground.

Consider in the code that the signal to the Arduino will actually be oscillating at twice the mains frequency due to the zero crossings so will need to be polled every few milliseconds in order to ensure that it is detected.

Overall, minimal components - one optocoupler, one resistor. The optocoupler should be located fairly close to the Arduino.

Thank you for the info. Much appreciated. I'm going to try the PC814.

This topic was automatically closed 120 days after the last reply. New replies are no longer allowed.