how much energy is necessary to do the electrolysis?
you havent shown this , yet you jump to the conclusion that it will take just as much energy as the explosion delivers.
"Extraordinary claims require extraordinary evidence"
YOU are the one claiming to have found new laws of physics.
While this is not impossible (others have done this before) it is an extraordinary claim, so YOU are the one to provide the evidence.
unless you can show that the explosion delivers less energy than the energy required to make the HHO
The electrolysis of one mol of water produces a mol of hydrogen gas and a half-mol of oxygen gas.
The process must provide the energy for the dissociation plus the energy to expand the produced gases.
To achieve this under athmospheric pressure you will need 285.83 kJ of energy.
This overall amount of energy 285.83 kJ / 1.5 mol of HHO is STORED in the HHO. You can get exactly this amount back by recombination of the molecules.
Not magically more.
In a combustion engine, which is far away from 100% efficiency you won't even get the 285.83 kJ back as electrical energy, but a lot of losses by thermal radiation.
Reality is far more complex and above my current understanding, but maybe this page gives you some useful insights:http://hyperphysics.phy-astr.gsu.edu/hbase/thermo/electrol.html#c2