Electronic Projects, forums and more.

Go Back   Electronic Circuits Projects Diagrams Free > Electronics Categories > Micro Controllers


Micro Controllers Discuss all aspects of micro controllers - building them, coding them, etc. All controllers are welcome - PIC, BASIC, Z8 Encore!, etc.

Reply
 
LinkBack Thread Tools Display Modes
Old 2nd October 2007, 09:17 PM   (permalink)
Default PIC sine peak

Hello all. I'm using PIC 16F916. I want to convert the peak value of a sine wave by the A/D converter. I need help to know how to calculate the the time and how to know the exact peak of the wave.

Thank you in advance.
hkit711 is offline  
Old 2nd October 2007, 09:23 PM   (permalink)
Default

Use a zero-crossing circuit to detect the zero crossing point, then time it until the peak of the sinewave - but you need to know the frequency for this. You could always measure the time between two zero-crossings and half it though.
__________________
PIC programmer software, and PIC Tutorials at:
http://www.winpicprog.co.uk
Nigel Goodwin is offline  
Old 2nd October 2007, 10:48 PM   (permalink)
Default

Thank you Nigel. I didn't thought about zero-crossing. I think that will work. By the way, the frequency is always 50 Hz.

Thanks again.
hkit711 is offline  
Old 2nd October 2007, 10:54 PM   (permalink)
Default

Quote:
Originally Posted by hkit711
Thank you Nigel. I didn't thought about zero-crossing. I think that will work. By the way, the frequency is always 50 Hz.
If you're trying to measure mains power consumption?, check EPE, they have done two such projects - one a LONG time ago (which I built, using a 16C84). And more recently one using a 16F877 based one with two channels, and using a specific power measuring IC.
__________________
PIC programmer software, and PIC Tutorials at:
http://www.winpicprog.co.uk
Nigel Goodwin is offline  
Old 3rd October 2007, 08:22 PM   (permalink)
Default

Dear Nigel. I'm not measuring the main power consumption. I'm building a "current overload protection" for an AC motor. I'm using a current transformer. I put a resistor in parallel with the secondary to have a voltage. I'm measuring that voltage and comparing with a set value. If this voltage (the current of the motor) goes higher then the set value then I will have a signal out to stop the motor. I will put the complete project on-line (because all of you guys are helping me to build it, it belongs to you too...) when I finish it to the end.
hkit711 is offline  
Old 3rd October 2007, 08:55 PM   (permalink)
Default

Quote:
Originally Posted by hkit711
Dear Nigel. I'm not measuring the main power consumption. I'm building a "current overload protection" for an AC motor. I'm using a current transformer. I put a resistor in parallel with the secondary to have a voltage. I'm measuring that voltage and comparing with a set value. If this voltage (the current of the motor) goes higher then the set value then I will have a signal out to stop the motor. I will put the complete project on-line (because all of you guys are helping me to build it, it belongs to you too...) when I finish it to the end.
I would suggest you should just rectify and filter the CT's secondary AC output. Then scale it with a pot such that your you can read it as a DC voltage in your PIC's A/D input. You may have to calibrate the whole thing using a known load through the CT's primary, but after that it will be a whole lot simpler.

Lefty
__________________
Measurement changes behavior
Leftyretro is offline  
Old 3rd October 2007, 09:08 PM   (permalink)
Default

That's right Leftyretro, but I'm trying to have a very compact circuit because I have more than 1 motor to control and it will be cheaper. It will be more complicated programing the PIC but cheaper for sure.
hkit711 is offline  
Old 3rd October 2007, 09:19 PM   (permalink)
Default

Quote:
Originally Posted by hkit711
That's right Leftyretro, but I'm trying to have a very compact circuit because I have more than 1 motor to control and it will be cheaper. It will be more complicated programing the PIC but cheaper for sure.
Well then your main challenge then is going to be to making sure the peak to peak voltage swing of the CT's secondary stays within the safe range of the PIC's A/D input, basically 0-5VDC.

You normally have to tie one side of the CT's secondary to the PIC's ground refereance, so without rectification I don't see how you are going to deal with negitive voltages that the PIC will see on the negitive swings. Somehow you have to scale down and reference the AC voltage to 2.5VDC so that the total peak to peak AC swing stays in the PIC's 0-5VDC safe measurement range.

I still think rectification and filtering is the best way and because this is for measurement not power they can be very small components.

Lefty
__________________
Measurement changes behavior
Leftyretro is offline  
Reply

Bookmarks

Thread Tools
Display Modes



Similar Threads
Title Starter Forum Replies Latest
High ADC sampling rate PIC, 18F needed? bananasiong Micro Controllers 24 28th October 2007 01:13 PM
Four PIC with One LCD.. meera83 Micro Controllers 13 20th September 2007 07:40 AM
Peak Detector and The Surge Problem alisarhangpour General Electronics Chat 7 5th December 2006 02:12 PM
How to Detect peak value and phase information jitun2 General Electronics Chat 18 16th November 2006 06:45 PM
12V pk-to-pk to 220V peak conversion samcheetah Electronic Projects Design/Ideas/Reviews 15 22nd July 2005 09:32 AM



All times are GMT. The time now is 06:20 PM.


Electronic Circuits  |  Learning Electronics
Powered by vBulletin® Version 3.7.0
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.

eXTReMe Tracker