Foil produces coloured lights when the tip is not depressed but is in contact with the opponent's lame'. The circuit is breaking when the blade flexes as it contacts the lame' or when the point is jarred. Could be caused by grit in the tip, a broken wire whose ends normally remain in contact, or a separated wire and cup. There is no light when a touch is made. You are not hitting properly.
Spring is too heavy.
Compress it or heat one end with a match. You are grounding your own foil to your opponent's lame'. The foil wire is shorting to the weapon. Check the integrity of the insulation along the wire and beneath the cushion. Also make sure no wire ends at the clip are touching the rest of the weapon.