Yes, nervousness can affect a lie detector test. A lie detector test, also known as a polygraph, is set up to detect autonomic responses, which detect involuntary body functions that are not under conscious control, such as heart rate and skin conductivity. The premise behind a lie detector test, or polygraph, is that a lie is associated with guilt, and guilt is associated with a stress response. This stress response is the adrenaline response, also known as the fight or flight response. The polygraph then detects changes in heart rate, respiration rate, blood pressure, and muscular movement. Increases in these variables after a question is asked may be interpreted as a guilt response to a lie, and the answer to this particular question may be interpreted as a lie, and not the truth.
The problem with polygraphs is that although they are good at detecting a stress response, other factors besides guilt from not telling the truth may be present, like having anxiety and nervousness. When you are nervous and anxious, you will set-off the stress response. In this stress response, also known as the fight or flight response, the anxiety triggers the amygdala (part of the brain) to signal the hypothalamus and the pituitary gland. A signal is then sent to the adrenal glands (which sit on top of the kidneys), and adrenaline (epinephrine) is released. This adrenaline response causes an increase in heart rate, respiration rate, blood pressure, and muscle tension. So if you have anxiety and nervousness during a polygraph, your answer to a question and your subsequent adrenaline response might be misinterpreted as guilt, and hence a lie on the polygraph. Being emotional can affect the results of your polygraph, as anger and surprise can also set off the adrenaline response, in addition to anxiety and guilt.