Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

making a voltage / amp tester with a pic 16C711-04

Status
Not open for further replies.

terramir

Member
is it possible to make a voltage/ amp tester with two of the four A/D converter pins?
and use part of the optuput pins on the B port to switch the voltage and amp tester between different circuits. this would help me in a project tremendously.
Anyone got an answer with the parts necessary to make the pin's like switches?
voltage range to be measured 0.1V to 19.5 V on one tester on the other .1 to 5.0 V if it goes any higher I got a problem matter of fact if it goes above 4.1 V it needs to be turned off period. if the individual measurements 4 of them go below 3.2 V it also needs to kill the circuit.
and if the ampage which will have to be measured through some sort of part goes above 3 Amps on one side or above 1 amp on the other side A circuit needs to be killed too. further more if the current flow on one side goes below a certain point or doesn't go below a certain point after a certain voltage requirement has been forfilled and time has past a circuit has to be killed.
there are only three circuits that have to be switched on off ergo killed or started etc. but there are about seven points that will have to be switched to for measurements since I have 8 B port output pins I could use a combination of three for the kill/start (kill would be on!) switches and combination of three pins for the switching between measurements and then just check the voltage and current in differnet cycles of the same circuit selection state.
is this all doable?
Can I measure current and how what external cheap parts do I need?
and what external chaep part do I need to measure voltage of this range considering the pin can only handle somewhere around 4 to 5 volts and very little current. well these are my needs and this is the pic I have handy. and this project has already bankrupted me :(
some hints would be appriciated.
terramir
 
terramir said:
is it possible to make a voltage/ amp tester with two of the four A/D converter pins?
and use part of the optuput pins on the B port to switch the voltage and amp tester between different circuits. this would help me in a project tremendously.
Anyone got an answer with the parts necessary to make the pin's like switches?
voltage range to be measured 0.1V to 19.5 V on one tester on the other .1 to 5.0 V if it goes any higher I got a problem matter of fact if it goes above 4.1 V it needs to be turned off period. if the individual measurements 4 of them go below 3.2 V it also needs to kill the circuit.
and if the ampage which will have to be measured through some sort of part goes above 3 Amps on one side or above 1 amp on the other side A circuit needs to be killed too. further more if the current flow on one side goes below a certain point or doesn't go below a certain point after a certain voltage requirement has been forfilled and time has past a circuit has to be killed.
there are only three circuits that have to be switched on off ergo killed or started etc. but there are about seven points that will have to be switched to for measurements since I have 8 B port output pins I could use a combination of three for the kill/start (kill would be on!) switches and combination of three pins for the switching between measurements and then just check the voltage and current in differnet cycles of the same circuit selection state.
is this all doable?
Can I measure current and how what external cheap parts do I need?
and what external chaep part do I need to measure voltage of this range considering the pin can only handle somewhere around 4 to 5 volts and very little current. well these are my needs and this is the pic I have handy. and this project has already bankrupted me :(
some hints would be appriciated.
terramir

The only comment I would have on the PIC is that it's an OTP chip, or possibly a UV eraseable version (JW) - this makes the development much slower, and more expensive. A more modern FLASH or EEPROM chip, such as the 16F876 would make development cheaper and faster - but as long as you have a JW version of the 711, it doesn't really matter.

Another advantage would be higher resolution, the 711 is only 8 bits (I think!) and the 16F876 is 10 bit.

All you need for a voltmeter is a simple resitive attenuator feeding the PIC pin - if you want to switch ranges, simply switch different value resistors in circuit - probably the best way would be to use small relays fed by driver transistors.

To measure current, you simply measure the voltage drop across a resistor which feeds the circuit - generally you would use an opamp to amplify the voltage drop across the resistor, again you could switch ranges using small relays.

The main problem is designing it so all measurements use a common ground, although by using a differential opamp for the current amplifier you can overcome that - the voltage measurements will usually use a common ground anyway.

If required, you could actually switch the ground connection with relays as well.

But the project is pretty easy, there's not really anything difficult involved.

You could have a look at my analogue tutorial (using the 16F876/7), this may well help your ideas along.
 
ok what is a resistive attenuator?
if you can fill me in on that little secret I would be apriciative also where can I fine a chaep circuit to program these things?
Also how does an op amp work forgive me but I'm more a PC modder
than a electronics geek
By the way the 16c711 is a flash chip according to micro chips website and has 4 10 bit d/a converters. so it's just like the little brother the thing is these things are cheap only 2.22 each

terramir
 
terramir said:
ok what is a resistive attenuator?
2 resistors in series, the top connected to the voltage you need to measure, the bottom connected to ground. The center, were the 2 resistores are connected together, will then only hold part of the original voltage. By choosing the resistor values carefully you can scale the signal this way.

terramir said:
By the way the 16c711 is a flash chip according to micro chips website and has 4 10 bit d/a converters. so it's just like the little brother the thing is these things are cheap only 2.22 each

The data given on microchips pic selection site is wrong. download the datasheet for the device and you will see it has EPROM memory (OTP). And the ADC is only 8 bits resolution.

As for a programmer, like already said in the other post, www.winpicprog.co.uk. It doesn't support the 16c711, but you really shouldnt use that chip anyway. Try to find a flash/eeprom device that suits your needs.
 
You can refer to **broken link removed**.
Anyway, did you extract the price from Microchip's website too? Unless you are going to buy tens of thousands from them, you aint going to get that price.
 
actually I wanted to use this one because I have two handy not used and ready to go, but I can't find a simple hardware programmer with software that will work with it. I really need to get this project off the ground also correction their avalible at all electronics for 2.25 each lol
off by 3 cents
That's where I got them from.

All I want is a simple programmer that will load the code.
I have few more questions
#1 where can I get the math to figure out
A: the resistive attenuator
B: The ampmeter circuit he said all I have to do is measure the voltage drop across a resistor.
#2 Now this is another critical thing most of the voltages I'll be working with are above 12V to be exact during peak hours the solar panels supply round about 17 V so while this thing will have a common ground the charging circuits this thing will be steering will be 16.4 / 14.5 / 13.8
ergo I will be measuring voltages in that range.
#3 I'm trying to figure another thing out are microchips ports individually bidirectional and do the high low states stay in place unless changed?
what I mean is if I tell let's say port b pin 6 to be configured for output and in one work cycle I tell it to pull high and pin 7 to be low will this stay that way while I'm reading port a pin three and do the subsequent calculation?
that would probably be using around 6 cycles with reading writing and and calculating ?

Even if in the end I decide to go with another pic I want to practice on these pics. I have em and that would just be a waste of 4.50 cents.
I have been trying to read the data sheet on this one and understand it, to say the least there are some words that confuse me
and the programming language is not very user friendly. You have to think in 0 and ones to understand the naitive code. I did some c++ programming but this is more like assembler which I haven't done yet.
I want to spend about maybe 30 bucks on this project since I have alrady spent way to much on this project in the first place.
help

terramir

PS: also how the heck does a differential opamp work? or well what does it do

terramir
 
terramir said:
actually I wanted to use this one because I have two handy not used and ready to go, but I can't find a simple hardware programmer with software that will work with it. I really need to get this project off the ground also correction their avalible at all electronics for 2.25 each lol
off by 3 cents
That's where I got them from.
The problem is that they can only be programmed once. You WILL make mistakes when programming the software, every one does. And you will need to try your software, see what's wrong, change it and try again. you would need a new chip every time you want to try your software...
You'll have a pile of dead chips in no time :(

terramir said:
#1 where can I get the math to figure out
A: the resistive attenuator
It's just ohms law

terramir said:
B: The ampmeter circuit he said all I have to do is measure the voltage drop across a resistor.
#2 Now this is another critical thing most of the voltages I'll be working with are above 12V to be exact during peak hours the solar panels supply round about 17 V so while this thing will have a common ground the charging circuits this thing will be steering will be 16.4 / 14.5 / 13.8
ergo I will be measuring voltages in that range.
that's why you need the resistive attenuator. To scale the signal to be in the range the pic can measure.

terramir said:
#3 I'm trying to figure another thing out are microchips ports individually bidirectional and do the high low states stay in place unless changed?
what I mean is if I tell let's say port b pin 6 to be configured for output and in one work cycle I tell it to pull high and pin 7 to be low will this stay that way while I'm reading port a pin three and do the subsequent calculation?
Yes, the pins hold there state while doing something else.
 
ahhh another question I wanted to ask since I started this
since I've been reading this data sheet and pulling my hairs out.
I'm trying to see if I have this right?
the D/A converter and plz correct me if I'm wrong works like this!
you have a capacitor on the outside being charged and it discharges every so often and pulls the d/a convertor to high this is then counted in an internal d/a register and the d/a pin is reset to low.
depending on your max and min you configure it to discharge once per what ever cycle. they are speaking about 2 8 and 32 tad what does this exactly mean does this mean the processor cannot do anything else while this thing is getting this value?
Also an 8 bit D/A convertor has a possibility of 255 values if I am correct.
so the resolution has to be set according to what range I will be measuring. can I use those 2 8 and 32 tad to scale different measurements? or should I do that hard ware wise
I'm thinking 20 to 4 volts in .1 increments and 5 to 1 volts in .05 increments.
What will I have to do to measure the the low voltages?
since the chip will probably be powered by about 3-4V input adjusted
by an lm 317.

and I am thinking about finding at least 1 uv erasable one of these to try my code out on first I mean shouldn't take that long to erase them under a nice cold cathode black light I have laying around.
so I don't waste these and for future projects I'll have that one handy to test my code
let me know what can be done
terramir
 
terramir said:
ahhh another question I wanted to ask since I started this
since I've been reading this data sheet and pulling my hairs out.
I'm trying to see if I have this right?
the D/A converter and plz correct me if I'm wrong works like this!
you have a capacitor on the outside being charged and it discharges every so often and pulls the d/a convertor to high this is then counted in an internal d/a register and the d/a pin is reset to low.
depending on your max and min you configure it to discharge once per what ever cycle. they are speaking about 2 8 and 32 tad what does this exactly mean does this mean the processor cannot do anything else while this thing is getting this value?
Also an 8 bit D/A convertor has a possibility of 255 values if I am correct.
so the resolution has to be set according to what range I will be measuring. can I use those 2 8 and 32 tad to scale different measurements? or should I do that hard ware wise
I'm thinking 20 to 4 volts in .1 increments and 5 to 1 volts in .05 increments.
What will I have to do to measure the the low voltages?
since the chip will probably be powered by about 3-4V input adjusted
by an lm 317.

If you have a read of my analogue PIC tutorial it will explain most of your questions, even though it refers to 10 bit A2D it's still mostly relevent. The 16C711 is a 14 bit core, just like the 16F876/7 used in the tutorial, so the code itself is pretty much the same - you only need to make slight changes based on the hardware differences.

You don't have any external capacitors as part of the A2D, everything is internal - again a quick look at the hardware of my tutorial will make everything clear.

and I am thinking about finding at least 1 uv erasable one of these to try my code out on first I mean shouldn't take that long to erase them under a nice cold cathode black light I have laying around.
so I don't waste these and for future projects I'll have that one handy to test my code

I don't know if a 'black light' is suitable or not (I seem to remember reading posts saying it doesn't work), generally you use specific UV erasers - the light from which is detrimental to your health, and must be used in a sealed box.
 
UV erasers use UV rays that are detrimental to our health. I've not erased PICs, but I've used them to erase EEPROMs and they typically take around 10+ mins. If you are using those CCs used for case modding, chances are that they will NEVER work. We are all advising you to switch PICs, not simply because it's a minor convenience, but because it is a MAJOR convenience.
The AD works on the basis of having 2 references, one V+ and another V-. The voltage range between these 2 references will be divided into 2^b divisions, where b denotes the number of bits.
V+ and V- are usually Vcc and 0V for PICs, though they may be configured to take reference from some external voltage. But do note that PIC inputs should not stray very far from 0-5V range, even for external voltage references.

P.S. Please try to phrase your problem more accurately and cut down on the acronyms and short-forms. It'll allow us to help you better.
 
A blacklight won't work
You need a germicidal UV tube (such as a G4T5). Any lamp made of glass probabely won't work as the glass blocks the rays that do the actual erasing (that's why the window in the chip is made of quartz).

Getting an UV version of the 16c711 and an UV eraser will cost you LOTS more then just getting a flash device...
also, it takes time to erase, a flash device can be reprogrammed instantly
 
Status
Not open for further replies.

Latest threads

New Articles From Microcontroller Tips

Back
Top