Forum Menu




 


Log in Problems?
New User? Sign Up!
AVR Freaks Forum Index

Post new topic   Reply to topic
View previous topic Printable version Log in to check your private messages View next topic
Author Message
bobgardner
PostPosted: Jul 04, 2012 - 02:24 PM
10k+ Postman


Joined: Sep 04, 2002
Posts: 21253
Location: Orlando Florida

Lots of smart guys interested in your project. Time to draw up a nice clear block diagram, maybe a short description of what it is supposed to do. You'll get about a dozen messages full of good improvements and suggestions about 4 hours after the picture appears.

_________________
Imagecraft compiler user
 
 View user's profile Send private message Send e-mail Visit poster's website 
Reply with quote Back to top
indianajones11
PostPosted: Jul 04, 2012 - 05:05 PM
Raving lunatic


Joined: Nov 28, 2004
Posts: 3552
Location: San Diego, Ca

Rolling Eyes Justin, you never told people what was wrong with the ADC code. I assume you fixed it Rolling Eyes since you've moved on to another topic. You don't know what you're doing/talking about with high voltage mains and you need to leave that alone. WHY would you want to do an adc of the boring 50-60 Hz mains voltage anyway ?!

Since you will do it anyway...you BETTER use a transformer ...period ! Confused

_________________
1) Studio 4.18 build 716 (SP3)
2) WinAvr 20100110
3) PN, all on Doze XP... For Now
A) Avr Dragon ver. 1
B) Avr MKII ISP, 2009 model
C) MKII JTAGICE ver. 1
 
 View user's profile Send private message  
Reply with quote Back to top
justinjohney
PostPosted: Jul 05, 2012 - 07:16 AM
Hangaround


Joined: Jun 04, 2012
Posts: 295
Location: Mumbai,India

how can i insert my pdf schematic here.
 
 View user's profile Send private message  
Reply with quote Back to top
dbrion0606
PostPosted: Jul 05, 2012 - 07:24 AM
Posting Freak


Joined: Jan 07, 2012
Posts: 1195
Location: North of France

The IMG button allows you to insert an image.
The option "add an attachment" allows you to add a file .
It becomes activated when you preview before posting.
 
 View user's profile Send private message  
Reply with quote Back to top
JohanEkdahl
PostPosted: Jul 05, 2012 - 08:08 AM
10k+ Postman


Joined: Mar 27, 2002
Posts: 18531
Location: Lund, Sweden

Quote:
The option "add an attachment" allows you to add a file .
It becomes activated when you preview before posting.


Or if you start out writing your post by clicking the "new reply" button rather than using the "Quick Reply" area.


Last edited by JohanEkdahl on Jul 05, 2012 - 08:26 AM; edited 1 time in total
 
 View user's profile Send private message Visit poster's website 
Reply with quote Back to top
justinjohney
PostPosted: Jul 05, 2012 - 08:08 AM
Hangaround


Joined: Jun 04, 2012
Posts: 295
Location: Mumbai,India

this is my schematics.
components values are not shown here
comment on it.
 
 View user's profile Send private message  
Reply with quote Back to top
justinjohney
PostPosted: Jul 05, 2012 - 01:51 PM
Hangaround


Joined: Jun 04, 2012
Posts: 295
Location: Mumbai,India

actually i'm using millivolt sensing. thats why i discarded the transformer. moreover i need a small one.
 
 View user's profile Send private message  
Reply with quote Back to top
mtaschl
PostPosted: Jul 05, 2012 - 02:14 PM
Resident


Joined: Aug 21, 2002
Posts: 895
Location: Austria

justinjohney wrote:
comment on it

