Stack Exchange network consists of 183 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.
Thanks. As it turns out, the square wave is very low frequency(~2Hz from a heart rate sensor). I tried using the 3.3V regulator but it never gets down to zero volts due to the internal reference. So I can either use your zener circuit, or use an npn transistor with the 3.3V regulator connected to the collector and the 5V square wave connected to the base. Is there any benefit to the latter circuit? Another thing is my comparator is outputs high when idle, and I don't want to waste power when idle.