Dave with a 47k resistor the current at 12 volts is only about 255 Micro amps. I have used this method hundreds of times and never had any problems. The input resistor can be as high as 270K and stil works well.
Dave with a 47k resistor the current at 12 volts is only about 255 Micro amps. I have used this method hundreds of times and never had any problems. The input resistor can be as high as 270K and stil works well.
If the input is only for a trigger (e.g.. turns on with the ignition), why don't you use a 5V reg (7805)?
I've used them and it works perfectly.
Badger
And it only cost about 100x as much as a resistor, and needs filtering so add another 10x, and is slow to respond, but sure a regulator and many other complex circuits will work to sense a level that doesn't change very fast. Grahamg has the cheapest solution with a single high value resistor, if the 5V VDD supply is capable of both sourcing and sinking current. A resistor divider pair will work if the supply can source only. No need for zeners or anything else.
This certainly has gone tangential to your original question. Going back to the beginning, for the 10k and the 4.7k a 1/8W current rating would be enough.
I don't see where you said what PIC you're using. I looked at the 12F683 and see where it would be able to clamp 20mA at GPIO input. You may be able to use one resistor of sufficient size to take advantage of PIC internal circuitry to clamp that 12VDC but the datasheet shows only +.3V over VDD. To me a better way would be the voltage divider scheme you first posited.
I hope you finally got your answers.
My original question asked if I had it right or if I needed to make the resistors bigger. Suggestions were made to make the voltage smaller. My question is that with 2.5 volts, will that trigger the input? For a digital signal, you need a 1 or 0, or in this case, 5 volts or 0 volts. Am I missing something?
I am using the 16F819. After reading the other article (link that was posted), I figured I would use the VD to a transistor to trigger the input. I just don't want to blow anything up.
Thanks for your help thus far. I just want to understand it better.
Tony
Tony,
I did not see where you indicated which pin on the PIC you are using for input.
As you probably already know that which pin you use matters in the answer to your question about what voltage will be recognized as a 1 (high) or 0 (low) by the PIC.
The PIC you are using has 3 types of digital input pins, each with different thresholds for low and high. Standard Inputs, TTL Buffered inputs and Schmitt Trigger inputs.
Table 15.4 of the DS has the Min/Max for Input Low and Input High for each of the pin types.
You probably already knew this, but just in case.
Regards,
Regards,
TABSoft
No. You don't need to make the resistor bigger if you keep the same ratios previously stated.
Yes. IMSWO by looking at the datasheet if you're using a TTL input 2.5 V is above the level supposed to be recognized as a high. Why you don't design it for more voltage than that is curious. I'm assuming you'll have a 12v signal you'll have to schmooze so why not make it 5ish volts and not worry about ambiguity. According the datasheet, if I understand it right, with a Schmitt trigger input 2.5 v is way over a recognizable high. So pick a pin type and design for it.
I was being conservative for any over voltages from the vehicle, hence the Zener. I just found another circuit with the same #2 VD setup as above. 2.2k to ground and 33k to the output yields 1.7 volts when 13.8 volts is applied. No cap and no Zener and on a 16F628A, RB0.
This is all new to me as I've been using opto's. Never looked at the datasheet that way as I had never intended to connect it directly. Didn't think you could, but now I'm finding out that you can. Looking to explore it further. Right now, my pins are RB0, RB1 and RB2.
Bookmarks