A car's computer or PCM - ECM (powertrain control module - engine control module) is designed to read various sensors such as the crankshaft position sensor to deliver electrical commands to the fuel injectors, ignition system, transmission and camshaft position to name a few. This is done by using a predetermined program developed by individual manufactures such as Gm, Ford and Honda. Each manufacturer has its own developed program which is unique. The computer will make changes these systems and components by monitoring the engine while it's running to maintain optimum perform and fuel economy. Hybrid vehicle's computers have the additional job of coordinating the electric motor in conjunction with the native gasoline engine. A car can have several other computers onboard such as the BCM (body control module) and TCM (transmission control module) and will be connected to one another using a communication data bus.
This computer is a self learning device which has been programmed to adjust for driving conditions and the habits of the driver. This adaption is learned over time and will change while in operation. There are several system monitors that will run in the background of the computers operation system. These monitors test and re-test certain systems such as the EVAP emission system to make sure they are functioning correctly. Monitors must cycle completely before the computer will give the car a clean bill of health. This is why you must drive the car a certain distance after clearing the codes before a smog or safety inspection can be performed.
The computer is located in one of two places, either under the hood or under the dash. Each manufacturer will decide to install the computer anywhere makes sense to them while designing the car so each location will be different. When locating the computer follow the main engine wiring harness and it will lead you to the location of the computer.
A car's computer can go out at anytime due to vibration or an electrical surges caused by the alternator, battery or starter. Moisture will also take it's toll on these items. Fortunately your cars computer has been programmed to sense system malfunctions and is able to record the problem in the form of a trouble code which will then turn the check engine light on. So the appropriate repairs can be made a code reader is then used to access the computer and display the code. Once these repairs are completed the code will need to be cleared and erased from the computer memory. If the computer has determined a large enough problem has occurred it will switch the car over to "limp mode" which is designed to keep the engine running in a reduced power mode to prevent engine damage or increased emissions. There are many connections between the sensors, actuators and various motors in the system. These connections are performed by a main computer wiring harness which must be repaired when a short or open circuit occurs.
In older cars made before 1996 its possible for you to change the car's computer because the operation system is pre-programmed by the manufacturer and you simply unplug the old computer and install the new one and you are off and running. Car's made after 1996 have more adaptive programs which are updatable. This means that a particular program must be downloaded from the old computer to the new one using a scanner capable of doing such an operation. Also any factory updates should be done at the time of the new computer installation.
There are two ways to go about replacing the car's computer. The first is to go to the dealer and have them replace the unit while supplying any updated needed at that time which can cost between $1000.00 (US) and $2500.00 (US) in most cases depending on the car's manufacturer. The second way is to get a replacement from a wrecking yard which will work in most cases and will usually cost between $350.00 (US) and $600.00 (US).