120V switch as Arduino input

Thread Starter

Ross Satchell

Joined Jan 2, 2017
46
I am working on an espresso machine project where I want to read the status of a 120VAC switch using a 5V Arduino. After much research I have come up with the attached circuit (see attached PDF).

Firstly: Is this a reasonable circuit to accomplish this? What could be improved?

Secondly: I want to do hardware debouncing between the PS2505 optoisolator and the 74HC7014 Schmitt Trigger, however all of the circuits I have found to debounce have a 10K pullup resistor and a 0.1uF to GND. If I were to use that I would end up with a voltage divider made up of the 10K pullup just mentioned and the 470 ohm resistor in the schematic between the PS2505 emitter and Schmitt Trigger input.
How can I accomplish this?

I have also attached the datasheets for the PS2505 optoisolator and 74HCT14 Schmitt Trigger.
 

Attachments

Sensacell

Joined Jun 19, 2012
3,453
Just replace R16 with a 10K and you should be good to go.

470 ohms is too low here anyway, the current transfer ratio of the opto is 80% minimum, but better to use a larger resistor, makes the circuit more robust to voltage variations.

The max leakage of the opto transistor is 100 nanoamps, so no problem going with a higher resistance here.
 
Last edited:
Top