![]() | ![]() | ![]() |
| | |||||||
| Electronic Projects Design/Ideas/Reviews Are you building an electronic project or want to? Maybe you need some assistance? Come and submit your electronic questions here and let our experienced members find a solution. |
| | Thread Tools | Display Modes |
| | (permalink) |
| New Member | Hey everyone! I am doing a project with a pic microcontroller. Now I just need to convert the input sine signals (frequency: 50/60 Hz) to really really good squares. When the sine signal is positive the output has to be 5V, when the sine signal is negative the output has to be 0V. I want to use a comparator (maybe lm393, lm339, lm311) but I can't figure out how to connect a comparator for my purpose. The datasheets are no help. If someone has a scheme, I'd really appreciate it, or any other help! Thanks a lot, guys!
__________________ Last edited by mrrmot; 24th April 2008 at 04:26 PM. |
| | |
| | (permalink) | |
| Experienced Member | Quote:
Where are going to connect your 50/60Hz source in order to drive the comparator input.?
__________________ Eric "Good enough is Perfect" PIC tutorials: Nigel's: www.winpicprog.co.uk/ Gramo's: www.digital-diy.net/ Bill's: www.blueroomelectronics.com/ | |
| | |
| | (permalink) |
| New Member | If you're asking about where to connect the sine signals, well that's exactly my problem. I don't know it. I have those 2 sine signals and want to use a comparator, but don't know how to do the connection. Btw: I have a 5V and 12V DC voltage source in my system
__________________ |
| | |
| | (permalink) | |
| Experienced Member | Quote:
Its the 2 sine wave signals, ie: source and amplitude I am asking. EDIT: When a posting says 50/60Hz its possible its a mains application. Is the source the local mains supply, if YES, how are you planning to reduce it to a safe level before its input to the comparator.? If NO, is the signal in millivolts or volts..? Its not possible to suggest a comparator circuit until we know this detail.
__________________ Eric "Good enough is Perfect" PIC tutorials: Nigel's: www.winpicprog.co.uk/ Gramo's: www.digital-diy.net/ Bill's: www.blueroomelectronics.com/ Last edited by ericgibbs; 24th April 2008 at 05:17 PM. | |
| | |
| | (permalink) |
| New Member | Those 2 sine signals are generated by a voltage generator. My project is supposed to work with sine singnals of any given amplitude that's smaller than 220V.
__________________ |
| | |
| | (permalink) | ||
| Experienced Member | Quote:
Quote:
How are you planning to reduce the 220Vac to a safe level before its input to the comparator.? Can you give more details of the project, whats it going to do.?
__________________ Eric "Good enough is Perfect" PIC tutorials: Nigel's: www.winpicprog.co.uk/ Gramo's: www.digital-diy.net/ Bill's: www.blueroomelectronics.com/ | ||
| | |
| | (permalink) |
| New Member | The sine signals need to be converted to (as ideal as possible) squares. The square signals are the inputs of a XOR IC. The output of that XOR IC is connected to the pic microcontroller, which is supposed to measur the phase shift angle of the original sine signals. I've already figured out the algorithm and the software. I just need those squares now.
__________________ |
| | |
| | (permalink) | |
| Experienced Member | Quote:
I am trying to help, but you are not answering my questions. How are you planning to reduce the 220Vac to a safe level before its input to the comparator.? Do you have a mains step down transformer from 220Vac down to, say 6 or 12Vac.? The processing of the square wave output has been solved by you OK.
__________________ Eric "Good enough is Perfect" PIC tutorials: Nigel's: www.winpicprog.co.uk/ Gramo's: www.digital-diy.net/ Bill's: www.blueroomelectronics.com/ | |
| | |
| | (permalink) |
| New Member | I am very thankful for your help. Sorry, I forgot to answer yor question. Yes, I'll be using a transformator, but my teacher hasn't told me to what voltage yet. I guess it'll be 220Vac-5Vac or 220Vac-12Vac. So how to do the comparator part?
__________________ |
| | |
| | (permalink) | |
| Experienced Member | Quote:
I'll draw up a LM393 comparator circuit and post it. If you are using TTL or LS, a +5v output from the comparator would be compatable, this 5V level would also make it suitable for the PIC. Its late evening in the UK, so I'll post tomorrow.
__________________ Eric "Good enough is Perfect" PIC tutorials: Nigel's: www.winpicprog.co.uk/ Gramo's: www.digital-diy.net/ Bill's: www.blueroomelectronics.com/ | |
| | |
| | (permalink) |
| New Member | I know that it is evening, I'm from Europe as well Thanks for everything
__________________ |
| | |
| | (permalink) |
| Experienced Member | Hi Mrrmot, Here is something you can work with, it was only a simulation but it's close to the real thing. http://www.edaboard.com/files-eboard...ector_1511.gif on1aag. |
| | |
| | (permalink) |
| New Member | Tnx for the tip, on1aag! Which programm is this?
__________________ |
| | |
| | (permalink) |
| Experienced Member | Hi Mrrmot, It's LTspice/switchercad from Linear Technology. You can download it here: http://www.linear.com/ And it's a free ride ! on1aag. |
| | |
| | (permalink) |
| New Member | Tnx for the tip. I'll check it out right now!
__________________ |
| | |
| Bookmarks |
| Thread Tools | |
| Display Modes | |
| |
| | ||||
| Thread | Thread Starter | Forum | Replies | Latest |
| Square wave to sine wave converter | ghauri | Electronic Projects Design/Ideas/Reviews | 18 | 20th May 2008 07:15 PM |
| sine wave to square wave | jay543_uk | Micro Controllers | 17 | 1st February 2008 06:24 PM |
| square wave to sine wave | tony Ben | Electronic Projects Design/Ideas/Reviews | 2 | 26th January 2005 04:04 AM |
| LC filter- filtering a square wave to sine wave | kken6248 | General Electronics Chat | 3 | 22nd April 2004 04:31 AM |
| How can I convert a square wave to sine wave?? | kken6248 | General Electronics Chat | 6 | 1st April 2004 03:27 PM |