Rough idle 2005 mazda3

once the eng is warmed up and i come to a stop with the brake pedal depressed, transmission in drive the engine idles down to~500 rpm and is rough. if i use the hand brake with it still in drive and remove my foot from the brake pedal idle speed increases and it runs smooth at ~750rpm, apply pressure to the brake pedal again and in a few seconds it’s idling rough again. Runs strong in all other speed and load conditions. I thought it was a vac leak in the brake booster so I isolated(plugged) the vac line to the brake booster, and every other vac line but it makes no difference. I removed and cleaned the throttle body, no difference. The only thing that makes the idle smooth out when the brake pedal is depressed is if i remove the fuse for the horn/brake lights(found this out from another blog, but they never said if they were able to determine the reason/solution. Why would removing this fuse affect the idle? is there some type vac solinoid that’s activated when the brake pedal is applied?

I suspect you need to have the charging system checked. Try this next. Under the same conditions, turn on the headlights. If the engine stumbles, it is because the voltage is dropping when a current load is applied to the system. This may be due to a weak alternator or battery. Pulling the fuse turns off the brake lights, removing that current load.

Busted Knuckles, i don’t think it’s the charging system. I am getting ~14 volts from the altenator with or without all the accessories on(fan, ac, high beam lights, etc). Turning on all the accessories and even honking the horn have no effect on the engine idle; even when the brake pedal is pressed and the engine is already idling low, i.e. idle it does not drop lower when i turn on all the accessories. The only thing that i can find so far that makes the idle drop to ~500 causing it to run rough is when i have it in any gear (automatic/shift-tronic tranny) and i press the brake pedal. I found one schmatic that looks like the brake/horn fuse is also the + side of the powertrain module. I think that’s for the shift lock safety that prevents you from shifting out of park if the barke/horn fuse is blown, or in my case when i remove it. It idles like a car with a intake vac leak, but only when i press the brake. As i mentioned, i eliminated a leaking brake booster already by removing the brake booster vac line and pluggining it. Any other ideas???