summaryrefslogtreecommitdiff
path: root/circuit.txt
blob: 216ae5a5029dc171ab98548a9de9064f5a130c9f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29

                           +-------------------+
                           |                   |
                       +----)------------+     |
                       |   |             |     |
                       |   +-------+     |     |     +---------+----o  Digital output
                       |   |       |     |     |     |         |
+24V ac  o---\/\/\/\/--+   |       __    __    __    __        |
               10K     |   |      |  |  |  |  |  |  |  |       |
                       |   |   +--------------------------+    |
                       |   |   |   |     +--|(+)\    |    |    \
           Voltage     |   |   |   |        |    >---+   /     / Pull-up resistor
           Divider     |   |   |   +--------|(-)/       |      \     ~100K
                       |   |   |                         \     /
                       |   |   | Dual Comparator (LM 393) |    \
                       |   |   +--------------------------+    |
                       |   |      |__|  |__|  |__|  |__|       |
-24V ac  o-+-\/\/\/\/--+   |                         |         |
           |    1K         |                         +---------+----o  Vcc
           |               |
           +---------------+----------------------------------------o  Ground

The 120Vac <-> 24Vac transformer could be replaced by a larger voltage
divider, but that would couple the USB ground line to one pole of the
AC line.

Comparator is LM 393 or equivalent, used as a zero-crossing detector.

Digital output is connected to pin B0 of the Teensy.