Jump to content
Electronics-Lab.com Community

Car battery to parallel port


Recommended Posts

Hello friends. I'm a newbie at the forum and (very much) a newbie at electronics. I intend to monitor a car battery's status (live or dead) using the PC's parallel port. From the looks of it, the inputs on a parallel port work at 5v, so I'd have to put at least one resistor to drop the battery's 12v to 5v so the port's input will give me a "live" reading. My problem is that the battery has 60amps and I don't know how to connect that to the pc's parallel port and not fry the port. In my understanding, I have to connect the (reduced to) 5v positive from the battery into a (non inverted) input pin on the parallel on the pc, and the ground from the battery on one of the ground pins on the parallel port. But if I do that, won't I instantly fry the board (and my computer too)? How should I go about this?

Thanks for any input!

Link to comment
Share on other sites


When you use your resistive divider to drop the voltage down to 5 volts, you just need to select values of resistors to limit the current. This is basic ohm's law. V/R.
Was this your question or did I misunderstand?

I am not sure how you intend to monitor status by using one 5 volt pin. As an interface to the parallel port, you could use an LM3914. This would give you the resolution you need. There are also many other ways to proceed. You need to convert from analog to digital to read anything useful from the parallel port.

MP

Link to comment
Share on other sites

Hello.

MP: I just need to know if a switch that's connected to a car battery is on, or off. So basically just knowing if the battery/switch is outputting anything will do fine. If I'm not mistaken, a 5v on a (few) certain parallel port pins will give me a "high" reading, right? So basically all I have to do is create a resistive divider that will drop the voltage to 5v AND the current to a few miliamps (or whatever the parallel port can cope with), correct?

Omni: I'll look into the IC but I think it's a bit overkill for my purpuse.

Thanks guys for the input.

Link to comment
Share on other sites

TJ,
Correct on both questions. I recommend that you stay under 5 mA. I normally use 5V through a 4K7 ohm resistor as a parallel port pin high. For best results you do not want to float the pin in any state. You should insure it always has a 0V or 5V level by tying the port pin high or low. Otherwise it might float into an unstable voltage and report incorrectly.

Additonal note: The car battery is not a true 12 volt source. Rarely will you see a good automotive battery read 12 volts. It is usually closer to 14. You want to make sure you do not exceed the 5 volts to the parallel port. Add a zener diode for protection if needed or use a 5 volt regulator. An opto-coupler would also be an alternative. Exceeding 5 volts to the parallel port could damage it.

MP

Link to comment
Share on other sites

Thanks again MP for your time (and patience) :-)

One more: How would a LM7805 fare in a running car? If I read the voltage on my car while it is running, it goes from 11v to 14v, depending if the air conditioner/stereo or whatever is turned on or not. Would the LM7805 need a decoupling capacitor in that case (I'm not sure which capacitor to use or how to wire it, so it'd be great if I didn't need one)?

Or is the LM7805 not suited for circumstances where the input signal is not stable and there are peaks from the crank etc?

Link to comment
Share on other sites

An LM7805 will work fine in your automotive application. You could also use a LM78L05 which has a smaller package. You will certainly need the capacitors on input and output. For the input, it depends on how clean the DC12 is. I have never seen a car generate a real clean DC voltage, so I would recommend that you go with a fairly large value on the input. On the output, you will want a 0.1 uf in parallel with a larger value such as 10 uf, both bypassed to ground. If you don't have a 10 uf, use anything from 4.7 to 100 uf. This is not a critical application and you have a lot of latitude to play with here. For your application, I doubt that you will see any difference. 

Also, I don't mean to change your thoughts on the design, but if you are only using the voltage as a trigger, you could also use a comparator chip to do this.


MP

Link to comment
Share on other sites

Im really dumb and all so maybe I can provided some simpler input that's more than likely useless.  The experienced guys confuse me a lot.  Use a LED maybe?  If it needs to be hooked to a comp then use a relay and have a high pin connect to a low pin through the switch.  What ever your interface is, I dont know but theres a program called ParPort that will allow you to tun on pins and detect a high signal on the inputs.

Be as cautious as possible when hooking stuff to a comp.  When I was a little younger I hooked a phone line directly to my headphone jack (bad idea).  50V + soundcard = boom!

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
  • Create New...