View previous topic :: View next topic |
Author |
Message |
s0y
Joined: 29 Mar 2015 Posts: 7
|
need pic16f676 based voltmeter code |
Posted: Sun Mar 29, 2015 6:39 am |
|
|
sir i need a pic16f676 based 7 segment voltmeter code
my hardware is this
Code: |
vdd | 1 14 | Vss
(0)1ST_DISPLY--> RA5 | 2 13 | AN0 <-- ADC SENCE (I)
(O) SEG_(G) <-- RA4 | 3 12 | AN1 --> 3RD_DISPLY (0)
N\C MCLR | 4 11 | RA2 --> 2ND_DISPLY (0)
(O) SEG_(F) <-- RC5 | 5 10 | RC0 --> SEG_(A) (O)
(O) SEG_(E) <-- RC4 | 6 9 | RC1 --> SEG_(B) (O)
(O) SEG_(D) <-- RC3 | 7 8 | RC2 --> SEG_(C) (O)
--------- |
7SEG CC LT543
VALUE 0 TO 500v OR ABOVE
please help me sir |
|
|
temtronic
Joined: 01 Jul 2010 Posts: 9243 Location: Greensville,Ontario
|
|
Posted: Sun Mar 29, 2015 8:33 am |
|
|
If you use the 'search' feature of this forum,you'll find many 'threads' about your school project.
When you go to test it, be EXTREMELY careful ! 500V DC WILL KILL YOU !
I suggest you break the project into several smaller steps....
1) get PIC to run a '1Hz LED' program
2) configure PIC with LEDs and test each segment/display
3) code for a 0-9 sequence on the display
4) code for a 000-999 sequence for the display
5)code for 0-5 VDC into the ADC
6) code for 00-50 VDC for the display
I would NOT attempt a higher voltage unless you read and understand how and why it's critical to use proper layout of PCB, correct component values, etc.
HTH
JAY |
|
|
s0y
Joined: 29 Mar 2015 Posts: 7
|
|
Posted: Sun Mar 29, 2015 8:54 am |
|
|
sir i need 0 to 500v ac not dc |
|
|
temtronic
Joined: 01 Jul 2010 Posts: 9243 Location: Greensville,Ontario
|
|
Posted: Sun Mar 29, 2015 10:20 am |
|
|
OK.. NOW you'll need to design/build a precision AC to DC converter. Design specs are naturally based on frequency( I'm assuming 50Hz ?). Be sure to add proper protective devices in this 'analog front end'. If you don't best case...you fry the PIC, worst case, you get killed. 500 volts AC or DC is LETHAL.
You might consult any number of DVMs available on the market to see what they do.
I cannot suggest a 'real' circuit due to legal implications.
Jay |
|
|
s0y
Joined: 29 Mar 2015 Posts: 7
|
|
Posted: Sun Mar 29, 2015 10:29 am |
|
|
Sir I have hardware. I need only sample code. I convert 500v ac to 5v dc for adc |
|
|
Mike Walne
Joined: 19 Feb 2004 Posts: 1785 Location: Boston Spa UK
|
|
Posted: Sun Mar 29, 2015 10:58 am |
|
|
s0y wrote: | Sir I have hardware. I need only sample code. I convert 500v ac to 5v dc for adc | Do you mean that you already have your 0-500V AC input converted to a true, isolated 0-5V smooth DC signal?
Mike
EDIT. Please show us your circuit. |
|
|
s0y
Joined: 29 Mar 2015 Posts: 7
|
|
|
Ttelmah
Joined: 11 Mar 2010 Posts: 19538
|
|
Posted: Mon Mar 30, 2015 1:01 am |
|
|
That is not remotely safe.
A single component failure, and you are dead.
Is the resistor rated for 500vac (remember this potentially means a DC rating over 700v)?. What happens if this fails?. |
|
|
s0y
Joined: 29 Mar 2015 Posts: 7
|
|
Posted: Mon Mar 30, 2015 1:21 am |
|
|
harware is not my problem .i need sample ccs code for it ac voltmeter |
|
|
Ttelmah
Joined: 11 Mar 2010 Posts: 19538
|
|
Posted: Mon Mar 30, 2015 1:34 am |
|
|
Seriously, hardware _is_ your problem.
If that circuit was used by a student, he would be sent back a year. If it was used in a piece of commercial kit, it would fail every test needed before sale instantly. That circuit as shown, is roughly as dangerous as an electric chair.
Using non isolated signals immediately means every component round the PIC needs to be double insulated. Display etc..
It is a really dangerous circuit.
On the code, you have already been told to search the forum, this type of question has been answered many times here.
Nobody is going to write the code for you, especially since doing so, they could be considers 'accessories', when you kill yourself, or even worse somebody else. |
|
|
s0y
Joined: 29 Mar 2015 Posts: 7
|
|
Posted: Mon Mar 30, 2015 1:39 am |
|
|
sir here this circuit already using in this project commercially
my ac volt not 500 every time.
it is normally 0-250v |
|
|
temtronic
Joined: 01 Jul 2010 Posts: 9243 Location: Greensville,Ontario
|
|
Posted: Mon Mar 30, 2015 10:55 am |
|
|
That circuit is LETHAL !!!
DO NOT USE IT !!!
I cannot stress how important it is to NOT USE IT !!!
PICs are cheap, what is your LIFE worth ????
There is NO way that circuit is in ANY commercial product as it'd NOT pass even ONE of the safety codes on EITHER side of the pond.
It also is NOT a precision AC to DC converter. Even if you use it at MUCH lower voltages( <30 V AC), you'll have to have the PIC do a LOT of 'math' to get the 'numbers' right.
Jay |
|
|
Mike Walne
Joined: 19 Feb 2004 Posts: 1785 Location: Boston Spa UK
|
|
Posted: Mon Mar 30, 2015 1:18 pm |
|
|
s0y wrote: | sir here this circuit already using in this project commercially
my ac volt not 500 every time.
it is normally 0-250v | You're not getting it.
Sort out a SAFE ac to dc converter, THEN you will get help.
There are now three of us saying the same thing.
Mike
PS Do NOT argue with either of the Mr T's |
|
|
temtronic
Joined: 01 Jul 2010 Posts: 9243 Location: Greensville,Ontario
|
|
Posted: Mon Mar 30, 2015 1:48 pm |
|
|
I suppose...
the good news is that since this is a Proteus/ISIS 'project', he really can't hurt himself with ISIS generated electrons...as they don't flow.
and...
the bad news is that since this is a Proteus/ISIS 'project', he really can't get it to work with ISIS ... as we all know ISIS is 'busted'.
Jay |
|
|
s0y
Joined: 29 Mar 2015 Posts: 7
|
|
Posted: Mon Mar 30, 2015 11:27 pm |
|
|
thanks |
|
|
|