External Analog Voltage In

Dippy

Moderator
"Wow -- I thought I had just asked a simple question. I think I would be afraid to ask a difficult one."
- often the difficult ones get fewer replies because fewer people know the answers :)

Don't worry about it.
Sit back and enjoy the ride. One thing you will notice is how many people don't read each other's replies. It's because they exceed the Ernerst Brognoff's 10 lines-without-spacing law .

Pilko. Ask a question about the effects on Switched Mode Power Supplies casued by using different types of diode. You should get fewer answers but you will cause extra work for Google ;)
Or maybe ask one about PIC versus PICAXE - that usually gets everyone going.

Or pretend to be a schoolboy trying to keep tabs on some pet.
Or just mention breadboards... plenty of replies and photos.... hopefully with peble I won't have to look at photos of tangled wire any more ;)
 

BeanieBots

Moderator
@Doc,
Yes, that's parasitic powering.
Does it do any harm?
Not unless the current exceeds the internal catch diode limit which for some chips can be as low as 2mA.
Remember, it's not just the PICAXE that is being powered up that way, it's EVERYTHING connected to the PICAXE power rail AND anything on the PICAXE outputs.
Also, don't forget that a PICAXE power rail SHOULD have at least some capacitance on it. There will be an instantaneous current as well if a voltage is suddenly connected to an unpowered input.

@Dippy,
If Nesbit had been "clamped", that would never have grown so much:p
 

Dippy

Moderator
Haha. Is clamped the same as shot?

Good point about the 'rest of the circuit' for parasitic powering.
And it can be a real pain when desiging multi-PIC boards.

Lordy, this over-voltage protection is turning into a monster...

Pilko, do you actually NEED any?
Or is this thread meandering into Red-Herringisation?

We also haven't discussed the frequency relationship of overvoltage protection. I think we should get at least a dozen 30 line postings on that?

And BB doing a 'real life' analogy? Egad, he's turning into Hippy! He'll be talking about State Engines, Mission Critical situations and Risk Assessment protocol next :)
If he moves onto Real Ale then we're all in trouble.
All too much of a synthetic perception system for me.
World's gone mad. I'm going back to a lively place like Tristan da Cuhna.
 

moxhamj

New Member
BB, that is all very useful information. So - it is quite possible the circuit in post #1 won't work if it is powered up in the wrong order with the pot wound right round and then those protection diodes get zapped. A real circuit will have a capacitor(s) across the picaxe pins increasing the instantaneous turn on current as you say.

2mA? Maybe bump up that 1k to 4k7 or something?

Then of course, another question. Why would you have two supplies if the circuits are right next to each other? Which implies they are not, and that the sensor circuit is some distance away. Which brings up issues of what sort of wires are used, shielding, twisted pair etc, nearby sources of interference, the source impedence (which I have just bumped up to 4k7). To take an extreme example, I tried sending 12V DC down a fence line 500 metres running under high tension power lines. I know you can stand under power lines with a flouro bulb and it will light up, but I was surprised to get almost more AC than DC at the other end of the fence line. More information on the circuit in post #1 would be most helpful here.

One could ask - what is the best buffer/twisted wire pair/shielding solution to send an analog value from a to b? And the answer might be, if the distance is long (?>20 metres) to have a picaxe at one end doing the sampling, and send the data digitally with serin/serout.

But if the two circuits are right next to each other, it will make things much easier as you could just power them off the same 5V supply...
 
Last edited:

Dippy

Moderator
"So - it is quite possible the circuit in post #1 won't work if it is powered up in the wrong order with the pot wound right round and then those protection diodes get zapped"
- good thoughts. But as we don't know the rest of the circuit we can only guess (as usual eh?).

However, the series resistor mentioned later should inadvertently save the day.

"Why would you have two supplies if the circuits are right next to each other?"
- maybe Pilko has his/her reasons?

"Which implies they are not, and that the sensor circuit is some distance away."
- might be, might not. Only Pilko can answer this mystery.

For non-really-nasty modest lengths and where fast ADCing is not needed a simple RCR is fine.

"One could ask - what is the best buffer/twisted wire pair/shielding solution to send an analog value from a to b? And the answer might be, if the distance is long (?>20 metres) to have a picaxe at one end doing the sampling, and send the data digitally with serin/serout."
- that's the method I use for current sensing in my S/mode PSU. Local sensing is digitised.
Some may prefer a lowish impedance driven follower buffer.
Horses for Courses and a 'scope is useful.

"But if the two circuits are right next to each other, it will make things much easier as you could just power them off the same 5V supply..."
- hopefully Pilko would have made that the first consideration but has good reasons for the initial question.
 
Last edited:

pilko

Senior Member
The original question(s) were generic -- I just wanted to know if I could use an external source for analog in. One example might be measuring car battery voltage - Reducing the voltage of course with maybe a 10/1 potential devider.
I apologize for not being more specific in the first place. I didn't expect the knowledge based momentum.
 

BeanieBots

Moderator
Oh no, you mentioned "car".:eek:
That will cause another few dozen posts.
Please say you have no intention whatsover of ever putting a PICAXE in a car:(
 

MFB

Senior Member
Please don’t be worried about putting a microcontroller in a car. There is really nothing to fear but fear itself.
 

Dippy

Moderator
haha.
Don't worry Pilko, everyone likes to insert their little bits.

Oh no. I'll second that :eek: - Fatal mentioning "car".

Mumble,mumble... Risk Assessment .... mumble,mumble.... worst case scenario ...mumble,mumble .... Mission Critical ...mumble,mumble ... Automotive grade ....

Sticking it in cars is a piece of cake if you know how.

PER-LEASE can someone knock up a 2 page .pdf and post it describing car connections.
Page 1 will, of course, be the Author's disclaimers ;)

"There is really nothing to fear but fear itself."
- Dunno about that... the thought of some people on this Forum installing a micro in my car scares the carp out me.
 
Last edited:

moxhamj

New Member
Measuring a car battery voltage? Should be pretty simple. Get a 20k 1% resistor in series with a 10k 1% resistor. (use 1% for accuracy). That divides by 3 so 15V is 5V into the picaxe and 12V is 4V etc. Use readadc10 to give you good resolution. The resistors are high enough value that spikes will be current limited. Put the picaxe in a socket if you are worried it might get zapped, but I bet it won't. The resistors are high enough value that parasitic powering won't be an issue as it will be under the 2mA for the protection diodes. No zeners needed. No chance of a pot wiper feeding lots of current in as it is using fixed resistors.

My picaxe radiator fan controller is still running fine after several years. And I've used the 20k/10k divider on a number of solar powered circuits that use old car batteries, including an electric fence controller that is generating high voltage pulses once a second (picaxe generates the pulses and measures the battery voltage).
 
Last edited:

RobertN

Member
Dr. Acula's input voltage divider values look about right, I would use similar values. It maybe a good idea to add a .01 uf. cap to ground at the junction of the resistors and input, to do a little filtering and help bypass fast and/or high voltage transients. Some transients in the vehicle world can have a fair amount of energy.

Another issue with electronic circuits in the vehicle environment is protecting the 5 or 3.3 volt regulator from transients and reverse voltages.

Years ago when solid state components first were available, the R&D guys came up with a solid state digital hour meter. They couldn't understand why it would fail after a few hours on a crawler tractor. After all it worked on the bench for weeks. Had to show them on a scope the -60 volt transient from the injector pump shut off solenoid. You didn't need a storage scope to see it. They kluged up the power input so it would run, until TO-92's lost their heads from vibration.
 
Top