Nitro wrote: ↑Sat Jan 12, 2019 8:21 pm
The experiment is to prove if distributor ignition makes the spark weaker. A lot of people say it does and a lot say it doesnt. So I want to prove it by myself.
That's cool.
Before trying to code this, there needs to be better hypothesis in order to get good results, and know how to structure the code. In other words, you need to know how to operate and measure for the correct answers (proof) to your hypothetical questions. Are you trying to prove that avoiding the cap and rotor gap is better? Or that shorter plug wires are better? Or that spark energy is better if the dwell does not have to be reduced at high-rpm? Or that most sequential systems are more accurate (thus better average engine power) due to crank angle triggering? And so on.
While following
scientific method is the standard for moving toward good answers, a common fault is assuming one result is due to a certain cause, and missing the influence of other factors. In order to make a good test, you must at least know how you are going to measure results, and if that method will give you the information you need for proof. For example, if measuring if the spark energy on a path through a distributor makes it weaker than direct from the coil; this would require a means to measure the spark energy voltage, amperage and duration, or degree of spark ionization versus duration, etc. To attempt measuring by a variation of fractional engine power at a specific AFR and temperatures, while under specific RPM and load on any engine (most of which vary far more than that on any given day), will likely end in frustration for lack of proof. There are too many additional variables and factors that can influence the results.
This would point to greatly simplifying the experiment to a table with an ignition circuit (battery, Arduino, coil driver, coil, plug wire, spark plug), that also includes adding a coil HV wire, distributor cap and rotor for the direct comparison. The Arduino can simply fire the coil on-demand with a fixed and consistent dwell on the exact same coil and components for each test. The Arduino Blink sketch slightly modified for dwell duration could work for that, and you could have results today with no additional effort or bad info due to other environmental errors and factors.
Nitro wrote: ↑Sat Jan 12, 2019 8:21 pmThe hall sensor is a small circuit exclusively sending signal to the arduino. I placed magnets in a pulley in the crank shaft. It will guide the arduino when to change which coil it will drive when receive the negative signal from the ECU. The distributor will remains but only for the ECU hall sensor.
Without a cycle signal, the Arduino can not know whether to fire the coil sequentially for TDC #1 or TDC #4. You want sequential spark when the crank trigger only provides 360° information, while a 4-stroke cycle is across two crank rotations (720°). Cycle sensors are commonly called cam sensors due to their typical placement. Without the cycle signal, you would have to fire waste-spark, which will usually give the same results firing every TDC — depending on your specific hypothesis.
Give us the new hypothesis and means of measurement, and perhaps we can help you to outline a simpler experiment that will provide the proof you are after. I hope that helps!
David