The Test Setup:
First, I placed a piece of white writing paper on top of a grounded block of metal and placed a small pile of Swiss 4F powder on the paper; I find that this powder ignites near instantaneously in my flinter. I then placed a wire from a ceramic torch igniter 1/4" over the top of the powder. The igniter generates a pulse of electricity of about 10,000 volts, which is about the most static charge that can be built up on a person. I used a combination of flash and time exposure to capture the image, where I sparked the igniter about 10 times during the course of the exposure.
As you can see, the powder did not ignite. I repeated this several times, and the results were the same. I also tried various BP substitutes, and they did not ignite either
second experiment, I used an Oudin coil, which is used for testing glass neon fixtures for leaks. It produces
pulses in excess of 40,000 volts and will give you quite a burn (and shock) if you let it hit you
This was impressive! The pile of powder was hit dozens of times, and again, it never ignited. You can see little flashes where the sparks strike; these are caused by vaporization of material from the surface. Although I couldn't get a picture of it, the paper had hundreds of tiny holes punched in it where the sparks burned through.
This picture shows a similar test set-up, except this time the black powder was ground into dust-like consistency. Again, no ignition, even though the sparks striking the middle of the pile blew powder clear from the areas where they struck.
Unique smokeless powder was also tried, this time with even more sparks - again, no ignition
For those skeptics who might not believe that the sparks actually got near the powder granules, in this experiment, the photo shows sparks passing around and over the individual granules as the spark travels between two electrodes.
So - Why wouldn't all of the sparks set off the powder?
The answer comes from the fact that black powder, and other carbon-containing propellants, are fair conductors of electricity. When a material conducts well, it takes a lot more current to heat it up. This is why the lamp wire stays cool and the filament in your light bulb gets white hot. The same current passes through both, but because the light filament has a much higher resistance to the passage of electric current, most of the heat ends up there rather than in the wire. In the experiment here, the air has a very high resistance, while the powder conducts fairly well. The passage of the spark heats the air white-hot, but the powder stays cool. A very high-current spark (like lightning!) would, of course, heat everything and cause ignition, but this would take much more current than could be provided from a static-like source.
Clicking on this image will take you to a web page showing new photos and experiments trying to electrically ignite gunpowder. It shows how hard it is to do it and a method that could work in a firearm.