# AC sine wave to DC square conversion

Discussion in 'The Projects Forum' started by Chapalo, Sep 20, 2010.

1. ### Chapalo Thread Starter New Member

Sep 20, 2010
4
0
Hello All,

I'm another new guy on electronics. I read some threads similar to this one but the problem I have is that the input voltage will vary 3-6.8Vpp and I need to dismiss values from 0 to 4.6 Vpp.

I though in using a Schmitt trigger but I think hysterisis can affect because it has to be precise.

Someone recomended me the attached circuit but I'm confused on how to calculate the value of the resistors and if it is the best method I can use.

I appreciate any help and ideas you can give me.

File size:
9.2 KB
Views:
29
2. ### Kermit2 AAC Fanatic!

Feb 5, 2010
3,775
931
If you have to be precise then you need a comparator and a REFERENCE voltage to compare against. Both the signal and the reference are inputs and when the signal exceeds the reference the output goes high(5V). Is that what you had in mind?

3. ### tom66 Senior Member

May 9, 2009
2,613
213
I designed a circuit to do this for someone a while back. See this thread:

Adding a comparator to the positive rail and ANDing that with the zero crossing detector would then allow you to have an output at only a certain Vp-p.

4. ### Chapalo Thread Starter New Member

Sep 20, 2010
4
0
Hello,
Thank you for the ideas you are giving to me.

Kermit2. So, I can try with a voltage divider to set the reference. I'm I right?

Tom66. I found an Image, this is the idea. Isn't it?

5. ### tom66 Senior Member

May 9, 2009
2,613
213

Basically, you would add a comparator and check if the +4.95V rail (or whatever voltage it is at) is above your threshold, and you could gate this with the zero crossing detector. If you want, I'll draw up a simulation.

6. ### tom66 Senior Member

May 9, 2009
2,613
213
Here's a circuit that will do what you want:

Code ( (Unknown Language)):
1.
2. \$ 1 5.0E-6 15.472767971186109 50 5.0 50
3. a 176 368 272 368 1 15.0 -15.0 1000000.0
4. d 272 368 320 368 1 0.805904783
5. c 320 416 320 496 0 4.7E-5 3.076470097763847
6. g 320 496 320 512 0
7. w 384 416 320 416 0
8. w 320 416 176 416 0
9. w 176 416 176 384 0
10. w 320 368 320 416 0
11. R 176 352 144 352 0 1 40.0 3.1 0.0 0.0 0.5
12. a 432 432 528 432 1 15.0 -15.0 1000000.0
13. w 432 480 432 448 0
14. r 384 416 384 512 0 47000.0
15. r 432 512 528 512 0 47000.0
16. w 528 512 528 560 0
17. w 432 544 432 512 0
18. w 432 544 384 544 0
19. w 384 544 384 512 0
20. w 528 432 528 480 0
21. w 528 480 432 480 0
22. w 432 416 384 416 0
23. g 432 576 432 592 0
24. O 528 400 576 400 1
25. O 528 592 576 592 1
26. a 432 560 528 560 0 15.0 -15.0 1000000.0
27. a 576 320 672 320 1 15.0 -15.0 1000000.0
28. g 576 336 560 336 0
29. w 176 304 176 352 0
30. t 784 480 816 480 0 1 -17.408019199452596 -11.255171306487004 100.0
31. w 528 432 528 400 0
32. w 736 320 736 480 0
33. r 736 480 784 480 0 10000.0
34. w 816 432 816 464 0
35. w 816 496 816 560 0
36. w 528 592 528 560 0
37. r 768 432 816 432 0 100000.0
38. w 816 432 864 432 0
39. a 576 240 672 240 1 15.0 -15.0 1000000.0
40. w 576 224 528 224 0
41. w 528 224 528 400 0
42. 172 576 256 496 256 0 6 3.0 5.0 0.0 0.0 0.5 Vp-p min
43. w 816 560 528 560 0
44. d 736 240 672 240 1 0.805904783
45. d 736 320 672 320 1 0.805904783
46. w 736 240 736 320 0
47. r 736 240 736 176 0 4700.0
48. R 736 176 736 144 0 0 40.0 5.0 0.0 0.0 0.5
49. w 528 432 768 432 0
50. w 576 304 176 304 0
51. o 8 64 0 291 9.353610478917778 9.765625E-55 0 -1
52. o 35 64 0 291 4.091738259870177 9.765625000000001E-155 1 -1
53.
Paste this into File > Import on Paul Falstad's circuit simulator http://www.falstad.com/circuit.

File size:
49.3 KB
Views:
22
7. ### Chapalo Thread Starter New Member

Sep 20, 2010
4
0
I see!
I'll do the simulation of both circuits you propose and let you know the results.
Thank you very much for the ideas!

8. ### JoeJester AAC Fanatic!

Apr 26, 2005
3,373
1,157
So when the signal is less than 4.6V p-p or (2.3V zero-peak) you do not want an output.

Look up a window comparator. That way you will get the output only when your parameters are exceeded. I'm assuming you need both the positive and negative triggers.

9. ### Chapalo Thread Starter New Member

Sep 20, 2010
4
0
Hello JoeJester,

Actually, I just need the possitive but that is a great idea also for a different project I have in mind. Thanks!