All bypass caps missing.
U2 need caps on input and output (I can't read the type, refer to the datasheet, typically >>10uF)
For U3: Read AVR042 Hardware Design Considerations

_________________
/Martin.
 
 View user's profile Send private message  
Reply with quote Back to top
bobgardner
PostPosted: Jul 05, 2012 - 03:20 PM
10k+ Postman


Joined: Sep 04, 2002
Posts: 21253
Location: Orlando Florida

Its not much clearer to me what it does yet. I was sort of hoping for the paragraph description too. There are several flavors of three phase... wye, delta. I see yours has a neutral, so I guess it possible to measure amplitude to neutral, but the bridge rectifiers dont work if the 'ac legs' and the 'minus dc' have the same ground. Every bridge rectifier I have ever seen is driven from a transformer secondary where one leg of the ac is going up and ther other leg is going down symmetrically. And another question... why measure the amplitude of each leg, if they are all the same? If they have different amplitudes, I need some more explanation.

_________________
Imagecraft compiler user
 
 View user's profile Send private message Send e-mail Visit poster's website 
Reply with quote Back to top
justinjohney
PostPosted: Jul 06, 2012 - 08:22 AM
Hangaround


Joined: Jun 04, 2012
Posts: 295
Location: Mumbai,India

how much current needed for atmega series for VCC at 5V?i think its about 360mA
 
 View user's profile Send private message  
Reply with quote Back to top
dbrion0606
PostPosted: Jul 06, 2012 - 10:30 AM
Posting Freak


Joined: Jan 07, 2012
Posts: 1195
Location: North of France

Well, there is an issue with your supplies:
you seem to use an 78**l**05, with a to92package (at most 100 mA); you should instead use a 7805 with a TO3 package (up to 1 A).
You should bewaare, when you read the datasheet, that the input (0.3 uF) and output (0.1 uF)capacitors are meant (avoiding high frequency oscillations) for continuous unregulated input: for input coming from a bridge, one add a 100-200uf, to filter the main "residuals" (both 100-200 uF and 0.3uf are useful, because electrolytic capacitors do not behave well at high frquencies).


To be sure your atmega is not starving, you might use a simple version of the soft you are developping (ex : only one aDC channel tested) and test everything is OK at starting time, and say, 1 hour after (the regulator has to dissipate (15*1.4 - 5)*0.4 = 11 watts, messeems : when it grows too hot, it stops functioning without furtehr damages, leading to oscillations).
 
 View user's profile Send private message  
Reply with quote Back to top
justinjohney
PostPosted: Jul 06, 2012 - 01:39 PM
Hangaround


Joined: Jun 04, 2012
Posts: 295
Location: Mumbai,India

you are write TO 220 package is needed for regulator. and by pass capacitor are needed.
but for how much current will drawn by atmega168?
is it around 300mA?
 
 View user's profile Send private message  
Reply with quote Back to top
justinjohney
PostPosted: Jul 06, 2012 - 01:44 PM
Hangaround


Joined: Jun 04, 2012
Posts: 295
Location: Mumbai,India

@ BOBGARDNER
actually the dc - and ac legs are not connected, they are isolated.
Quote:
why measure the amplitude of each leg, if they are all the same? If they have different amplitudes, I need some more explanation.
actually the 4 legs are RBY and earth.i take some samples and compare it thats only.
 
 View user's profile Send private message  
Reply with quote Back to top
bobgardner
PostPosted: Jul 06, 2012 - 02:23 PM
10k+ Postman


Joined: Sep 04, 2002
Posts: 21253
Location: Orlando Florida

AVR should only be using several 10s of ma.

_________________
Imagecraft compiler user
 
 View user's profile Send private message Send e-mail Visit poster's website 
Reply with quote Back to top
dbrion0606
PostPosted: Jul 06, 2012 - 02:48 PM
Posting Freak


Joined: Jan 07, 2012
Posts: 1195
Location: North of France

Quote:
"you are write TO 220 package is needed for regulator. and by pass capacitor are needed.
but for how much current will drawn by atmega168?
is it around 300mA?"


No I wrote TO92 package would lead to a maximal current of 100 mA; the TO92 package is in the pdf you posted, and is consistent with the regulators name...

Now, let us look at what will be eaten :

* there is a LEd , LED2 -the first one..- which will eat ca 2 mA (resistor value known).
there are 3 LEDS, 3,4,5 whose resistor value is unknown : let us assume 10 mA each...
There remains the ATMega168:
according to http://www.atmel.com/Images/doc2545.pdf, page 304 (out of 377), it eats up to 12 mA at 8Mhz, with settings.
That sums up to about 45 mA (if nothing is forgotten) ... far enough from 100 mA to be reliable.

Whence do you write atmega168 draws 300 mA

Quote:
i think its about 360mA


? (in this hypothesis, you cannot consistently use the regulator in a TO92 package, a TO220 or TO3 package regulator would be needed, though more expensive and it will likely need an heathsink!).

If you google search for 7805 datasheets, tests circuits are only given with a continuous unnoisy input, leading to low bypass value, useful at high frequencies. It needs, too, a filtering capacitor to filter the non continuous, low frequency part of the rectified supply....
 
 View user's profile Send private message  
Reply with quote Back to top
bobgardner
PostPosted: Jul 06, 2012 - 04:12 PM
10k+ Postman


Joined: Sep 04, 2002
Posts: 21253
Location: Orlando Florida

Wikipedia says the 3 phase colors in India are Red Blue and Yellow, so I think you are building an overvoltage and undervoltage checker. I'd get 3 little transformers. They can be small because they are not providing any power. Use a comparator to detect the zero crossing of the reference phase, then you can take a voltage reading on that phase 3.333ms later, then the next sample at the peak of the next phase 6.666ms later. I'd scale the voltage so the peak voltage out of the secondary is about 4V. This will let you read a little over voltage.

_________________
Imagecraft compiler user
 
 View user's profile Send private message Send e-mail Visit poster's website 
Reply with quote Back to top
justinjohney
PostPosted: Jul 12, 2012 - 09:36 AM
Hangaround


Joined: Jun 04, 2012
Posts: 295
Location: Mumbai,India

if i'm give a regulated bridge output to ADC pin ,is it convert that voltage into a digit.(ie, between 0 and 1024)
 
 View user's profile Send private message  
Reply with quote Back to top
bobgardner
PostPosted: Jul 12, 2012 - 01:22 PM
10k+ Postman


Joined: Sep 04, 2002
Posts: 21253
Location: Orlando Florida

justinjohney wrote:
if i'm give a regulated bridge output to ADC pin ,is it convert that voltage into a digit.(ie, between 0 and 1024)


This has a lot of translation problems. My translator infers this as:
"If I supply the AC mains rectified (not regulated) and it is 370 volts, and I apply that to an AVR pin that can only handle 5V, will it convert the voltage into a 10 bit binary number than can be represented in decimal as 5 ascii digits?"

My answer would be no. You obviously need to attenuate or 'divide down' the rectified voltage. There is still a problem with what 'ground reference' to use to measure the mains. You can measure to neutral if you have one. When half a dozen experienced engineers recommend using an isolation transformer, they aren't typing just to exercise their fingers.

_________________
Imagecraft compiler user
 
 View user's profile Send private message Send e-mail Visit poster's website 
Reply with quote Back to top
justinjohney
PostPosted: Jul 13, 2012 - 05:50 AM
Hangaround


Joined: Jun 04, 2012
Posts: 295
Location: Mumbai,India

yes i,m using an isolation transformer and give it to adc pin below 1V. (millivolt sensing)
then what happens
Code:
if i'm give a regulated bridge output to ADC pin ,is it convert that voltage into a digit.(ie, between 0 and 1024)
 
 View user's profile Send private message  
Reply with quote Back to top
bobgardner
PostPosted: Jul 13, 2012 - 01:21 PM
10k+ Postman


Joined: Sep 04, 2002
Posts: 21253
Location: Orlando Florida

OK, your input signal is a +-1V peak sine wave. The a/d input on the AVR can't handle the negative part of the input, so you need some 'signal conditioning' like an opamp to bias it to the middle of the a/d range. If 5V is on AVCC, a 2.5V bias is good. A 10 bit binary number that can be printed in decimal as 0 to 1023 is not a digit in the way I use the term. It is 4 decimal digits.

_________________
Imagecraft compiler user
 
 View user's profile Send private message Send e-mail Visit poster's website 
Reply with quote Back to top
Display posts from previous:     
Jump to:  
All times are GMT + 1 Hour
Post new topic   Reply to topic
View previous topic Printable version Log in to check your private messages View next topic
Powered by PNphpBB2 © 2003-2006 The PNphpBB Group
Credits