# Model engine CDI easy and cheap



## bluejets

*Model engine CDI easy and cheap.*

Many years ago, I started making transistor assist ignition for model engines running rather large coils from motorcycles operating on the Kettering system (points,condensor, battery and coil).

These changed through the years as the learning curve advanced.

I built transistor assisted Kettering, hall effect, and small basic cdi units, adding microcontrollers etc. etc. all labour intensive and requiring differing levels of learning.

I saw these small motorcycle coils years ago (GY6 style) and this removed any need for building homemade coils.

GY6 is 30mm dia x 50mm long weight approx 50g.

Cheap too, a bonus at around $7.00 and the only mod was to remove the large HT lead and replace with something more scale-like but still practical.

The cable used is around 4mm diameter, rubber insulation, Belden 8899-010 Black.

These ignition coils were *not designed* for Kettering style so started the road to CDI.

Making one's own CDI units does work but they have limitations, namely getting enough power into the capacitor in an ever-decreasing time, increasing rpm. plus of course the time involved in building, programming etc. etc.

One's I built here were successful for single cylinder engines turning around 8,000 max. which even had electronic advance map built in to the microcontroller.

I like to build engines primarily. With electronics, if nothing is available it can be built quickly using modules. The latter is a great thing these days being cheap and relatively reliable into the bargain.

I noticed the "DC CDI units" a couple of years back. These are the type that makes use of power from a 12v battery and the high voltage energy required to charge the internal capacitor is generated within the unit. Also cost $7.00 approximately. (and that, in Aus at least, is delivery included, unbelievable really).

Small totally encased box 70 x 40 x 25mm weight around 120g (4 oz.).

I knew they were triggered by a pickup coil generating basically a sine wave (ac signal) in which the first rising wave was used (eventually) to trigger the internal SCR.

As the commercial pickup unit was LARGE for model use, I began to experiment with the use of a very small relay and modified it to give the correct trigger.

This worked a treat and even though the size was now acceptable at around 15x15x15mm, it still required some refining. That was over 1 year ago and the other day, dragged everything out once again for another "go".

Hall effect is a great thing *BUT* as it stands it will not trigger as required. It turns out that by adding a simple single inverter transistor circuit with a small modification to allow a "one pulse signal" was the key to the problem.

If one wants to use the old points approach, I have another add-on for that as well in the form of another single transistor and a slightly larger pc board. In this version, the points with a grounded frame as original, on opening will give the one pulse required to the CDI unit trigger input.

The last couple of weeks have been spent making the modification as simple as possible with as simple as possible parts. Strip type Veroboard seemed the logical approach and most should either have no problem working with it or at least know someone who can help.

I have also been using a hall effect module available on eBay at 5 for $3.00 approx. which saves a lot of mucking around. George has made a 3D plastic casing/mounting for the hall effect module so I imagine the files will be available if required.

Testing the unit at this stage has been done using a test bed I made up many moons ago, but final proof will be testing on an engine. George almost has a3-cylinder I.C. ready for such a test so fingers crossed. I cannot foresee any real problems given they were designed initially for the small motorcycle market.

Total cost for the complete system is around the AU$20.00 mark which is pretty good for any ignition system, let alone a CDI. I have an idea there may also be an amount of electronic advance built in to these units but only further tests will prove if this is the case.

The pre-built parts are easily obtained and cheap with the small modification pc board easy for most to build.

So, if interested, I'll post more detail in the form of a pdf file on the build. Any testing we do I can add later.


----------



## ozzie46

Absolutely I'm interested.
Ron


----------



## bluejets

Hi Ron,
             Currently doing the write up with diagrams etc. and should be finished by the weekend.
In the meantime I'll pop some links in here to the parts currently available at what I found to be near to the lowest cost.

GY6 ignition coil
https://www.ebay.com.au/itm/Racing-...t-Moped-Scooter-50CC-125CC-150CC/183109938606

4 pin DC CDI Unit ....important to note there are a few different types such as 5 pin AC but if one quotes the 4 pin DC CDI , all ok.
https://www.ebay.com.au/itm/4-Pins-...555335?hash=item1a78a9fa87:g:y~QAAOSwxLVa86yR

KY-003 Hall effect module ( 5 )
https://www.ebay.com.au/itm/5PCS-KY...092323?hash=item3d7b90cd23:g:s6cAAOSwutFZfua-

6 pin connector ....yes, I know I said 4 pin CDI but there ya go, 2 pins are not used and all reference is to 4 pins.
Don't have to use this as wires could be simply soldered to the CDI connector if you want to do it that way.
https://www.ebay.com.au/itm/2-9-Pin...ike-ATV-Scooter/182919740250?var=690232623303

And finally the strip veroboard to make up the small inverter board that goes between the hall module and the trigger input of the CDI unit.
https://www.ebay.com.au/itm/5x-6-5x...m33dcd046bd:g:B4UAAOSwi0xaKPaO&frcectupt=true


----------



## mnay

It looks like those are also available in the US on ebay.    I would also be interested to knowing how to connect them.  Seems like a very inexpensive way to build a small ignition.  Would appreciate the information also.
thanks for your help.
Mike


----------



## olympic

Sounds very interesting. I'd love to know how make one of these.


----------



## bluejets

The hall effect module as purchased will not operate the CDI Unit as is.
A small single transistor inverter/pulse board is added to make it work. (details added )
This is simple enough for most to do and building on a piece of strip veroboard I thought the easiest way to go in respect of pc boards.
I'll also include the overall circuit diagram below.


----------



## Johno1958

Thank you .This is very interesting.
John


----------



## bluejets

Did the write up for the points version of the ignition , never know, could be of interest to someone. see below.

Currently doing the details on how to use the hall effect with a couple of different variations and then there will be the original inductive pickup which started all of this.
Thanks for the interest.

Cheers Jorgo

PS....forgot to mention originally, with the hall effect system, the ignition fires when the magnet approaches the hall effect.


----------



## tornitore45

The CDI for mopeds needs a bipolar trigger.  The CDI give a spark when the trigger voltage goes positive but needs to see a negative voltage to arm before the next positive pulse for the next spark.
The typical Hall effect output is an open collector swinging from GND to VCC+ and repeating.  Never goes negative.
A simple C-R network to differentiate the signal will remove the DC component and output bipolar pulses.   That is what I have done and work fine.
Make the time constant 1/2 of the shortest spark period.  Account for the input resistance but is usually  high enough, 10 to 20 Kohm


----------



## bluejets

tornitore45 said:


> The CDI for mopeds needs a bipolar trigger.  The CDI give a spark when the trigger voltage goes positive but needs to see a negative voltage to arm before the next positive pulse for the next spark.
> The typical Hall effect output is an open collector swinging from GND to VCC+ and repeating.  Never goes negative.
> A simple C-R network to differentiate the signal will remove the DC component and output bipolar pulses.   That is what I have done and work fine.
> Make the time constant 1/2 of the shortest spark period.  Account for the input resistance but is usually  high enough, 10 to 20 Kohm



Thanks for the input, however, as I said first up, there are many different variations on CDI unit types available.
The particular one I use is 4 pin DC unit and is working fine as is with the circuits supplied.


----------



## ozzie46

Thanks for the write up.

Ron


----------



## bluejets

This next section deals with how all this started by making up an inductive pickup coil using a 240v relay coil.
For me it is now just for interest sake however it may be helpful to some in other areas.
See pdf below.


----------



## bluejets

Some info on different type of CDI units in common use that I found on the internet back in the beginning.


----------



## michelko

Hi, this is  an realy ​interessting write up. Thank you.

Michael


----------



## mnay

thanks for sharing this information.  Great alternative to the expensive units.
Mike


----------



## Foketry

bluejets said:


> Thanks for the input, however, as I said first up, there are many different variations on CDI unit types available.
> The particular one I use is 4 pin DC unit and is working fine as is with the circuits supplied.



Very very interesting your application of an industrial CDI for scooters
I liked this idea and bought a 6-wire CDI GY6 with advance adjustment because for a multi-cylinder engine, for example 4 or 8 cylinders there are 4-8 pulses per revolution instead of just 1 pulse and the advance becomes incorrect already at a few engine revs
https://www.amazon.it/dp/B07PHV6VQC/ref=cm_sw_r_oth_tai_bSPnDb7P0KX8M
I connected this unit with its trigger pickup and it works very well , with the adjustment trimmer I can bring the advance to zero
http://s.aliexpress.com/EZrIvmiE

I built your circuit to drive the CDI with Hall sensor, but it doesn't work with this CDI, maybe I was wrong or, as Tornitore writes, another type of circuit is needed ?

Can you give me some suggestions ?
thank you


----------



## editor123

Not to blow my own horn but we published an excellent ignition system in Issue # 34 of Model Engine Builder. David Sage and John Gedde are the designers. It will handle a V-8 up to around 10,000 RPM. Within the Bay Area Engine Modeler's Club, there are probably 30 of those systems operating with no failures (except for the one builder who bound the Hall Effect Sensor and secondary ignition wires together). The circuit turns off after a short time of non operation so the battery doesn't discharge and the coil won't burn out. Most of us use the Ford Coil Over Plug coils because of their reliability and low price (about $5 each in lots of 8). This is not a CD ignition system, it has no spark advance, it is just a very well thought-out circuit. The entire circuit is shown mounted on a battery box for an engine box. The white connectors are temporary as I work out the details of a completely 3D printed distributor for 2-8 cylinder engines.


----------



## Foketry

I carefully read the post published by Egge in this forum and  I built the circuit following the project attached to the post.
In Italy it is not possible to buy the FORD coil, I had to use a coil for scooters but the absorption from the battery is very high, about 3 A. The battery must be large and I cannot hide it under the engine base.
Instead the CDI mentioned in this tread absorbs max 0.5 A and with a small Lipo battery it is possible do dozens of engine starts.
Now my problem is that I failed to make the circuit for Hall sensor

thanks for the info Editor


----------



## bluejets

Foketry said:


> Very very interesting your application of an industrial CDI for scooters
> I liked this idea and bought a 6-wire CDI GY6 with advance adjustment because for a multi-cylinder engine, for example 4 or 8 cylinders there are 4-8 pulses per revolution instead of just 1 pulse and the advance becomes incorrect already at a few engine revs
> https://www.amazon.it/dp/B07PHV6VQC/ref=cm_sw_r_oth_tai_bSPnDb7P0KX8M
> I connected this unit with its trigger pickup and it works very well , with the adjustment trimmer I can bring the advance to zero
> http://s.aliexpress.com/EZrIvmiE
> 
> I built your circuit to drive the CDI with Hall sensor, but it doesn't work with this CDI, maybe I was wrong or, as Tornitore writes, another type of circuit is needed ?
> 
> Can you give me some suggestions ?
> thank you



Hi Foketry,
                      Didn't get in to the 6 pin versions but I did supply full details of many of the different system that were available including my 4 pin version.
So I have really no idea of what you might have done to try to get a 6 pin version operational.
I'll include the file on the different types here once again as trying to find these things sometimes can take a lot of trowling though posts.


----------



## editor123

I should also mention that the ignition circuit will also trigger from points or a reed switch. Both are nearly indestructible. The reed switch will function very nicely for single cylinder farm-style engines. Triggers with a magnet just like a Hall Effect Device.


----------



## Gordon

editor123 said:


> Not to blow my own horn but we published an excellent ignition system in Issue # 34 of Model Engine Builder. David Sage and John Gedde are the designers. It will handle a V-8 up to around 10,000 RPM. Within the Bay Area Engine Modeler's Club, there are probably 30 of those systems operating with no failures (except for the one builder who bound the Hall Effect Sensor and secondary ignition wires together). The circuit turns off after a short time of non operation so the battery doesn't discharge and the coil won't burn out. Most of us use the Ford Coil Over Plug coils because of their reliability and low price (about $5 each in lots of 8). This is not a CD ignition system, it has no spark advance, it is just a very well thought-out circuit. The entire circuit is shown mounted on a battery box for an engine box. The white connectors are temporary as I work out the details of a completely 3D printed distributor for 2-8 cylinder engines.View attachment 110381


I just looked at the Model Engine Builder article and it looks interesting and even possible for us non electronic klutz's. Have you made your own PCB or have you had them made? If you have had someone make a quantity of these boards would you have any available for purchase or would others be interested in purchasing a lot together? I have tried using the pre-drilled universal boards to make TIM6 circuits and they end up looking like a spaghetti factory explosion but they do work.


----------



## editor123

Gordon said:


> I just looked at the Model Engine Builder article and it looks interesting and even possible for us non electronic klutz's. Have you made your own PCB or have you had them made? If you have had someone make a quantity of these boards would you have any available for purchase or would others be interested in purchasing a lot together? I have tried using the pre-drilled universal boards to make TIM6 circuits and they end up looking like a spaghetti factory explosion but they do work.


I have e-mailed Dave Sage, the board designer to see if he will either order more boards or release the board design files. The boards were constructed in China and are quite nice. I just built the last 3 of the 11 boards I was given by Dave or I could offer a few. Give it a few days to see what, if anything, he will do.
I had considered CNCing some boards and still might do that if all else fails.


----------



## Foketry

bluejets said:


> Hi Foketry,
> Didn't get in to the 6 pin versions but I did supply full details of many of the different system that were available including my 4 pin version.
> So I have really no idea of what you might have done to try to get a 6 pin version operational.
> I'll include the file on the different types here once again as trying to find these things sometimes can take a lot of trowling though posts.



Hi Bluejets
I think the trigger pick up is the same for CDI 4 wires and CDI 6 wires, I probably made some mistakes during the assembly of the Hall sensor circuit which you kindly posted.
Is it possible to check the function of the Hall sensor circuit  with the multimeter or or an ascilloscope is required ?
Example :when the Hall sensor is excited by the magnet, what kind of signal should I read in the To CDI Trigger input point ?
Thank you


----------



## Gordon

editor123 said:


> I have e-mailed Dave Sage, the board designer to see if he will either order more boards or release the board design files. The boards were constructed in China and are quite nice. I just built the last 3 of the 11 boards I was given by Dave or I could offer a few. Give it a few days to see what, if anything, he will do.
> I had considered CNCing some boards and still might do that if all else fails.


Thanks. That would be great. I tried making my own TIM6 boards and I was sort of successful but I had to do some modifications like jumpers and scaring off connections which should not be connected. I am not sure what would happen with a double sided board.


----------



## doc1955

Here is a video of the boards I made up they were simple to machine up I may just print out the stencils try and fine and alternative way to etch them.


----------



## editor123

Gordon said:


> Thanks. That would be great. I tried making my own TIM6 boards and I was sort of successful but I had to do some modifications like jumpers and scaring off connections which should not be connected. I am not sure what would happen with a double sided board.


I have the board files but I have never had a set of boards made so that may take a while as I learn what and how to do it. If you need a single ignition system, I do have  a spare built system. I  would sell it if you are interested. Let me know at editor at modelenginebuilder.com.


----------



## kadora

Hello Foketry.
The output of Hall sensor is in a magnet proximity  High or Low /depends on sensor type /
so you can check output by common multimeter or LED diode.
Be careful because hall sensors usually have open collector  so always connect miniature resistor
2 - 5 kohm to battery Plus  pole and to sensor Output. 
To check hall sensor just connect multimeter  to battery Minus pole and to the sensor Output
you should read on multimeter fast jump from  0V to 5V  or vice versa near magnet.


----------



## Foketry

Hi Kadora
thanks for the reply, I already have a simple Hall sensor tester with resistance and LEDs, but my problem is different
The CDI scooter receives the impulse from a special pick up trigger, the circuit I made with Hall sensor should replace this pick up, but it doesn't work.
My question is, what kind of signal should the circuit emit to replace the pick up?
How can I check this signal with a multimeter?
In attachment the circuit kindly posted by Bluejets and the pick up trigger


----------



## kadora

Scooter pick up circuit is PROBABLY simple coil which generates minus or negative sinus waves
and this waves trigger CDI. On the other hand Hall sensor can generate only positive impulses.
Signal generated by pick up item can be checked by osciloscope. /Best way/
I can not open your attached file right now because I have brand new computer not having
Adobe reader installed yet.
You need to trigger Scooter cdi with hall sensor am I right?


----------



## Foketry

kadora said:


> Scooter pick up circuit is PROBABLY simple coil which generates minus or negative sinus waves
> and this waves trigger CDI. On the other hand Hall sensor can generate only positive impulses.
> Signal generated by pick up item can be checked by osciloscope. /Best way/
> I can not open your attached file right now because I have brand new computer not having
> Adobe reader installed yet.
> You need to trigger Scooter cdi with hall sensor am I right?



Yes, I would like to trigger a CDI Scooter with Hall sensor
The attached file is to do this


----------



## kadora

Now I am able to open pdf files.
Maybe you have low trigger voltage on the input of cdi.
Try to change resistors in this way ---Solder 1k5 resistor instead 220R and 220R instead 1k5
This should rise trigger impulse voltage .


----------



## 74Sprint

Foketry, The Hall-Effect is not the problem here, at least not yet. You need to answer some questions here first before sorting this out.
Start by reading my post about Hall-Effect ignitions https://www.homemodelenginemachinis...ll-engine-ignition-science.31347/#post-325051 then:

1. Is the rotor on the crank swinging a magnet or a steel ring gear with notches or tabs?
2. Does the original pick use a magnet with the Hall-Effect?
2. What is the make of the ignition box?

The first question is the most important to be answered otherwise your just going down a dead end alley.

Ray


----------



## Foketry

74Sprint said:


> Foketry, The Hall-Effect is not the problem here, at least not yet. You need to answer some questions here first before sorting this out.
> Start by reading my post about Hall-Effect ignitions https://www.homemodelenginemachinis...ll-engine-ignition-science.31347/#post-325051 then:
> 
> 1. Is the rotor on the crank swinging a magnet or a steel ring gear with notches or tabs?
> 2. Does the original pick use a magnet with the Hall-Effect?
> 2. What is the make of the ignition box?
> 
> The first question is the most important to be answered otherwise your just going down a dead end alley.
> 
> Ray



The pickup reads a steel tab that rotates at a predefined distance , you can see the drawing  posted by Bluejets , Cam disc
The original pickup is composed of a coil and a magnet
I do not know the brand of the CDI ignition, generally they are produced in China, mine is DC  , 6 wire, 
 attached file ,  page 11
my problem is this, i would like to replace the original pickup with a Hall sensor to use the CDI on the engine models
thanks for your interest


----------



## Foketry

kadora said:


> Now I am able to open pdf files.
> Maybe you have low trigger voltage on the input of cdi.
> Try to change resistors in this way ---Solder 1k5 resistor instead 220R and 220R instead 1k5
> This should rise trigger impulse voltage .



I replaced the 2 resistors as suggested, but it does not work, the led of the hall sensor lights up, but the Cdi does not receive the signal, only with the original pickup everything works


----------



## 74Sprint

Foketry said:


> The pickup reads a steel tab that rotates at a predefined distance , you can see the drawing  posted by Bluejets , Cam disc
> The original pickup is composed of a coil and a magnet
> I do not know the brand of the CDI ignition, generally they are produced in China, mine is DC  , 6 wire,
> attached file ,  page 11
> my problem is this, i would like to replace the original pickup with a Hall sensor to use the CDI on the engine models
> thanks for your interest



I thought this was the setup, I'm current designing a Krober magneto replacement ignition that works similarly.

Anyway, do you have the part number for the Hall-Effect you are using?

This is important because we need to know the polarity of the Hall-Effect. You will need to place (glue) a small weak magnet behind the Hall-Effect for the Hall-Effect to sense the metal tabs going by. We need to know if we have to glue the North or South pole to the Hall-Effect. Alternately you can buy a Hall-Effect proximity sensor however glueing a small magnet to the Hall-Effect is smaller, cheaper and easier to mount. 

Ray


----------



## kadora

Foketry you have probably cdi unit which needs for triggering energy stored in capacitor 
so too complicated to trigger this cdi box with hall sensor.
Voltage on trigger capacitor is 70V
Do not waste time and buy hall sensor cdi box used for rc model engines.


----------



## Foketry

74Sprint said:


> I thought this was the setup, I'm current designing a Krober magneto replacement ignition that works similarly.
> 
> Anyway, do you have the part number for the Hall-Effect you are using?
> 
> This is important because we need to know the polarity of the Hall-Effect. You will need to place (glue) a small weak magnet behind the Hall-Effect for the Hall-Effect to sense the metal tabs going by. We need to know if we have to glue the North or South pole to the Hall-Effect. Alternately you can buy a Hall-Effect proximity sensor however glueing a small magnet to the Hall-Effect is smaller, cheaper and easier to mount.
> 
> Ray



I use Hall sensor 3144 installed on this circuit , look at the attachment
KY-003 has sensor 3144


----------



## 74Sprint

Foketry: To begin with Hall-Effects aren't as simple as most people think. They come in different volt & amp ratings, polarities and non-polarity, latch & non-latching, transistor or FET, open collector/drain or open emitter/source, and sensitivity. So as you can see there is a lot of different varieties. You say your KY-003 uses a 3141 Hall-Effect, which is now obsolete and is no longer made and I was not able to get in-depth details on it. However Allegro says it's replacement is the A1104, there is a big difference between the 2 with the biggest being the 3141 is a transistor and the 1104 being a FET. The 3141 has what is known as a open 'collector' and the 1104 having a open 'drain'. In both cases the emitter/source is internally grounded to the GND pin. So when the Hall-Effect turns on it grounds out the signal pin. Now from the info on the KY-003 you posted the circuit shown will not work and if it ever did then it was by fluke. The reason is because the capacitor that goes from the signal to the base of the transistor are both basically at ground level voltage and the cap may only charge up through junction leakage. I simulated the circuit in the PDF and got almost no signal out to the CDI, less than 0.01 volt. I redesigned the circuit so that it outputs positive pulses 11.5 volts (see attachments). 

You will need to place a small weak magnet behind the Hall-Effect, the front face is the one with the brand information. You will need to place the south pole against the Hall-Effect. You will need either a compass or a pole detector or do what I do sometimes and use some clear thin tape to hold the magnet against the Hall-Effect. Power up the circuit and then pass a piece of iron pass the front face of the Hall-Effect and see if you get a signal. You may have to adjust the distance between the iron and Hall-Effect to get a signal. If you still don't get one then turn the magnet over and try again. Once you get a signal mark the magnet so you know which way to epoxy the magnet onto the Hall-Effect. Note: use an LED with a 20-40 ma rating.

Ray


----------



## Foketry

74Sprint said:


> Foketry: To begin with Hall-Effects aren't as simple as most people think. They come in different volt & amp ratings, polarities and non-polarity, latch & non-latching, transistor or FET, open collector/drain or open emitter/source, and sensitivity. So as you can see there is a lot of different varieties. You say your KY-003 uses a 3141 Hall-Effect, which is now obsolete and is no longer made and I was not able to get in-depth details on it. However Allegro says it's replacement is the A1104, there is a big difference between the 2 with the biggest being the 3141 is a transistor and the 1104 being a FET. The 3141 has what is known as a open 'collector' and the 1104 having a open 'drain'. In both cases the emitter/source is internally grounded to the GND pin. So when the Hall-Effect turns on it grounds out the signal pin. Now from the info on the KY-003 you posted the circuit shown will not work and if it ever did then it was by fluke. The reason is because the capacitor that goes from the signal to the base of the transistor are both basically at ground level voltage and the cap may only charge up through junction leakage. I simulated the circuit in the PDF and got almost no signal out to the CDI, less than 0.01 volt. I redesigned the circuit so that it outputs positive pulses 11.5 volts (see attachments).
> 
> You will need to place a small weak magnet behind the Hall-Effect, the front face is the one with the brand information. You will need to place the south pole against the Hall-Effect. You will need either a compass or a pole detector or do what I do sometimes and use some clear thin tape to hold the magnet against the Hall-Effect. Power up the circuit and then pass a piece of iron pass the front face of the Hall-Effect and see if you get a signal. You may have to adjust the distance between the iron and Hall-Effect to get a signal. If you still don't get one then turn the magnet over and try again. Once you get a signal mark the magnet so you know which way to epoxy the magnet onto the Hall-Effect. Note: use an LED with a 20-40 ma rating.
> 
> Ray



74Sprint , thanks for your help, in the next day I will try to make this circuit
Very interesting the application of a magnet glued to the Hall sensor, I will also try this


----------



## bluejets

Video for those who seem to think it does not work for one reason or another.
Pickup is attached to a motor driving a metal disc with 3 vanes.  Magnet (3mm dia) is on opposite side of the vanes.
I have tried with a magnet attached to the rear side of the hall effect and it also works fine in detecting the vanes. Same thing, different tune as they say.
Tacho reading shown is per pulse and tacho tops out at 9,900rpm or pulses in this instance.
After that it starts to show alpha characters.
Initial pulses as can be seen in the video are at around 9,500 mark and later in the video the test bench motor is run up to maximum at over 20,000 pulses.
Previous remote tacho readings have confirmed this.
As can be seen, the Ebay unit works just fine.

https://photos.app.goo.gl/5r4hDb6SNXBTpCeBA


----------



## 74Sprint

Bluejets your right, one can place a magnet on the opposite side of a cut out metal wheel but, this is called a windowed design. This was quite popular years ago in the automotive world. I have seen this setup in GM's to Mitsubishi's and is of course a alternative to detecting the metal wheel. For others the windowed wheel interrupts the magnetic field the Hall-Effect sees.

Ray


----------



## Foketry

bluejets said:


> Video for those who seem to think it does not work for one reason or another.
> Pickup is attached to a motor driving a metal disc with 3 vanes.  Magnet (3mm dia) is on opposite side of the vanes.
> I have tried with a magnet attached to the rear side of the hall effect and it also works fine in detecting the vanes. Same thing, different tune as they say.
> Tacho reading shown is per pulse and tacho tops out at 9,900rpm or pulses in this instance.
> After that it starts to show alpha characters.
> Initial pulses as can be seen in the video are at around 9,500 mark and later in the video the test bench motor is run up to maximum at over 20,000 pulses.
> Previous remote tacho readings have confirmed this.
> As can be seen, the Ebay unit works just fine.
> 
> https://photos.app.goo.gl/5r4hDb6SNXBTpCeBA




Hi Bluejets, I installed CDI ignition for my Howell engine, everything works fine, I used the original trigger hidden under the flywheel, you can see the post 65 in  work in progress section, Howel V4 from Italy


----------



## SukiEgan

Hi...Voltage to the loop from the CDI is ordinarily 100 volts PEAK - you can't gauge the voltage to the curl with a standard multimeter except if you have a pinnacle voltage connector - utilize a FLUKE multimeter using the min/max capacity to quantify the pinnacle voltage from the beat loop and from the CDI unit to the curl. 

Since the start is AC energized (no battery required) - a frail sparkle discloses to you the beat generator curl is advising the CDI unit to fire the loop - as a rule, having a feeble, yet predictable flash standards out the beat curl, so the guilty party is either a terrible ground, the CDI unit or the stator. A no sparkle issue is simpler to pinpoint.


----------



## Stefan-K

bluejets said:


> Video for those who seem to think it does not work for one reason or another.
> Pickup is attached to a motor driving a metal disc with 3 vanes.  Magnet (3mm dia) is on opposite side of the vanes.
> I have tried with a magnet attached to the rear side of the hall effect and it also works fine in detecting the vanes. Same thing, different tune as they say.
> Tacho reading shown is per pulse and tacho tops out at 9,900rpm or pulses in this instance.
> After that it starts to show alpha characters.
> Initial pulses as can be seen in the video are at around 9,500 mark and later in the video the test bench motor is run up to maximum at over 20,000 pulses.
> Previous remote tacho readings have confirmed this.
> As can be seen, the Ebay unit works just fine.
> 
> https://photos.app.goo.gl/5r4hDb6SNXBTpCeBA



Hi Bluejets

Sad to say your Video Link doesn`t work. It points to Nirwana......

Stefan


----------



## bluejets

Stefan-K said:


> Hi Bluejets
> 
> Sad to say your Video Link doesn`t work. It points to Nirwana......
> 
> Stefan



Things like that tend to happen over a long period of time.
If you look that was originally posted over 16 months ago......
I have no control over what disappears from posts that far back.
I'll try to hunt down the video in my records.
Cheers Jorgo.


----------



## Stefan-K

bluejets said:


> Things like that tend to happen over a long period of time.
> If you look that was originally posted over 16 months ago......
> I have no control over what disappears from posts that far back.
> I'll try to hunt down the video in my records.
> Cheers Jorgo.


Hi Jorgo
No Problem. I'd appreciate if you would find it in your own Videos. Maybe its a good idea to post it on YouTube. Once uploaded it stays there forever. I'd like to see the Video because i just ordered two of These CDI modules. I expect them to arrive from China in mid Januar. I have always made my own CDI modules from scratch and i tried to make them as small as possible. Smallest one i ever made Was 62x55x35mm. But you know that physics of high voltage Limit the size. However, China modules are a nice idea and i want to try them out. 
Cheers for now 
Stefan


----------



## bluejets

Tend to do the youtube way that these days as it's just too difficult keeping track of where everything is, especially when there was a "new pc" in there somewhere as well.

Had a look through most on this current system yesterday but found no reference to the video.
Have a couple of other places to look though.

Edit:- Looks like it might have been on the phone that was dunked a few weeks ago. ☹☹
Will make another when I get the opportunity...cheers Jorgo


----------



## bluejets

Stefan-K said:


> Hi Jorgo
> No Problem. I'd appreciate if you would find it in your own Videos. Maybe its a good idea to post it on YouTube. Once uploaded it stays there forever. I'd like to see the Video because i just ordered two of These CDI modules. I expect them to arrive from China in mid Januar. I have always made my own CDI modules from scratch and i tried to make them as small as possible. Smallest one i ever made Was 62x55x35mm. But you know that physics of high voltage Limit the size. However, China modules are a nice idea and i want to try them out.
> Cheers for now
> Stefan



Had a bit of spare time this afternoon so recharged the teset bed battery and gave the hall effect unit a run.
Popped it into youtube this time so there ya go as they say.
Cheers Jorgo



Didn't realise at the time I had the wall fan running and it gave the video a "windy day" effect.
Sorry about that, I'll remember that next time.
Flamin' hot here at the moment.


----------



## mnay

Good idea for a test set up
Thanks for showing
Mike


----------



## jamesmattioli

[QUOTE = "bluejets, post: 351300, membro: 18673"]
Ho avuto un po 'di tempo libero questo pomeriggio, quindi ho ricaricato la batteria del letto teset e ho dato una corsa all'unità effetto hall.
Questa volta l'ho inserito su YouTube quindi eccoti come si suol dire.
Saluti Jorgo

[MEDIA = youtube] a0dSqJ63yPE [/ MEDIA]

All'epoca non mi ero reso conto che avevo il ventilatore a muro acceso e ha dato al video un effetto "giornata ventosa".
Mi dispiace, me lo ricorderò la prossima volta.
Flamin 'caldo qui al momento.
[/CITAZIONE]
Ciao,  mi sai dire dove hai comprato la cdi ? Hai un link internet?


----------



## bluejets

jamesmattioli said:


> [QUOTE = "bluejets, post: 351300, membro: 18673"]
> Ho avuto un po 'di tempo libero questo pomeriggio, quindi ho ricaricato la batteria del letto teset e ho dato una corsa all'unità effetto hall.
> Questa volta l'ho inserito su YouTube quindi eccoti come si suol dire.
> Saluti Jorgo
> 
> [MEDIA = youtube] a0dSqJ63yPE [/ MEDIA]
> 
> All'epoca non mi ero reso conto che avevo il ventilatore a muro acceso e ha dato al video un effetto "giornata ventosa".
> Mi dispiace, me lo ricorderò la prossima volta.
> Flamin 'caldo qui al momento.
> [/CITAZIONE]
> Ciao,  mi sai dire dove hai comprato la cdi ? Hai un link internet?



Con il virus in giro, probabilmente non esiste più. Facile fare una ricerca su Ebay per scooter CDI a 4 pin 12V


esempio qui ma il costo sarebbe più alto di quelli che ho comprato
Motocycle Scooter 4 Pin DC 12V CDI Box Igniter Ignition Black for CD110  | eBay

la bobina è una GY6 e l'effetto hall è il modulo KY-003 .... tutto su Ebay

se vuoi rendere lo stile della bobina pick-up, i dettagli sono più indietro nel post.


----------



## paulc

Hi Bluejets,  a fellow Aussie here!  I'm impressed with you working out how to use a Hall sensor on a 12 volt CDI. And I see from your youtube clip you 100% have it working like a charm.
I would like to use this ignition on a 7 cylinder model radial I built. (Hall sensor in the dist cap with small seven rotating magnets, it works.)
I have the same eBay 12 volt, 4 pin CDI. I made both your Hall sensor circuit and then the points circuit. But I cant get the system to work on either.
But the CDI works just fine when using just the pick up coil as a trigger from out of an old electronic distributor. see two you tube clips I made here.
   and 

Ive attached some pics here too, perhaps you can pick up a howler mistake! Any tips you have would be appreciated. If you're not too far for me I could even post you my handy work for quick test on your rig 

Is there any way to test the circuit? Output.
When I tap the points to ground the LED flickers.  Likewise when I hook up the Hall sensor to the points circuit (with 12v power to the Hall).  Pass a magnet and the LED flickers.

Also I notice with the Blue jets points module connected when I tap the main power It throws a BIG spark with every tap of the 12V+ battery terminal.  But with the same module disconnected, then tapping the power does nothing.  Its like the module is down?

Cheers Paul


----------



## paulc

If any one is interested,  I made a third attempt at this circuit literally placing the components on the Bluejets schematic.  Still no spark.  I'm pretty confident I have the circuit correct.  So leads me to suspect either the circuit has an error or not all 12V DC 4 pins CDI are the same.
Any help would be appreciated.  See below my third attempt.


----------



## Foketry

I am also very interested, this circuit would be very useful.
I built 2 but both don't work with a 4 pin CDI , no spark, with the original pick up everything works.
 Same opinion as paulc ,the circuit has an error or not all 12V DC 4 pins CDI are the same.


----------



## paulc

Foketry said:


> I am also very interested, this circuit would be very useful.
> I built 2 but both don't work with a 4 pin CDI , no spark, with the original pick up everything works.
> Same opinion as paulc ,the circuit has an error or not all 12V DC 4 pins CDI are the same.
> 
> View attachment 128095


Hmmm yes I recall your attempts.
As with yours, mine also works fine on the original pick up coil as the trigger. So all that has to occur is the square wave from the hall sensor be converted to to emulate the sine wave, my suspicion is the bluejets circuit is perhaps marginal on this square to sign wave conversion and so with minor differences in CDI modules causes it he CDI to not function. I wonder if more filtration to create a better sign wave would fix the issue? Im looking at this now.
Or
As no one other than bluejets has this working so this could indicate that there is an issue with the circuit he published.

A new video on my attempts here:


I will get this working.


----------



## Claudio Masetto

Hi, I've noticed that you are using the Arduino hall effect sensor module. That module outputs a +5V signal when a magnet is detected and so will not work with that circuit because it has a PNP transistor which requires a negative signal to the base for it to conduct.


----------



## bluejets

Claudio Masetto said:


> Hi, I've noticed that you are using the Arduino hall effect sensor module. That module outputs a +5V signal when a magnet is detected and so will not work with that circuit because it has a PNP transistor which requires a negative signal to the base for it to conduct.



The KY-003 Hall Magnetic Sensor consists of a 3144EUA-S sensitive Hall-effect switch for high-temperature operation, a 680Ω resistor and a LED. Compatible with popular electronics platforms like Arduino and Raspberry Pi.


Operating Voltage4.5V to 24VOperating Temperature Range-40°C to 85°C [-x°F to x°F]Dimensions 18.5mm x 15mm [0.728in x 0.591in]


----------



## paulc

Im using a Hall sensor we already use on other kettering ignition circuits, and I believe switches the same as the KY-003 only in does not have the LED on board.  Should still work.

Here is a close up of the two inverters I made. And also one of me building the circuit on the actual schematic provided in this thread. I cant get either to work. Perhaps Im repeating a silly mistake but I cant see it.

The Hall PCB is the smaller one, the points inverter board the longer one. The black and white wires are the points connections

Help please I really want this CDI work. I reckon its a winner. The radial engine I made a few years back is attached here. This is what I want to use this ignition on. Get her running again.  Did I say a few years back.... 1997  oh my what happened?
Cheers Paul


----------



## 74Sprint

The A3144EUA-S Hall-Effect has a open collector like almost all Hall-Effects which, means that when it turns on the sensor output goes to ground (-). So 1. I would put a 10k ohm resistor between the (+) and the sensor output, 2. I would get rid of the capacitor. If it still doesn't work then 3, I would get rid of the 1K5 resistor.

Ray


----------



## 74Sprint

The KY-003 Hall Magnetic Sensor will work with up to 24v and already has a pull-up resistor and LED.

Ray


----------



## paulc

G'day Ray,
Bluejets circuit is designed to allow a Hall sensor  to take the place of an induction coil for triggering the DC 12 volt CDI.  So the small Hall driven interface has to emulate a"sine wave"  as a opposed to the Hall sensors square wave, right?


----------



## paulc

74Sprint said:


> The KY-003 Hall Magnetic Sensor will work with up to 24v and already has a pull-up resistor and LED.
> 
> Ray


Oh  so the resistor on the KY-003 is a pull up?  Its role is important in the circuit and is not just for the LED?


----------



## Claudio Masetto

Ok after looking at the specs. of the KY-003 I realise that it does work by grounding the signal terminal when it senses a magnet. I was thinking of something else. 
You need to put a 1K pullup resistor from the +ve terminal to the output terminal  of the sensor.
You also need a 1K pullup resistor from the base of the transistor to +ve. Without this resistor the base will be floating because of the capacitor.
The 1.5K and 220 ohm resistors on the collector can be removed and replaced with one 1k resistor and the output taken from the junction of this resistor and the collector of the transistor.
I have quickly assembled this circuit on a test board and tried it by flashing a signal wire to ground. Using a 12volt supply I get a nice sharp  10volt pulse(observed on a scope) whenever I ground the wire.
Make sure your transistor is ok and that you have the terminals the right way round.


----------



## paulc

Claudio Masetto said:


> Hi, I've noticed that you are using the Arduino hall effect sensor module. That module outputs a +5V signal when a magnet is detected and so will not work with that circuit because it has a PNP transistor which requires a negative signal to the base for it to conduct.


No its not a KY-003, its just a raw hall sensor potted in a plastic case.  When the magnet is near the signal wire goes to earth.  When the magnet is away the signal wire goes open.  It has no resistor or LED like the KY-003.


----------



## Claudio Masetto

You need a pullup resistor from the +ve to the signal wire of the hall sensor and the other mods in my post.
I will try to post a diagram later tonight.


----------



## mayhugh1

Paul,
Your schematic shows a .1uF cap in series with the base of your transistor, but I believe the cap you're actually using is .01uF. That cap will reduce the width of the trigger pulse by 10X. - Terry


----------



## paulc

mayhugh1 said:


> Paul,
> Your schematic shows a .1uF cap in series with the base of your transistor, but I believe the cap you're actually using is .01uF. That cap will reduce the width of the trigger pulse by 10X. - Terry


Hi, I just checked the cap it is correct, 0.1uF  the paper work also reflects the same.  
I'll try the pull up resistor across the +ve and the signal wire of the hall sensor and see if that helps.


----------



## paulc

Claudio Masetto said:


> Ok after looking at the specs. of the KY-003 I realise that it does work by grounding the signal terminal when it senses a magnet. I was thinking of something else.
> You need to put a 1K pullup resistor from the +ve terminal to the output terminal  of the sensor.
> You also need a 1K pullup resistor from the base of the transistor to +ve. Without this resistor the base will be floating because of the capacitor.
> The 1.5K and 220 ohm resistors on the collector can be removed and replaced with one 1k resistor and the output taken from the junction of this resistor and the collector of the transistor.
> I have quickly assembled this circuit on a test board and tried it by flashing a signal wire to ground. Using a 12volt supply I get a nice sharp  10volt pulse(observed on a scope) whenever I ground the wire.
> Make sure your transistor is ok and that you have the terminals the right way round.



I tried all the above in various stages all the way up to all suggestion being implemented.

I replaced the PNP BC558 transistor to be sure.  I learned how to test it and it seems to do what its supposed to.
I added a 1k resistor across the +ve and switch wire then added an LED to the Hall sensor so its the same as a ky-003.
I added an LED from the collector of the transistor to ground so I can see it switching with the hall sensor.
I removed the 1k5 and 220R resistors for a single 1k resistor and connected the CDI trigger wire between the cathode leg and that resistor.

NOTE. When I hold the magnet at the hall sensor on the LED on the hall lights up.  While the LED at the transistor gives a short flicker and then goes off even if I hold the magnet in place.  I would think this is the correct operation.

The CDI continues to test fine when on the induction coil trigger.  Just wont work when on the hall sensor or points.

Im happy to keep plugging away.  But I am at a loss.


----------



## Claudio Masetto

You need to add a pullup resistor from the +ve to the signal terminal of the hall sensor. The resistor and led which you have put there is ok to show that the sensor is working but is not acting as a proper pullup. You can leave the resistor and led and add the pullup as I have shown in the diagram. You also need to add another pullup on the other side of the capacitor as shown on my diagram otherwise the base of the transistor is floating. 
You must remove that led across the transistor. That will interfere with the proper operation of the transistor.
And last, all you need is a 1K resistor from the collector to the ground terminal to extract a pulse from.


----------



## paulc

Before the LED I did try the pull up resistor across the hall sensor +ve and signal out and made no difference. But I will try your schematic and remove the LED across the transistor too and do the other things as well.  
thanks


----------



## paulc

I’d imagine the trigger voltage produced by the original pick coil would be quite high. Is it possible that the 12 volt circuit here is too low in voltage to trigger?
I speculate that perhaps Bluejets CDI maybe designed differently that mine, the Chinese will keep changing designs to make production more efficient.


----------



## paulc

Claudio Masetto said:


> You need to add a pullup resistor from the +ve to the signal terminal of the hall sensor. The resistor and led which you have put there is ok to show that the sensor is working but is not acting as a proper pull-up. You can leave the resistor and led and add the pullup as I have shown in the diagram. You also need to add another pullup on the other side of the capacitor as shown on my diagram otherwise the base of the transistor is floating.
> You must remove that led across the transistor. That will interfere with the proper operation of the transistor.
> And last, all you need is a 1K resistor from the collector to the ground terminal to extract a pulse from.



Claudio,  See the attached pic, I followed your schematic .  All the resistors shown are 1k.   I temporarily used a grounded LED to test the  cathode leg of the transistor and with each pass of the magnet over the hall sensor, sure enough the LED gave a  "pulse".  But still no spark!

I have two of these DC 4 pin CDI and both work fine on the original induction coil pick up.

As bluejets is also based in Australia I wish I could send my two CDI modules to him to see if they would work on his parts.  If they do not then at least we know that not all CDI are the same and if they do work then I know its at my end!


----------



## Claudio Masetto

Hi Paulc, it is possible that the CDI module might require a high pulse to trigger it. I have only looked at the pulse on my ocilloscope as I do not have a CDI module and it produces a nice clean 10v pulse. Maybe this is not enough.
Do you know if it is possible to obtain a schematic of the internal circuit of the CDI module?
Whereabouts in Australia are you?


----------



## paulc

Claudio Masetto said:


> Hi Paulc, it is possible that the CDI module might require a high pulse to trigger it. I have only looked at the pulse on my ocilloscope as I do not have a CDI module and it produces a nice clean 10v pulse. Maybe this is not enough.
> Do you know if it is possible to obtain a schematic of the internal circuit of the CDI module?
> Whereabouts in Australia are you?



Claudio, unfortunately I dont have the inner workings of the CDI, it is of course ebay Chinese and god knows what they have inside them and Im sure like any budget manufacturer they will alter the design to suit their parts inventory and although the packaging looks the same and serves the same function, the subtle construction differences may be the reason why Bluejets can get his CDI to fire where as others can not.  This is just my hypothesis.


----------



## paulc

Success! (In a round about sort of way).

So I was using the coil ripped out of an old 24 volt relay as an induction coil for the CDI trigger by passing a magnet passed the induction coil and inducing the desired spike (emf) which the SCR is looking for to trigger, and of course worked like a charm.  Good sparks.

Yes I too suspected that at least for my CDI unit, I needed a high pulse voltage, more in line with what the induction coil would be emitting.

Then I thought, well what would happen if I used a simple hall circuit, via the cathode of the BC558 transistor to send a pulse to the external induction coil while the coil was still connected to ground and the trigger of the CDI?  The coil would be energize and on release of the voltage spike.  Well it worked!  Then I tested the unit on the lathe at 2,000 rpm with a 9 slot interrupter....  18,000 sparks per minute using the Hall sensor as a trigger.  No problem and with a 5 mm plug gap!

I then replaced the rather bulky 24 volt induction relay coil with the coil from a very small 12 volt reed relay.  It still worked and at 18,000 rpm.

Oh and using a timing strobe light I noticed the unit has a crude advance / retard.  At below about 700 rpm the unit is fully retarded any rpm above 700 the unit jumps to about 25 degrees advance, there is no apparent curve , just advance on or advance off .  I would suspect this is to aid safe kick starting on a bike or quad bike.

I can use this!!!


----------



## paulc

Here's a video of the set up and it running.  (as of writing the video was still uploading)


----------



## Foketry

Claudio Masetto said:


> Hi Paulc, it is possible that the CDI module might require a high pulse to trigger it. I have only looked at the pulse on my ocilloscope as I do not have a CDI module and it produces a nice clean 10v pulse. Maybe this is not enough.
> Do you know if it is possible to obtain a schematic of the internal circuit of the CDI module?
> Whereabouts in Australia are you?



here the diagram of the CDI 4 wires, in the same file there are also 5 and 6 wires, I hope it is useful


----------



## Claudio Masetto

Hi Paulc, good to see that you have it working. I believe that Tornitore45 in post 6 of this thread has an explanation of the trigger pulse required for the CDI module. He says that it needs to see a negative pulse to arm the unit before the positive pulse. He says that you can use a simple differentiator for this. I have redrawn the schematic and you can try it if you like. Note that I have changed the position of the hall effect terminals on my diagram.


----------



## Foketry

paulc said:


> Here's a video of the set up and it running.  (as of writing the video was still uploading)




Excellent job !
Could you also indicate the values of the resistances, the type of Hall sensor, the connections with the CDI and with the relay coil ?
I would like to replicate your schema, could you write the values on the sheet I saw in the video, thanks


----------



## paulc

Hall sensor is the same as most any used here on the forums for all ignitions.  3144 but Ive used several others.  The Hall signal wire just goes to ground when the magnet is near and goes open when is not.  There is no pull-up resistor used on my Hall sensor.  The LED you see in my video is just for indication.  It can be deleted.

All the resistors shown are 1k
The transistor is BC558 (PNP)
The induction "booster coil" is just a 12 volt reed switch relay. Im only taking advantage of the the tiny coil from it. No need to chop it up as the whole relay package is tiny and secure.   But you could use any coil from any 12-24 volt relay. I just used the reed style relay as it is tiny!
The induction boost coil is wired to ground and the other side of the same coil has two wires on the same pin, one to the CDI trigger and the other to the cathode of the BC558.

Every time the hall sensor is goes to ground, the BC558 energizes the boost coil, then when the hall sensor opens the booster coil collapses and triggers the SCR in the CDI.

Wiring to the CDI is unchanged.  trigger (input from booster coil), ground, +12volt,  HT coil out.


----------



## Foketry

It works  
Thanks for all


----------



## paulc

Foketry said:


> It works
> Thanks for all
> 
> View attachment 128275



Well done


----------



## paulc

Tachometer and Kill switch.
Using an electronic tachometer I connected the tach input to the trigger terminal on the CDI. This is the same terminal the booster induction coil is on.
The kill switch I ground the same wire.  Seems to work fine in tests.


----------



## paulc

Here are some pictures of the completed item.  Re potting the extra component added about 6 mm to the over all thickness of the CDI.  FYI the potting mix is just some regular epoxy resin mixed with about 4% acrylic house paint  
I pushed the terminal locking tabs in then using a heat gun softened the potting epoxy and the green plastic plug socket cam out easily. Then changed all the plugs to suit my needs and soldered my harness directly to the terminals which were cut short and bent over to form soldering pads. The unit has a tachometer output and a grounding kill option (blue ended wire).
I have tested the unit to 18,000 spark per minute on an exaggerated plug gap with no issues.
I'm please with how it came out.  Now to test on a running engine.

NOTE:  In the diagram we are only using the coil from the reed relay as an induction booster for the CDI trigger.  The contacts from the reed can be trimmed off.


----------



## Claudio Masetto

Looks good.


----------



## bluejets

Good to see you have it sorted.

I did suggest a possible fix along those lines but haven't had time to scratch myself lately.
https://www.homemodelenginemachinis...park-fellow-aussie.100883/#convMessage-105350

Just noticed the fix in my email........

Now if you need a water temperature gauge to go with it, there is one on my youtube .
If you want I can link here on a new topic.
Yeah, it works no worries.


----------



## paulc

bluejets said:


> Good to see you have it sorted.
> 
> I did suggest a possible fix along those lines but haven't had time to scratch myself lately.
> https://www.homemodelenginemachinis...park-fellow-aussie.100883/#convMessage-105350
> 
> Just noticed the fix in my email........
> 
> Now if you need a water temperature gauge to go with it, there is one on my youtube .
> If you want I can link here on a new topic.
> Yeah, it works no worries.



Hi Bluejets, still makes me think we need to test some other units on your set up.  To see why your CDI works on your original circuit and why others dont.  If you plug one of my spare CDI into your set up and it works I will faint!!!  If you email me your addy I'll be happy to send you a couple to try out.  It would be good to know.


----------



## dsage

Paul:
Do you have a proper schematic of your finished circuit - rather than the interconnection diagram or parts laid out on a piece of paper. I'm having trouble figuring out exactly how everything is connected.
Nice work. Seems a pretty simple solution to the problem.
Thanks


----------



## bluejets

PaulC,
Had a few minutes tonight so I dragged out the original drawing and modified it for you to your new design and specs.
You might want to check it out......
BTW..... most hall effect are open collector and require some kind of circuit to the positive rail be it either a resistor or an LED/resistor otherwise they simply just won't work.
It's just signal level stuff so 1k0 is ok.
I have shown it with a 680R as i calculated it out with a red LED @ 20mA.   Good for setting the timing.
The original KY-003 already has a pullup so the 680R and the LED in this instance if using that module , is unnecessary.
If using a bare hall effect such as the 3144, always good idea to wack a small (0.1uf) cap right on the switch terminal legs power rails.
Not my idea, rather Allegro.
For others, just take note the order of the pinout on the KY-003 will be different to that shown above so don't blow it.

It might be an improvement to add a small series capacitor in the signal lead between the signal output of the Hall Effect and the BC558 base resistor. That way, the transistor only turns on during the pulse from the hall effect rather than being on all the time when the hall effect is on. (e.g. engine stops)
One of those suck it and see things I guess, might be unnecessary as KISS is best in many instances.

Finally a link to your reed switch.....
12V SPST Low Cost Reed Relay | Jaycar Electronics

dsage..hope this helps....

Cheers Jorgo


----------



## dsage

Yes. That's great.
I've been looking at schematics for 55 years so interconnection diagrams just don't completely do it for me. 

Your suggestion of the series capacitor would normally be a good one but if I understand the CDI unit operation it might mess with the advance feature since the capacitor would charge up and "time out" releasing the drive to the transistor early at low rpms. I haven't analyzed it fully though.
Even if the transistor drive stayed on (engine stopped) there would only be 12ma or so of current draw. Of course I don't know what the CDI unit itself would draw. I assume not much since it appears it's looking for a HV pulse for a trigger. One would have to measure the current draw with the drive stuck on.


----------



## paulc

dsage said:


> Yes. That's great.
> I've been looking at schematics for 55 years so interconnection diagrams just don't completely do it for me.
> 
> Your suggestion of the series capacitor would normally be a good one but if I understand the CDI unit operation it might mess with the advance feature since the capacitor would charge up and "time out" releasing the drive to the transistor early at low rpms. I haven't analyzed it fully though.
> Even if the transistor drive stayed on (engine stopped) there would only be 12ma or so of current draw. Of course I don't know what the CDI unit itself would draw. I assume not much since it appears it's looking for a HV pulse for a trigger. One would have to measure the current draw with the drive stuck on.


During my experiments I found leaving the 0.1 cap on the base leg of the transistor caused the spark to break down at an earlier rpm. The cap gives a short pulse but at high rpm this is not allowing the reed coil time to saturate. 
Removing the cap I can push past 18,000 sparks per min!
The current draw even if the hall is stuck on is very small, the cdi quickly fills the 400v cap and stops taking. Even if the reed booster coil draws current its nothing, I suspect you could leave it stuck on all day. I’ll do some current draw tests in various situations including hall on while stationary.

Bluejets good work on schematic!  Is the role of the LED across the Hall just for indication or plus protection purposes ?


----------



## bluejets

bluejets said:


> BTW..... most hall effect are *open collector* and require some kind of circuit to the positive rail be it either a resistor or an LED/resistor otherwise they simply just won't work.
> It's just signal level stuff so 1k0 is ok.
> I have shown it with a 680R as i calculated it out with a red LED @ 20mA.  Good for setting the timing.
> The original KY-003 already has a pullup so the 680R and the LED in this instance if using that module , is unnecessary.


----------



## paulc

bluejets said:


> BTW..... most hall effect are *open collector* and require some kind of circuit to the positive rail be it either a resistor or an LED/resistor otherwise they simply just won't work.



But Im using a bare bones Hall sensor with no pull-up resistor or LED across the Hall pins and it works fine?


----------



## paulc




----------



## bluejets

you're probably getting bias through the pnp transistor.....fine by me if you don't want to listen.
Just thought I'd tell you as it will trip you up one day.


----------



## paulc

bluejets said:


> you're probably getting bias through the pnp transistor.....fine by me if you don't want to listen.
> Just thought I'd tell you as it will trip you up one day.



Hey Bluejets, please dont think Im being defiant, Im  just trying to understand the reasons for why my Hall sensor is working in the absence of a resistor and LED and in response to you saying "simply just won't work".

Do you think back EMF from the reed coil could be an issue for the Hall sensor?  Can the Hall sensor be further protected from spikes.  I know first hand how easy they are to damage


----------



## 74Sprint

The data sheet for the 3144 states that when it is off it can handle 28 volts on it's output.


----------



## paulc

MORE INFO:
Hi all, well I can 100% confirm that , as I suspected there are indeed variations of this so called 4 PIN 12 VDC CDI. So far I have received two of these units from two separate eBay suppliers. The units are packaged the same but each performed differently. These differences below.

1. Supplier "A" and unit "A" would not work on member Bluejet's modification, but would work using the modified circuit with booster induction coil in series with the trigger terminal.
2. Unit A would spark on the LED going out.
3. Unit A does have a crude retard feature on start up RPM (below approx 700).

4. Supplier "B" and unit "B"works fine with the above circuit with NO booster coil. But does have a hotter spark with the booster coil.
5. Unit B has no timing advance or retard, its fixed at all RPM.
6. Unit "B" with the booster coil sparks when the LED first comes on.
7.Unit "B" with no booster coil sparks when the LED goes out! ( go figure)?

Conclusion: Based on my practical experiments unit B with booster coil, no advance, and sparking when Hall LED first comes on is the preferred unit IMO. It has a stronger spark as determined by the ever increasing gap it could jump at 18,000 spark / min without breaking down.

Now how does one know which one they are buying? 

Cheers Paul


----------



## bluejets

Bit of free time so whipped up a mod circuit using PaulC idea but different bias arrangement and also dc block cap.
If one needs to use a remote Hall effect 3144 type to reduce size of the pickup hall as apposed to the KY-003 module, one could simply remove it from the KY-003 module or use a descete part and add any indicators themselves.
If using the module, it has all the necessary components on board except for the 0.1uF capacitor.
Relay i used was a small 12v unit, details on the drawing but just about any small coil would suffice.
This particular one was chosen due to coil resistance of around 700 ohm.
I cut a small hole in the top of the case and filled it with epoxy, probably not necessary but did it all the same.
My opinion would be that this type of coil would produce a better pulse due to it's inbuilt core whereas the reed coil has an air core.
As best I could tell with my little DS150 scope, trigger pulse is around 8-10V.


----------



## Eccentric

Can the CDI drive two coils simultaneously?  I am looking for an ignition system for a inline twin cylinder engine with a single hall sensor pickup and wasted spark.  The pistons move in unison, one is on the power stroke while the other is on the exhaust stroke. An ignition system that has a magnet on the crankshaft and a hall sensor that fires a CDI unit once a crankshaft revolution that could drive two coils would produce a spark to the two cylinders simultaneously.  One would fire the power stroke and the other would be wasted.

I really like the idea of using the inexpensive 12DV CDI units for skooters and mopeds.  But could one fire two coils instead of one?  Without knowing the inside circuitry of the CDI unit, the switching transistor driving the coils in parallel would see half the resistance and be required to drive twice the current.  Don't know if it could handle that.

there are six cylinder car engines that use this technique, firing two of the six cylinders simultaneously, one with wasted spark.  I have not been able to find one of the CDI units as inexpensive as the moped variety.

Any other suggestions?  Using a wasted spark ignition would eliminate the distributor.

Thanks


----------



## Chaffe

I just use an automotive COP, one thing does whole job, hall sensor triggered, easy to wire up and cheap.


----------



## Eccentric

A great suggestion, I found this on the web:

Starting in 1997, General Motors used a new (_for them_) coil-near-plug ignition system for the then new Corvette LS1 engine. The system features eight coils (one per cylinder) mounted on the valve cover, with short spark plug wires to connect the coils to the spark plugs. The General Motors LS1 coils are not just conventional ignition coils. Instead they are complete single-cylinder ignition systems. They contain all the electronics for dwell limiting, current limiting, etc. These coils are controlled directly by a low voltage, low current signal from the sequencer. There is no intervening ignition module (like an EDIS or GM DIS). Because the LS1 coils have the igniters built in, they make for an easy installation and generate less electromagnetic noise in the other wiring under the hood.

The LS1 coil has 4 connections (as well as the high tension terminal for the spark plug wire, of course):


A = Coil Primary Ground (to engine block)
B = Signal Ground (to engine block)
C = +5V Ignition signal 
D = Switched +12V Supply to Coil Primary

Sounds easy, but a bit more expensive.


----------



## bluejets

Eccentric said:


> Can the CDI drive two coils simultaneously?  I am looking for an ignition system for a inline twin cylinder engine with a single hall sensor pickup and wasted spark.  The pistons move in unison, one is on the power stroke while the other is on the exhaust stroke. An ignition system that has a magnet on the crankshaft and a hall sensor that fires a CDI unit once a crankshaft revolution that could drive two coils would produce a spark to the two cylinders simultaneously.  One would fire the power stroke and the other would be wasted.
> 
> I really like the idea of using the inexpensive 12DV CDI units for skooters and mopeds.  But could one fire two coils instead of one?  Without knowing the inside circuitry of the CDI unit, the switching transistor driving the coils in parallel would see half the resistance and be required to drive twice the current.  Don't know if it could handle that.
> 
> there are six cylinder car engines that use this technique, firing two of the six cylinders simultaneously, one with wasted spark.  I have not been able to find one of the CDI units as inexpensive as the moped variety.
> 
> Any other suggestions?  Using a wasted spark ignition would eliminate the distributor.
> 
> Thanks



No, cdi systems don't work like kettering systems.
This one was designed to drive one coil.
Use two "black boxes" and circuitry for each and you'll be fine.


----------



## Chaffe

Eccentric said:


> A great suggestion, I found this on the web:
> 
> Starting in 1997, General Motors used a new (_for them_) coil-near-plug ignition system for the then new Corvette LS1 engine. The system features eight coils (one per cylinder) mounted on the valve cover, with short spark plug wires to connect the coils to the spark plugs. The General Motors LS1 coils are not just conventional ignition coils. Instead they are complete single-cylinder ignition systems. They contain all the electronics for dwell limiting, current limiting, etc. These coils are controlled directly by a low voltage, low current signal from the sequencer. There is no intervening ignition module (like an EDIS or GM DIS). Because the LS1 coils have the igniters built in, they make for an easy installation and generate less electromagnetic noise in the other wiring under the hood.
> 
> The LS1 coil has 4 connections (as well as the high tension terminal for the spark plug wire, of course):
> 
> 
> A = Coil Primary Ground (to engine block)
> B = Signal Ground (to engine block)
> C = +5V Ignition signal
> D = Switched +12V Supply to Coil Primary
> 
> Sounds easy, but a bit more expensive.


It’s a good solution, All car petrol engines use these now, you can get them for pennies second hand. Also for the signal you can use 12v no issues as it’s just a logic signal, which makes the wiring even easier. I use mine with points on one engine and a magnetic Reed switch on another. Very simple and very cheap


----------



## bluejets

I also have a circuit using a 12V Ford cop coil, a few components including a hall effect.
Works well.


----------



## Eccentric

I am pulling the bits and bobs together for my prototype:







You can see in the lower left the DC motor with a magnet mounted on the shaft, with the hall sensor underneath.  I have my prototype board ready for the circuit.  I'll keep you all posted on my progress.


----------



## TonyM

Could you use contact breaker or a microswitch, set to be normally open, for this type of coil?


----------



## bluejets

Eccentric said:


> I am pulling the bits and bobs together for my prototype:
> 
> View attachment 133933
> 
> 
> You can see in the lower left the DC motor with a magnet mounted on the shaft, with the hall sensor underneath.  I have my prototype board ready for the circuit.  I'll keep you all posted on my progress.



Just be aware that using those crappy breadboards can, in many instances, give you bad connections and you can chase problems all over not realising it.


----------



## Vixen

Paulc you have been sent a PM

Mike


----------



## Eccentric

A little progress:








I am working on my electronic ignition for my twin cylinder 4 stroke.  Here I am using a DC motor with a magnet mounted on a collar triggering a hall sensor--this simulates the setup on the engine.  I will use a magnet mounted to the crank and fire both spark plugs at the same time, ie wasted spark.  I will use a little microcontroller to adjust the timing advance from 5 to 25 degrees before top dead center depending on the RPM.  The circuit board has the analog circuitry that converts the hall sensor output to a nice 1 millisecond pulse, and then another transistor stage that will drive the coil over plug (COP)s from a signal generated by the microcontroller.  The pulse to the COPs will be 4 millisecond in duration.  This will diminish if the RPMs get high enough to not exceed a 50% duty cycle on the COP trigger signal.


Below is a scope trace of a couple of key signals in the analog circuitry.  the green is the signal generated by the RC circuit triggered by the hall sensor, and the yellow is the pulse on the output of the NPN transistor, the RC time constant is set for a 1 millisecond pulse.





Below is the DC motor setup to simulate the hall sensor on the engine.  I can control the motor speed by adjusting the voltage is sees.





Next up is wiring the COPs and the sparkplugs.  We will see what EMI havoc is caused by the high voltage travelling through the sparkplug wires.


----------



## paulc

Can someone confirm that modern coil over plug ignition systems as seen on bikes and cars today are using a transistorized ketering or CDI triggers?
I'd imagine those tiny coils above each plug would be CDI?


----------



## Eccentric

I can only speak to the COP I am using, the LS2 coil (GM# 12573190).  these are common in the US, I bought mine on Amazon.



The connector can be bought here: Mouser 829-15439568.  I made my connectors by printing them on my 3D printer.



The LS2 coil has 4 connections (as well as the high tension terminal for the spark plug wire, of course):

A = Coil Primary Ground

B = Ignition low noise ground from ECU (ground)

C = Ignition digital signal from ECU (+5V)

D = +12V Supply to Coil Primary







The maximum dwell should be set at 4.5 milliseconds - going longer does not generate any more spark energy.


----------



## bluejets

Eccentric said:


> A little progress:
> 
> 
> 
> 
> 
> 
> 
> 
> I am working on my electronic ignition for my twin cylinder 4 stroke.  Here I am using a DC motor with a magnet mounted on a collar triggering a hall sensor--this simulates the setup on the engine.  I will use a magnet mounted to the crank and fire both spark plugs at the same time, ie wasted spark.  I will use a little microcontroller to adjust the timing advance from 5 to 25 degrees before top dead center depending on the RPM.  The circuit board has the analog circuitry that converts the hall sensor output to a nice 1 millisecond pulse, and then another transistor stage that will drive the coil over plug (COP)s from a signal generated by the microcontroller.  The pulse to the COPs will be 4 millisecond in duration.  This will diminish if the RPMs get high enough to not exceed a 50% duty cycle on the COP trigger signal.
> 
> 
> Below is a scope trace of a couple of key signals in the analog circuitry.  the green is the signal generated by the RC circuit triggered by the hall sensor, and the yellow is the pulse on the output of the NPN transistor, the RC time constant is set for a 1 millisecond pulse.
> 
> 
> 
> 
> 
> Below is the DC motor setup to simulate the hall sensor on the engine.  I can control the motor speed by adjusting the voltage is sees.
> 
> 
> 
> 
> 
> Next up is wiring the COPs and the sparkplugs.  We will see what EMI havoc is caused by the high voltage travelling through the sparkplug wires.


You might find there is alread a/r built in to the black box if using the original


----------



## awake

Eccentric, this is most interesting. Is the "igniter" circuit shown above built into those COP units, or are you needing to build that part?


----------



## Eccentric

The ignitor is built into the COP, that is why they are so nice.  All you need to do is provide a simple 5 Volt, low current pulse to trigger it.


----------



## awake

That is very cool. I will definitely check that out!


----------



## willray

Eccentric said:


> The ignitor is built into the COP, that is why they are so nice.  All you need to do is provide a simple 5 Volt, low current pulse to trigger it.



Could you please provide more information on how you're handling dwell?

I see there is someone successfully running small-equipment type engines (kohler, tecumseh, onan, small-HP engines) using a GM inductive crank trigger to provide the pulse for these, but I'm having trouble figuring out how that works.

Some reading says that these coils like 3-5 ms dwell, and back-of-the-napkin calculations say that a crank trigger at 3600RPM probably provides an on-time of something like (360 degrees * 60 revolutions per second = 21600 degrees per second, 1 degree subtended/21600 degrees/second = 0.05 milliseconds).  0.05ms doesn't sound like it's even remotely enough dwell, so how that even works mystifies me, but it sounds like you're doing something more sophisticated.  I'd love to learn more.


----------



## Eccentric

@willray 

The coil I am using likes to see as you say, about 4ms of dwell.  This is the time to charge the coil and determines the energy of the spark.  If my engine is running at 4000 RPM and I am using wasted spark where I fire both spark plugs every revolution of the crankshaft, I need to fire the spark plugs every 15 milliseconds.  (4000 RPM is 66.7 Revolutions per second, or 1/66.7 = .015)  Of this 15 milliseconds, 4ms is used to charge the coil.   At 7500RPM, the crankshaft is turning 125 times a second, or once every 8 milliseconds.  We still have half of this time to charge the coil.

When the engine is running, the crankshaft rotates and the magnetic sensor produces a reference pulse each revolution. These are fed to the microcontroller, which records the time of each reference to microsecond accuracy on an internal clock. From these times the RPM is calculated and the required timing advance angle is derived. The actual time of the next spark is calculated, and when the clock reaches this value, the pair of plugs fire. For starting, the priority is to prevent kickback and ensure a big spark. To achieve this the spark occurs at 3 degrees AFTER TDC. The active edge of the magnet is physically installed at this point and this generates the spark immediately. Both spark plugs are fired in my twin engine, thus one spark is “wasted” as it occurs at the end of the exhaust stroke, and so has no effect. The benefit of this is that no distributor is required and the accuracy of the spark timing is improved, as the timing is taken directly from the crank, not through the gear driven camshaft. The microcontroller does a number of other things as well as controlling the main timing process.

The spark timing is as follows: from 0 to 500 RPM the spark is fired 3 degrees after TDC.  From 500 RPM to 1000 RPM the spark is advanced to 7 degrees before TDC.  From 1000 RPM to 3000 RPM the timing is advanced linearly from 7 to 25 degrees before TDC.  From 3000 RPM to 5000 RPM the timing is advanced to 25 degrees before TDC.  Above 5000 RPM the spark is not advanced and set to TDC.  This is an over rev limiter of sorts.

The microcontroller uses at minimum a 25 microsecond time base, which equates to one degree timing resolution up to 6667 RPM.

Does this answer your question?


----------



## 74Sprint

If anyone is needing more info on the LS1/2 coils here are some links that explain more about dwell timing requirements including using coil charge voltages from 6v to 16v. The testing I have done so far is with 5v and 12v signals and can say that both voltages work fine. From what I have read a minimum signal is between 3-5v depending if you are using the LS1 or LS2 coil. The LS2 coil is mainly used on the truck engines and is the preferred one to use. There is a max to the trigger signal duration (dwell), if you go above this value the coils will self discharge (6-8 msec). From my testing I found the same as others above 2 msec duration you get into diminishing returns and just create heat.

Excellent info from Haltech a leader in engine management systems:
Haltech Support Center

Very good write up with lots of testing:
LSx Coil Testing

Cheers
Ray


----------



## willray

Eccentric said:


> @willray
> ....
> When the engine is running, the crankshaft rotates and the magnetic sensor produces a reference pulse each revolution. These are fed to the microcontroller, which records the time of each reference to microsecond accuracy on an internal clock. From these times the RPM is calculated and the required timing advance angle is derived. The actual time of the next spark is calculated, and when the clock reaches this value, the pair of plugs fire. For starting, the priority is to prevent kickback and ensure a big spark. To achieve this the spark occurs at 3 degrees AFTER TDC...
> 
> ...
> 
> Does this answer your question?



Perfectly - thanks!

It looks like this would be easy to implement as an interrupt-driven process that simply wakes up uC every time it sees the reference pulse and calculates the delay until it needs to turn the coil back on for the next planned plug firing.

For some reason I was imagining the calculation of the anticipated delay to be harder than this - I'm not sure why my brain wanted to use a sliding average over several revolutions...

One question:  It seems like the straightforward way to implement this strategy would result in missing (firing extremely late) on the first revolution after the very first successful "pop" when starting the engine:  After the first cylinder fires for the first time when cranking, the next revolution will be much faster than anticipated from the previous one.  At least in theory, this could result in the uC not getting around to turning on power to the coil, until after TDC comes around and it should have fired.

At least conceptually, this seems like it would limit your acceleration - below 500RPM, if the next revolution is faster than 4ms faster than the previous revolution, the coil turn-on would happen after it should fire?

I take it that in practice, this isn't a problem?


----------



## 74Sprint

Eccentric said:


> @willray
> 
> The coil I am using likes to see as you say, about 4ms of dwell.  This is the time to charge the coil and determines the energy of the spark.  If my engine is running at 4000 RPM and I am using wasted spark where I fire both spark plugs every revolution of the crankshaft, I need to fire the spark plugs every 15 milliseconds.  (4000 RPM is 66.7 Revolutions per second, or 1/66.7 = .015)  Of this 15 milliseconds, 4ms is used to charge the coil.   At 7500RPM, the crankshaft is turning 125 times a second, or once every 8 milliseconds.  We still have half of this time to charge the coil.
> 
> When the engine is running, the crankshaft rotates and the magnetic sensor produces a reference pulse each revolution. These are fed to the microcontroller, which records the time of each reference to microsecond accuracy on an internal clock. From these times the RPM is calculated and the required timing advance angle is derived. The actual time of the next spark is calculated, and when the clock reaches this value, the pair of plugs fire. For starting, the priority is to prevent kickback and ensure a big spark. To achieve this the spark occurs at 3 degrees AFTER TDC. The active edge of the magnet is physically installed at this point and this generates the spark immediately. Both spark plugs are fired in my twin engine, thus one spark is “wasted” as it occurs at the end of the exhaust stroke, and so has no effect. The benefit of this is that no distributor is required and the accuracy of the spark timing is improved, as the timing is taken directly from the crank, not through the gear driven camshaft. The microcontroller does a number of other things as well as controlling the main timing process.
> 
> The spark timing is as follows: from 0 to 500 RPM the spark is fired 3 degrees after TDC.  From 500 RPM to 1000 RPM the spark is advanced to 7 degrees before TDC.  From 1000 RPM to 3000 RPM the timing is advanced linearly from 7 to 25 degrees before TDC.  From 3000 RPM to 5000 RPM the timing is advanced to 25 degrees before TDC.  Above 5000 RPM the spark is not advanced and set to TDC.  This is an over rev limiter of sorts.
> 
> The microcontroller uses at minimum a 25 microsecond time base, which equates to one degree timing resolution up to 6667 RPM.
> 
> Does this answer your question?


It seems your forgetting one thing - the amount of time the uC takes too calculate all the variables and lookup/s. This time will have to be measured and subtracted from the delay calculation for accurate ignition timing. I have done this using both counting clock tics (@16mhz) and just micro-seconds, this where a test bench comes in handy and a scope. For those that don't know the uC can only make delays to set the timing. So less delay - makes for advancing the timing and vice-a-versa more delay less timing, it can not predict the future. I try for setting the trigger pulse between 45 and 90 degrees BTDC to give the uC enough time depending on the application. 

I'm not sure what uC you are talking about but, a time base of 25 msec equates to a 40khz uC ?
With a UNO-R3 running at 16mhz the time base is 62.5 nsec between clocks (time base). Using an interrupt and as far as I know it takes 5 clock pulses just to activate the interrupt handling before any code execution. This is where you need to start a timer from when the trigger pulse is seen and stop it when the interrupt exits, take the number of counts and convert it to time, if you wish. You then subtract this from your ignition delay (actual ignition timing). I use clock counts to control my ignition time delay. All of this (trigger pulse width = RPM, calculation time, and timing lookup) must be measured as processing time. If you only have 1 coil firing per rev then add the coil charging time to your processing time to get your max RPM i.e. Calibration.

Calculating the RPM and firing delays is not that easy. Microchip has a micro-controller the PIC16LF1619 family that was designed to use angular velocity to do the RPM & processing but, it does not use pulse width, it instead uses the time between 2 trigger pulses. It was only designed for single cylinder engines or wasted spark for twins. They have demo software available but, their IDE software has a big learning curve compared to Arduino. In RCgroups we used the PIC12LF1840 (16Mhz) and got 11,000 rpm (single cylinder) out of it with 2 ignition curves stored on it. Programmable-Open-Source-CD-Ignition-PIC1840

Anyway that's my 2 cents worth for now and I hope it helps. Oh, the Excel spreadsheet I have included is for a V8 with triggers very 90 degree but, it still shows what is going on.

Cheers
Ray


----------



## 74Sprint

willray said:


> Perfectly - thanks!
> 
> It looks like this would be easy to implement as an interrupt-driven process that simply wakes up uC every time it sees the reference pulse and calculates the delay until it needs to turn the coil back on for the next planned plug firing.
> 
> For some reason I was imagining the calculation of the anticipated delay to be harder than this - I'm not sure why my brain wanted to use a sliding average over several revolutions...
> 
> One question:  It seems like the straightforward way to implement this strategy would result in missing (firing extremely late) on the first revolution after the very first successful "pop" when starting the engine:  After the first cylinder fires for the first time when cranking, the next revolution will be much faster than anticipated from the previous one.  At least in theory, this could result in the uC not getting around to turning on power to the coil, until after TDC comes around and it should have fired.
> 
> At least conceptually, this seems like it would limit your acceleration - below 500RPM, if the next revolution is faster than 4ms faster than the previous revolution, the coil turn-on would happen after it should fire?
> 
> I take it that in practice, this isn't a problem?


Using an interrupt stops the uC from executing any other code until the interrupt is finished. Calculating the ignition delay/timing isn't that easy trust me I've been there and done that. The actual processing time must be found out (measured) and it never changes unless the code changes, a scope really helps for this stuff. Otherwise it's just guess work and a lot of playing around with the code. For example if you want 10 degrees BTDC you need a degree timing wheel and a timing light and pointer. So now you start the engine (hopefully) and find that the timing is 5 degrees BTDC, now you have to take some delay out. Do you use time or clock pulses and by how much? Are you using pulse width or the time between triggers too calculate RPM? Are you using the leading edge of the trigger or trailing edge? If using the trailing edge then the time will be getting shorter as RPM increases throwing off the timing, auto-advance. Magnet strength, type of Hall-effect, and the distance between them will change the timing. Using the leading edge means so long as the trigger source devices don't change then the moment when the trigger happens won't change. Using the pulse width means the timing is for that revolution (end of it), using time between pulses means the timing is late by 1 revolution. Either way your timing will only be out by 1 rev, reaction not forecasting.

Cheers
Ray


----------



## awake

74Sprint said:


> Using an interrupt stops the uC from executing any other code until the interrupt is finished.


Or until interrupts are re-enabled. In real-time systems that I have worked on, one either makes the interrupt routine very short and quick, or one implements a flag to prevent re-entry and one re-enables interrupts so that other routines can run as needed.


----------



## 74Sprint

awake said:


> Or until interrupts are re-enabled. In real-time systems that I have worked on, one either makes the interrupt routine very short and quick, or one implements a flag to prevent re-entry and one re-enables interrupts so that other routines can run as needed.


Your correct.  
I'm still trying to learn how to do interrupts with dual & quad cores. I haven't had time to figure that one out yet. Hopefully I can have 1 core handle some interrupts and the other core handle some other ones. Any ideas?

Cheers
Ray


----------



## bluejets

74Sprint said:


> Using an interrupt stops the uC from executing any other code until the interrupt is finished.


As I imagine you already know, it's why interrupts are kept as short as possible.
As for delays, blink without delay.


----------



## awake

74Sprint said:


> Your correct.
> I'm still trying to learn how to do interrupts with dual & quad cores. I haven't had time to figure that one out yet. Hopefully I can have 1 core handle some interrupts and the other core handle some other ones. Any ideas?
> 
> Cheers
> Ray


Great question, Ray. I have to confess that all of my microcontroller experience is with single-core processors, not multi-core.  I find Andreas Spiess ("the guy with the Swiss accent") on YouTube to be a good resource; sometime back he dug into the dual cores of the ESP32 a bit. As I recall, the standard configuration of the ESP32 uses one core to handle the wifi / bluetooth, and leaves the other core free to do whatever is needed - but it is possible to schedule tasks on the wifi/bluetooth core as well. The key - if I remember correctly, which is not at all assured - is that there is actually a mini-RTOS running on the ESP32 behind the scenes.

Extrapolating from that fuzzy memory, I wonder if the key to using multi-core processors as microcontrollers might be some sort of RTOS to allow you to specify exactly which cores handle which tasks - ?? The more I think about it, I'm not sure how you would achieve determinacy with multi-cores without an RTOS to help. But again I stress - none of what I've said is based on personal experience, so please apply a liberal helping of NaCl!


----------



## 74Sprint

awake said:


> Great question, Ray. I have to confess that all of my microcontroller experience is with single-core processors, not multi-core.  I find Andreas Spiess ("the guy with the Swiss accent") on YouTube to be a good resource; sometime back he dug into the dual cores of the ESP32 a bit. As I recall, the standard configuration of the ESP32 uses one core to handle the wifi / bluetooth, and leaves the other core free to do whatever is needed - but it is possible to schedule tasks on the wifi/bluetooth core as well. The key - if I remember correctly, which is not at all assured - is that there is actually a mini-RTOS running on the ESP32 behind the scenes.
> 
> Extrapolating from that fuzzy memory, I wonder if the key to using multi-core processors as microcontrollers might be some sort of RTOS to allow you to specify exactly which cores handle which tasks - ?? The more I think about it, I'm not sure how you would achieve determinacy with multi-cores without an RTOS to help. But again I stress - none of what I've said is based on personal experience, so please apply a liberal helping of NaCl!


Same here, all my experience has been with single cores. I have an RTOS that I had a hell of a time to get from STmicro but, it is the only one certified by usULc that is free for life critical operations. I have been reading up on it and I think your right that an RTOS is needed for multi-core processing. Most of my experience with multi-cores has been with PCs. They generally turn on extra core when the first core (main) reaches about 60% usage and so on for additional cores. I have noticed my new AMD Ryzen 7 turns on whatever core other than the main core (#1) that has lowest usage. From what I have read this STmicro RTOS allows you to choose which core does what for code. You still have a main core with the main code that talks to the second core and combines any results from the second core to the main core code for further processing, I believe that's how it works. Once again take with some salt. Not sure yet which ARM processor I will be using. Also most RTOS's I have checked out have a max cert rating for appliances, LOL.

Cheers
Ray


----------



## awake

There is an open-source RTOS (FreeRTOS - Market leading RTOS (Real Time Operating System) for embedded systems with Internet of Things extensions) but I've not yet had occasion to play with it. I also came across TI-RTOS, which is supposed to be free and open-source, but of course limited to TI microcontrollers. If & when you gain experience with the ST RTOS, I'll be most interested to hear how it goes!


----------



## awake

Oh, wait - just dug around to find the ST RTOS, and I think it may actually be a version of FreeRTOS: FreeRTOS Kernel - STMicroelectronics.


----------



## Eccentric

The electronic ignition I am working on is a simple embedded solution, no RTOS.  I have an analog circuit that uses the hall sensor to create a 4ms pulse, firing the spark plug about 3 degrees after top dead center on the compression stroke. When the engine is running below 500 RPM (for example starting), this is passes straight to the COP and the fires the plug, no software in the loop. I use two interrupts with just a few lines of code in them.  One is triggered by the hall sensor and the other is triggered by a timer and used to position and time the trigger pulse.  I remain in the time domain and do no calculations in inverse time, that is I measure the time between events and do not use RPM.  The main loop uses a lookup table to generate the timing of the pulse depending on the time of one revolution (I  actually take a running average of several revolutions, minor detail).

Post #118 describes my approach.  Also be careful not to confuse microseconds with milliseconds.


----------



## awake

Eccentric said:


> The electronic ignition I am working on is a simple embedded solution, no RTOS.  I have an analog circuit that uses the hall sensor to create a 4ms pulse, firing the spark plug about 3 degrees after top dead center on the compression stroke. When the engine is running below 500 RPM (for example starting), this is passes straight to the COP and the fires the plug, no software in the loop. I use two interrupts with just a few lines of code in them.  One is triggered by the hall sensor and the other is triggered by a timer and used to position and time the trigger pulse.  I remain in the time domain and do no calculations in inverse time, that is I measure the time between events and do not use RPM.  The main loop uses a lookup table to generate the timing of the pulse depending on the time of one revolution (I  actually take a running average of several revolutions, minor detail).
> 
> Post #118 describes my approach.  Also be careful not to confuse microseconds with milliseconds.


Right - we are getting a bit far afield / overkill with multi-core RTOS solutions. I see no reason a basic Arduino couldn't handle this task just fine.

I do wonder if the hybrid analog / digital approach you describe may be less simple than a purely digital approach ... maybe ?


----------



## Eccentric

Yeah, your are probably right, I built the analog circuitry first, then decided to use a micro controller.   When it is all said and done, the majority of the analog circuitry may not be needed.


----------



## Lloyd-ss

Eccentric said:


> Yeah, your are probably right, I built the analog circuitry first, then decided to use a micro controller.   When it is all said and done, the majority of the analog circuitry may not be needed.


Yes, so true.  I recently ran into the analog vs micro dilemma in an air cylinder project. At first, there was just going to be one precisely timed blast of high pressure air. Then it snowballed into a purge cycle, and then a dwell, and then a return. All was done with 555 timers, hooked in series, with individual and combined outputs to mosfets to drive the solenoid valves. With trim pots at each of the 555's, the timing can be controlled, but in the long-run, a micro probably would have been easier. But then again, the timing can be tweaked with a simple screwdriver.

But my real dilemma was that my last micro work was with a Parallax Stamp over 10 years ago (which I Ioved), and now (at 71) the micro technology is light years ahead of that and I don't know where to start. Yet, the Stamp was so simple to program and use. My needs are very Basic (yes, pun intended), so what do I try that has the easiest learning curve, with no over-kill on capability?
Thanks, Lloyd
P.S. This thread has taken many twists and turns, so I hope my question is in tune with the spirit.


----------



## Lloyd-ss

Not sure if this is relevant to the mention of the spark pulses affecting the electronics, but it seems that some kind of shielding would be helpful.
I was working on a different kind of project a few years ago and had to prove to myself that the EMI was causing a problem.
Lloyd

Edit, But it just occurred to me that the spark doesn't seem to be affecting the 555 that is attached to the coil. 
I don't know.


----------



## awake

Lloyd-ss said:


> Yes, so true.  I recently ran into the analog vs micro dilemma in an air cylinder project. At first, there was just going to be one precisely timed blast of high pressure air. Then it snowballed into a purge cycle, and then a dwell, and then a return. All was done with 555 timers, hooked in series, with individual and combined outputs to mosfets to drive the solenoid valves. With trim pots at each of the 555's, the timing can be controlled, but in the long-run, a micro probably would have been easier. But then again, the timing can be tweaked with a simple screwdriver.
> 
> But my real dilemma was that my last micro work was with a Parallax Stamp over 10 years ago (which I Ioved), and now (at 71) the micro technology is light years ahead of that and I don't know where to start. Yet, the Stamp was so simple to program and use. My needs are very Basic (yes, pun intended), so what do I try that has the easiest learning curve, with no over-kill on capability?
> Thanks, Lloyd
> P.S. This thread has taken many twists and turns, so I hope my question is in tune with the spirit.


Lloyd, a couple of options to consider if you want to wade back into the microcontroller waters.

1) Arduino - which is not just *a* microcontroller, but a very broad and deep ecosystem. What I mean by that is, if you learn to use the Arduino IDE with a simple low-end 8-bit Arduino Nano, you can use the exact same IDE with a higher end STM32 32-bit ARM microcontroller, or an ESP32, or ... the list goes on. The ecosystem includes extensive libraries, so you do not have to re-invent the wheel. Want to include an LCD screen interface? There's a library to handle that. How about a temperature sensor? There are both libraries and auxiliary boards ready to go. And so on. If you go the standard Arduino route, you will be programming in C++, which may sound daunting ... but I am confident, if you have used a Stamp, you will be able to get the hang of it quickly. Arduino really aims to support beginners as well as more sophisticated users. And likely you will find it easier in many ways than the microcontrollers of years gone by - just plug the Arduino into a USB port and away you go.

2) Adafruit - which is a company that specializes in hobby level microcontrollers and accessories. They support Arduino (and Raspberry Pi) as well, but they also produce a line of "Circuit Python" controllers, which, as the name suggests, allow you to program in Python.I have to confess that I have not used Python, but it is a popular language - and I suspect it may be closer to BASIC than C++ will be. Like the typical BASIC implementation, Python is interpreted rather than compiled. However, unlike the typical BASIC implementation, Python *really* cares about indents. And that's about as much as I know, so I'll stop there, except to say, as I recall, Adafruit has a wide variety of libraries to support the wide variety of sensors and and adapters that are designed to work with their boards.

There are others, of course, but these are the two that I perceive to be most beginner- or getting-back-into-it-friendly. I have used the Arduinos a fair bit, and like them very much; I have not used the Circuit Python boards.


----------



## Lloyd-ss

awake said:


> Lloyd, a couple of options to consider if you want to wade back into the microcontroller waters.



Andy, thanks, that is the kind of answer I was hoping to get. The electronics is enjoyable, and clean and quiet, and can be done whenever I feel like it.  The PBasic of the Stamp was easy to learn because it was so much like Fortan (wow! throwback). If the Arduino IDE is as logical as Basic, it could definitely be a winner for me. Time to dive back in. I will have to look for some kind of "hobbyist starter kit" for Arduino, where a lot of the overwhelming head-scratching decisions have already been made.


----------



## awake

Here you go: https://www.amazon.com/ELEGOO-Project-Tutorial-Controller-Projects/dp/B01D8KOZF4/ 

No affiliation, and no experience with this product - this is simply the first link that popped up on Amazon when I searched for "Arduino starter kit" - there were many others, ranging upwards in price.

One nice thing with the Arduinos (and the Adafruit offerings as well) is that you can start experimenting with nothing more than just the board. You can write some simple routines to flash the onboard LEDs to get you started, and all you need is a USB connection to your computer. You can either download the Arduino IDE and run it on your computer (my preference) or run it in the cloud from their website.

But of course, the starter kit is attractive for including both documentation and peripherals and parts and instructions to walk you through using them. Not only may that help move you up the learning curve more quickly, but also it might save you from burning out a board. I won't say that *I* have ever done this, but I have a "friend" who tried to hook up a circuit to an Arduino, only to see the magic smoke depart. Ahem. Fortunately, Arduino boards tend to be inexpensive - probably less so at the moment, but at least a couple of years ago, I could pick up 5 Arduino Nano boards for $10. At that price, it's not too painful if an experiment goes awry ...


----------



## Vietti

Awake,

I just ordered one based on your description and what I read on the reviews.  I can barely send an email without my wife's help but I would like to know more about this stuff.  My ultimate goal is to assemble a small rotary table that is index able via the computer.  May post an update in the future but only if successful!


----------



## awake

If we can help, don't hesitate to ask. I'm not the brightest bulb in the chandelier (see reference to magic smoke above), but there are many here who clearly know what they are doing.


----------



## Lloyd-ss

Andy, 
Each of those "smoke" eruptions is just another learning experience, just like each "close call" in the shop makes us take shop-safety more seriously.

Vietti, 
When I first got into the Parallax Stamp micro over 10 years ago, I was totally clueless. But I worked with a bunch or really sharp people and was explaining to one of the EEs what I was trying to do at home. He said, no big deal, the Stamp will do what you need, I will help you get started. He'd give me some hints, and I'd experiment at home. I'd come to work with questions, he'd give me some more answers and suggestions, and before I knew it, it started making sense. I think those EEs had been sand-bagging all along, and making us mere mortals think that there was some sort of voodoo in what they were doing.   And the programmer weenies were even worse, with their secret lingo like proffy bus and interrupts and clock speeds. Ha ha. Nope, mostly just common sense, with maybe a teeny-tiny bit of voodoo thrown in.
Lloyd


----------



## 74Sprint

Awake your right we are getting far too advanced for what is needed here so I'll restrict that stuff to PM's. The Arduino UNO is perfect for what is needed here I think. It has enough speed and resources for Eccentric to complete his task.

I come from a RADAR tech back ground working on the secrete stuff down to the component level. Because all my computer skills were limited to mostly the binary level I had to learn how to program in binary. No languages just streams of 1's & 0's. It would take an hour of programming with 16 switches (no keyboards) just to have the computer say "Hello World" on a green screen. Working on my own I started using Commodore computers and CBM basic. I advanced my skills in time to what was my favorite 'Microchip' and using C & C++. 

Lloyd-ss and Vietti, when I started to use Arduino I had a hard time not because it was hard but, because it was too easy to use. I kept saying to myself it can't be this easy I must be missing something. But if anyone asked me what is the easiest way to get into micro-controller or micro-processor programming then it is definitely Arduino. As Awake pointed out the starter kit is the best way to go and the people on the Arduino forum are very helpful and patient, well at least most of them. They won't write your code but, will give lots of examples. Nice thing about Arduino is that it can take the "C" language along with it's complexities when your ready such as programming internal resources. The Arduino IDE comes with a serial monitor so you can do serial writes to the screen and see what your code is doing for debugging. The Arduino IDE also when setup will write the code for you to get started, "fluff". The biggest thing I find with people starting out and writing functions is to put those functions in the right order. I even have to draw things out sometimes to make heads or tails of it.

Enjoy
Ray


----------



## Lloyd-ss

74Sprint said:


> Lloyd-ss and Vietti, when I started to use Arduino I had a hard time not because it was hard but, because it was too easy to use. I kept saying to myself it can't be this easy I must be missing something. But if anyone asked me what is the easiest way to get into micro-controller or micro-processor programming then it is definitely Arduino.


Ok gents, it got complicated right away, LOL.
There are so many choices of the Arduino platform, with the Nano, Uno, UnoR3, Mega, etc. And the price differential isn't that much, when you consider the total cost of a project.  When I used the stamp years ago, I started with a low end one, thinking it would be adequate. But as the project grew, I ran out of I/O, and would have loved to had some built in A-D convertors, etc, etc. I ended up switching to the version with the max I/O, and that took care of most of the issues.  
So, which one do I choose? I don't anticipate needing any wifi, but who knows? and the idea of being able to integrate lots of sensors sounds like a ton of fun. The IDE sounds very good and I think I'd like to go that route for programming. I don't mind the Arduino having more capability than I need, but I want to stay in the hobbyist realm because I am not going to be doing anything super sophisticated. And I don't want any model that will soon be superseded. Once I get over this hump, I can be on my way.
Which model(s) do you think? Thanks! Lloyd


----------



## willray

Lloyd-ss said:


> Ok gents, it got complicated right away, LOL.
> There are so many choices of the Arduino platform...
> So, which one do I choose? I don't anticipate needing any wifi, but who knows? and the idea of being able to integrate lots of sensors sounds like a ton of fun.



Buy absolutely anything - a crap Nano for $6 will get you started:

Aliexpress Nano

Make its LED blink, experiment with the language, figure out how to make its I/O read input and talk to the world, then worry about which one is right for whatever project you want to work on.  At the prices of Arduinos, you'll spend more on coffee while trying to figure out the "right one", than you will on just buying a board and doing it.

For your purpose, the only real differences between Arduino(compatible) platforms, are the processor speed, available memory, and available I/O pins and functionality.

Practically anything else the might be included on some Arduino variant, can be added to any other variant by wiring up a secondary board with the peripheral (pretty much all of the "added features" that are available on-board some Arduino variants, are integrated identically to if they were an external board wired in to, for example, the SPI bus).



> The IDE sounds very good and I think I'd like to go that route for programming.



Frankly, the IDE is awful.  It's somewhat less featureful than IDEs for "real" programming languages from the early 1980s.   Think of it as a primitive text-editor with a button to compile the contents.  It does, in general, get the job done, and it's better than the alternative.



> I don't mind the Arduino having more capability than I need, but I want to stay in the hobbyist realm because I am not going to be doing anything super sophisticated. And I don't want any model that will soon be superseded.



Unless you work at it, it's unlikely you'll escape the hobbyist realm with the Arduino.   There are "aimed at industrial deployment" Arduino platforms out there, but, you have to work rather hard to find them.

And I'm not aware of any Arduino platform that has been deprecated at this point.

Superseded - happens every day.  As an open platform, people are creating new versions with some new gee-gaw onboard weekly.  Many of them are gone again next week, but if you stick to anything that is an Arduino <X>, rather than "Bob's Arduino-compatible Chicken-Waterer", you'll still be able to buy a replacement next year, probably next decade.  And even if you do buy Bob's Arduino-compatible Chicken Waterer, even if Bob gives up on supporting the chicken-watering function, it's /still/ an Arduino-compatible board, and will continue to be an Arduino just like every other Arduino, so unless you buy into some specialty chicken-watering functionality, you're at no risk of being trapped down an implementation dead-end.


----------



## 74Sprint

Lloyd-ss said:


> Ok gents, it got complicated right away, LOL.
> There are so many choices of the Arduino platform, with the Nano, Uno, UnoR3, Mega, etc. And the price differential isn't that much, when you consider the total cost of a project.  When I used the stamp years ago, I started with a low end one, thinking it would be adequate. But as the project grew, I ran out of I/O, and would have loved to had some built in A-D convertors, etc, etc. I ended up switching to the version with the max I/O, and that took care of most of the issues.
> So, which one do I choose? I don't anticipate needing any wifi, but who knows? and the idea of being able to integrate lots of sensors sounds like a ton of fun. The IDE sounds very good and I think I'd like to go that route for programming. I don't mind the Arduino having more capability than I need, but I want to stay in the hobbyist realm because I am not going to be doing anything super sophisticated. And I don't want any model that will soon be superseded. Once I get over this hump, I can be on my way.
> Which model(s) do you think? Thanks! Lloyd


IMHO, For the first part, Parallax is still being made but, I have never gotten into them and don't know much about them. On the hobbyist side of things I would still go with Arduino because it was meant for the beginner/hobbyist in mind and it's about as close to the stamp as you can get, I think. It is very popular for that reason besides, it's a lot cheaper than Parallax. Next you have to be honest with yourself and get something with just a little bit more than you need for resources. 

As for which Arduino I would go with the UNO-R3 because it is more breadboard friendly. The Nano has just about the same number of I/O's and functionality. They both have A/D converters, programmable I/O's, 2/3 interrupts, and PWM also they are 5V tolerant and they have built-in voltage regulators. The Arduino world has exploded and is fast becoming an acceptable to industrial stuff. Parallax use to be the defacto uC around here but, schools have switched over to Arduino. Oh stay away from the Mega unless you need a ton of I/O's.

Yes the IDE is somewhat basic but, that's for taking care of the beginner/hobbyist. Like just about any tech stuff you need to crawl before you run and there is nothing that says you can't do more with the IDE. For example, I can use the Atmega programming sheets to do more advanced programming if I have too, the IDE can handle it. It's not as advanced as say TI's, Microchip, or STmicro's IDE's but, if you don't need those right now then the Arduino IDE is a good way to learn "C" & "C++" so you can move on. Would I use it for ASIC development 'no' but, I do use it for 'proof of concept' and port the code to say something like an ARM, TI, or Microchip processor. Also Atmega is owned by Microchip and Microchip's IDE can be used for both uC's if you need something more advanced.

Cheers
Ray


----------



## awake

willray said:


> Frankly, the IDE is awful.  It's somewhat less featureful than IDEs for "real" programming languages from the early 1980s.   Think of it as a primitive text-editor with a button to compile the contents.  It does, in general, get the job done, and it's better than the alternative.


On the IDE, I agree that the editing, debugging, etc. are very basic at best (though the new IDE 2.0, now in "release candidate" stage, is supposed to have some better features - ? I haven't experimented iwth it). What really makes the IDE super-useful, especially for the beginner, is the ease of adding in libraries. I would also add that, when you start, you will likely use the provided library functions that make it super-easy, e.g.,


		Code:
	

digitalWrite(13,HIGH); // set pin 13 high, turning on the on-board LED


If / as you gain more expertise, you may decide to speed things up by skipping these routines in favor of directly writing to the data port:


		Code:
	

PORTB = PORTB | B00100000; // set pin 13 high, turning on the on-board LED


And if you want to go even further, you can include inline assembly code (note that I haven't done this in a while, so no guarantees that I have the correct syntax!):


		Code:
	

asm ( "sbi PORTB, 5 \n" ); // set pin 13 high, turning on the on-board LED


All of this without leaving the basic Arduino IDE. Limited to hobbyists? Yes, probably ... but then, that's what I am, and yet as a hobbyist, I can make some pretty darn sophisticated embedded projects.


----------



## awake

Lloyd-ss said:


> Ok gents, it got complicated right away, LOL.
> There are so many choices of the Arduino platform, with the Nano, Uno, UnoR3, Mega, etc. And the price differential isn't that much, when you consider the total cost of a project.  When I used the stamp years ago, I started with a low end one, thinking it would be adequate. But as the project grew, I ran out of I/O, and would have loved to had some built in A-D convertors, etc, etc. I ended up switching to the version with the max I/O, and that took care of most of the issues.
> So, which one do I choose? I don't anticipate needing any wifi, but who knows? and the idea of being able to integrate lots of sensors sounds like a ton of fun. The IDE sounds very good and I think I'd like to go that route for programming. I don't mind the Arduino having more capability than I need, but I want to stay in the hobbyist realm because I am not going to be doing anything super sophisticated. And I don't want any model that will soon be superseded. Once I get over this hump, I can be on my way.
> Which model(s) do you think? Thanks! Lloyd





74Sprint said:


> IMHO, For the first part, Parallax is still being made but, I have never gotten into them and don't know much about them. On the hobbyist side of things I would still go with Arduino because it was meant for the beginner/hobbyist in mind and it's about as close to the stamp as you can get, I think. It is very popular for that reason besides, it's a lot cheaper than Parallax. Next you have to be honest with yourself and get something with just a little bit more than you need for resources.
> 
> As for which Arduino I would go with the UNO-R3 because it is more breadboard friendly. The Nano has just about the same number of I/O's and functionality. They both have A/D converters, programmable I/O's, 2/3 interrupts, and PWM also they are 5V tolerant and they have built-in voltage regulators. The Arduino world has exploded and is fast becoming an acceptable to industrial stuff. Parallax use to be the defacto uC around here but, schools have switched over to Arduino. Oh stay away from the Mega unless you need a ton of I/O's.
> 
> Yes the IDE is somewhat basic but, that's for taking care of the beginner/hobbyist. Like just about any tech stuff you need to crawl before you run and there is nothing that says you can't do more with the IDE. For example, I can use the Atmega programming sheets to do more advanced programming if I have too, the IDE can handle it. It's not as advanced as say TI's, Microchip, or STmicro's IDE's but, if you don't need those right now then the Arduino IDE is a good way to learn "C" & "C++" so you can move on. Would I use it for ASIC development 'no' but, I do use it for 'proof of concept' and port the code to say something like an ARM, TI, or Microchip processor. Also Atmega is owned by Microchip and Microchip's IDE can be used for both uC's if you need something more advanced.
> 
> Cheers
> Ray


To add a couple of things to Ray's excellent post ... I've attached the first page of an Atmel datasheet that covers the ATmega328 chips used on the Uno and Nano. As I recall, the Uno and Nano have 2K of RAM, 32K of program flash memory, and 1K of EEPROM for non-volatile storage. As usual, the various peripheral features shown on the datasheet are generally overlapping - in other words, you have up to 23 digital i/o pins, but 2 of those are used for the serial interface to the USB port, 2 are used for a clock crystal / oscillator (these two are not exposed on the Arduinos), 1 doubles as the RESET pin, 6 can be used either as digital i/o or as analog inputs, and so on. I've attached a pinout diagram that shows all of the pins made available on a Nano, with all of the different functions that each pin can perform. Note that the UNO has essentially all of the same pins EXCEPT for A6 and A7.

Ray mentioned 2/3 interrupts ... it is actually a bit more than that. There are quite a few internal interrupts generated from a variety of the peripherals; for example, you can generate an interrupt when a timer overflows or counts down to zero. Meanwhile, 2 of the digital i/o pins can be designated as external interrupt pins (INT0 and INT1). But there is also another very interesting capability: all 23 of the digital i/o pins can also be set to generate "pin change interrupts," allowing you to generate an interrupt when the pin goes high, low, or toggles. In a sense, then, you actually can have up to 23 external interrupts; however, unlike INT0 and INT1, which each send the program to its own unique interrupt vector, the pin-change interrupts send the program to a shared vector. Your ISR has to check to see which pin generated the interrupt.

What if you need more i/o pins or more RAM and program space? The next step up is the ATmega2560 (Arduino Mega 2560). This chip / board has more than double the i/o pins, with correspondingly more analog channels, timers, etc. It also has 256K of program space, 8K of ram, and 4K of EEPROM. Note that it is not any faster, and does not provide any _different_ features than the 328-based Uno / Nano ... just more of the same capabilities.

All of the above are 8-bit boards, typically running at 16MHz. They will not set the world on fire as far as speed ... and yet they are surprisingly capable little controllers, and can do far more than many people think they can (especially when you move beyond the "easy mode," digitalWrite type of approach that i described in the previous post). But if you need more horsepower, you can step up to 32-bit based boards, both those from Arduino itself (or based on their design), or others such as the STM32 or ESP32 boards. These have Arduino board definitions and libraries available that let you program them just like the old 8-bit versions, though of course each board will have differing capabilities. Some will include Bluetooth and / or wifi. And most are made to accept or plug into add-on boards that provide various sensors, actuators, and so on.

Like Ray suggests, I would start with either a Uno or Nano (and being cheap, I'd probably get a clone - which I think is what is included in the starter kit that we discussed above). Again, surprisingly capable of a wide variety of tasks, up to and including 3-axis CNC. With some mastery of one of these, you will be well positioned to move up to something bigger / faster as needed.


----------



## Lloyd-ss

This has all been a tremendous help. Looking at the pin outs in the 2 attachments, I had no idea how much the capabilities have increased. I am looking forward to this.


----------



## 74Sprint

Just to add a bit, there are actually 3 sort of hard external interrupts, pins (2, 3, and 8). ISR INT0, INT1, and ICP1. ICP1 Pin 8 is different, it is a (Timer/Counter1 Input Capture Input) but, it is similar to the other programmable I/O's because pin 8 can also be programed as PCINT0 (Pin Change Interrupt 0). If set as ICP1 you could use it to count inputs or as a timer to count clock ticks up or down. This is good if you want to say calculate RPM or do as Eccentric wants to do and say set the count to 6 and then have the code do any average of 6 RPM's. When pin 8 times out or captures an input it will trigger an interrupt, if it is programmed to do that.

For my programmable ignition I haven't decided yet if I'm going to use ICP1 or one of the other interrupts. We used a counter on the PIC12LF1840 between 2 trigger pulses to get the RPM but, I changed that to a timer measuring the pulse width, only used 1 trigger pulse. I did this so flipping a propeller was easier for starting. mind you there was a bit more calculations doing it my way, timer overflows mainly. I will be using 2 interrupts, 1 for the crank trigger and 1 for the cam trigger and I could use ICP1 for the RPM calculations. There are a bunch of options I could use. 

I also want to use a temperature sensor to adjust timing, cold engines suck. I will also be using a 4 line 20 character LCD display to tell me what is going on, RPM, temperature, timing degrees, and errors. For the temp sensor I will be using the Dallas DS18B20 because it does a self check to tell me if it has a problem and it is smallish and I can glue it to the engine somewhere. How's that for a $6 Nano!

Oh before I forget, the clone Arduino's usually use the older bootloader but, they can be flashed to the newer one using the 6 pin connector, I never seen much difference between the 2 and don't both with the update. I also want to say that Awake did an excellent job describing what a UNO or Nano can do.

Cheers
Ray


----------



## 74Sprint

Just some FYI.
Here is some code that I use to calculate the RPM using the Nano.

void getRPM()
  {   
    long count;
    unsigned long currentTime = 0;
    unsigned long startTime = millis();
    attachInterrupt(0,isr,RISING);   //assign INT0, when pulse is rising

    pulsewidth = pulseIn  (2, HIGH);  //use pin 2, count ONLY while pin is high
    Serial.print("pulsewidth = ");   // print to the serial monitor
    Serial.println(pulsewidth);

    while (currentTime <= sampleTime)
      {
        currentTime = millis() - startTime;
      }

    detachInterrupt(0);   //detaches the interrupt while calculating

    count = (long(rev) * 60);
    rpm = int(count/NumPulse);
    if(rpm >= 9999)
    {
      rpm = 9999;
    }
    rev=0;
    return;
  }


----------



## Lloyd-ss

74Sprint said:


> Just some FYI.
> Here is some code that I use to calculate the RPM using the Nano.
> 
> void getRPM()
> {
> long count;
> unsigned long currentTime = 0;
> unsigned long startTime = millis();
> attachInterrupt(0,isr,RISING);   //assign INT0, when pulse is rising
> 
> pulsewidth = pulseIn  (2, HIGH);  //use pin 2, count ONLY while pin is high
> Serial.print("pulsewidth = ");   // print to the serial monitor
> Serial.println(pulsewidth);
> 
> while (currentTime <= sampleTime)
> {
> currentTime = millis() - startTime;
> }
> 
> detachInterrupt(0);   //detaches the interrupt while calculating
> 
> count = (long(rev) * 60);
> rpm = int(count/NumPulse);
> if(rpm >= 9999)
> {
> rpm = 9999;
> }
> rev=0;
> return;
> }


Thanks Ray, for this example. Even though I couldn't write it (yet), I can pretty much follow it. That is encouraging.
Lloyd


----------



## 74Sprint

Just so I don't confuse to many people, this isn't all the code necessary to make the ignition work. This shows a bit more of what is needed though and is only meant as an illustration.
Anything following the // is a comment.
The code below is setup for wasted spark or a 2 stroke engine and has not been optimized yet, so there is some redundant code. Also for the loop I took out stuff for the LCD, timing degrees lookup, and the serial-print to serial monitor.

//Declarations:

  int NumPulse = 0;
  int RPMin = 2; // RPM interrupt signal in (pin 2)

// RPM stuff
const byte ledPin = 13;  // shows the trigger in using the onboard LED
const byte interruptPin2 = 2;  // make sure pin 2 is set to interrupt INT0.
volatile byte state = LOW;
float value=0;
int rev=0;
int rpm;
int oldtime=0;
int time;
float pulsewidth = 0; // value of the pulse width (time not clocks)
const unsigned long sampleTime = 999; // the amount of time I allow for sampling.

void isr()     //interrupt service routine
  {
    rev++; // increment the RPM count by 1.
    state = !state;
    digitalWrite(ledPin, state);  // this will change the state of the LED. If it's on then turn off, if off then turn on.
  }

void setup() 
{
  // put your setup code here, to run once:
  pinMode(RPMin, INPUT);    // sets the digital pin 2 as input

// RPM stuff
    pinMode(ledPin, OUTPUT); // use the LED pin 13 as an output.
    pinMode(interruptPin2, INPUT);  //rpm pulse in
    attachInterrupt(digitalPinToInterrupt(interruptPin2), blink, RISING);   // enables the interrupt.
}

void loop() 
{
// put your main code here, to run repeatedly:
  getRPM();  // shown in previous post.
}

This is just an insight to what is possible and needed, it is not the only way to calculate RPM but this is good to 9,999 RPM, maybe more. I still have to straighten out the Arduino code and make a program (in C#) for the PC to modify the EEPROM stored values for timing lookup. I'll most likely only use a 2D graph or table as there is no MAP or Throttle position sensor being used. My code will only replicate a mechanical advance.

Cheers
Ray


----------



## Lloyd-ss

willray said:


> but if you stick to anything that is an Arduino <X>, rather than "Bob's Arduino-compatible Chicken-Waterer", you'll still be able to buy a replacement next year,


Come on now, don't go talking bad about my chicken projects. It was something far more sophisticated than a simple "Chicken Waterer".  It was a "Solar Synchronized Chicken Coop Door Opener". It had to be sophisticated to make up for the deficiencies in the tiny chicken brains. The door had to be coordinated with the seasonal variations in solar sunrise and sunset. The clocks in chickens are embedded, and cannot be re-programmed. Dusk to dawn timers won't work either, and the chickens will either get trapped inside or outside, and always on the wrong side. And several safety interlocks are necessary so that no chickens get mashed in the operating door. In the end, I don't think the chickens cared one way or the other.


----------



## Lloyd-ss

74Sprint said:


> ust so I don't confuse to many people, this isn't all the code necessary to make the ignition work. This shows a bit more of what is needed though and is only meant as an illustration.
> Anything following the // is a comment.


Yup, Understood. And, ample comments are a very good thing.


----------



## willray

74Sprint said:


> ...We used a counter on the PIC12LF1840 between 2 trigger pulses to get the RPM but, I changed that to a timer measuring the pulse width, only used 1 trigger pulse...



I'm curious -- how wide (crank degrees) is your pulse?  I would have thought that you'd need a pulse that subtends quite a large fraction of one rotation to push the inevitable vibration-induced jitter down into the single-degrees-of-rotation range?


----------



## willray

Lloyd-ss said:


> Come on now, don't go talking bad about my chicken projects. It was something far more sophisticated than a simple "Chicken Waterer".  It was a "Solar Synchronized Chicken Coop Door Opener"...



The private joke there, was that we're also headed towards trying to appropriately instrument and automate our chicken coop, so an Arduino with appropriate chicken-specific functionality would be pretty cool from my point of view.  I've thought about trying to RFID them so that the coop can keep track of who's in and who's out, but I haven't yet come up with any failsafe scheme that's less error-prone than sending the teenager up the hill to check the coop, so for the time being, he's the automation system.


----------



## Lloyd-ss

There is a ton of smart phone compatible cheap home automation stuff available. Our chickens are pretty reliable about going in at night. I found a couple of regular wall switches that are a variation on a timer controlled wall switch. The switch is programmable, and you set the latitude and date and time, and from there it knows the sunrise and sunset time throughout the year.  Pretty slick, really, and it takes care of a lot of the work.  Then all you have to do is put in a plus or minus time offset for the morning and evening and hook up a lead screw with some limit switches to it. The switch I chose is powered by the AC going to it, and the memory for the time and programming is non-volatile, so power outages are not an issue.  There are also battery powered versions that would be compatible with a 12 vdc remote system. I found them on Amazon several years ago and its still working.


----------



## 74Sprint

willray said:


> I'm curious -- how wide (crank degrees) is your pulse?  I would have thought that you'd need a pulse that subtends quite a large fraction of one rotation to push the inevitable vibration-induced jitter down into the single-degrees-of-rotation range?


The width of the pulse varies with speed which, is why one has to do a calibration first. When one compares the timing of events of electronics and with mechanical events the mechanical is very, very slow. The pulse width also varies with the magnet's strength, the sensitivity of the Hall-Effect, and the distance between them. The timing position of the leading edge never changes, just the trailing edge changes with speed, hence pulse width. With testing we had pulse widths down to 0.01 degree at 500 RPM and 0.1 at 10,000 RPM. 

To be honest we never really cared much about jitter because it was down to like 0.001 of a degree. Sure if your Hall-Effect is wobbling around enough that you could see it moving then things of course would be much different. Like I said mechanically the engine is actually quite slow in movements. A good example of this is the engine management computer on todays engines which can detect a single miss-fire at 7,000 RPM or more on a narrow band O2 sensor. Going back to 2012 I can't remember exact numbers for the pulse width but, I know it was from about 250 usec. to 1 msec. depending on the setup and RPM.

One way to get around starting is to measure the speed of the crank and use a locked in advance until around 200 RPM. Car manufacturers use between 200 and 450 RPM, some go higher. I can measure the speed of the crank using either 1 or 2 pulses, use/convert that to time, and divide 360 degrees by the time, and I will know approximately how much hold off time I need for ignition timing. I hope that makes sense. It is easier to use the time between 2 leading edges than pulse width. It is also easier to adjust the pickup to get the correct timing than having to do the math especially if your using a starter motor. Most of todays engines will not put out a spark or inject fuel until it sees both a crank and cam trigger. On some racing EMS systems like Fueltech's, it stops looking for the cam sensor once it gets both triggers timed. Which makes sense because once you know where number one is you don't need a cam trigger any more, this saves computer power at higher RPMs.

I think I did some babbling, sorry.
Ray


----------



## 74Sprint

Lloyd-ss said:


> There is a ton of smart phone compatible cheap home automation stuff available. Our chickens are pretty reliable about going in at night. I found a couple of regular wall switches that are a variation on a timer controlled wall switch. The switch is programmable, and you set the latitude and date and time, and from there it knows the sunrise and sunset time throughout the year.  Pretty slick, really, and it takes care of a lot of the work.  Then all you have to do is put in a plus or minus time offset for the morning and evening and hook up a lead screw with some limit switches to it. The switch I chose is powered by the AC going to it, and the memory for the time and programming is non-volatile, so power outages are not an issue.  There are also battery powered versions that would be compatible with a 12 vdc remote system. I found them on Amazon several years ago and its still working.


Hey Lloyd how about using a IR sensor so you don't barn door slam a chicken.

Ray


----------



## willray

74Sprint said:


> The width of the pulse varies with speed which, is why one has to do a calibration first. When one compares the timing of events of electronics and with mechanical events the mechanical is very, very slow. The pulse width also varies with the magnet's strength, the sensitivity of the Hall-Effect, and the distance between them. The timing position of the leading edge never changes, just the trailing edge changes with speed, hence pulse width. With testing we had pulse widths down to 0.01 degree at 500 RPM and 0.1 at 10,000 RPM.
> 
> To be honest we never really cared much about jitter because it was down to like 0.001 of a degree. Sure if your Hall-Effect is wobbling around enough that you could see it moving then things of course would be much different. Like I said mechanically the engine is actually quite slow in movements.



I remain surprised that works.  Of course, the processor is much faster than the mechanical bits, but even at 0.001 degree jitter (which astonishes me that you can get it that small - I'd have expected just simple slop in the crank bearings to contribute more variability than that!), that's still 10% of your (500RPM) pulse width.  It doesn't matter how fast the processor can calculate/time things, if the RPM estimate is wrong, it seems like that'd play havoc with calculating the right value for the delay between seeing the pulse and firing the plug.

Unless I'm completely misthinking something, a 10% error in the pulse width produces a 10% error in the RPM estimate.  And a 10% error in the RPM estimate should produce a 10% error in your delay-until-firing calculation.  That could be 36 degrees...

Ah, but wait wait wait -- you're not predicting a delay for an almost complete revolution, your pulse occurs somewhere "close to but before" the earliest possible firing advance, so somewhere maybe 45deg BTDC?  10% error in that's 4.5 degrees, but maybe that's not critical?


----------



## Lloyd-ss

willray said:


> Ah, but wait wait wait -- you're not predicting a delay for an almost complete revolution, your pulse occurs somewhere "close to but before" the earliest possible firing advance, so somewhere maybe 45deg BTDC? 10% error in that's 4.5 degrees, but maybe that's not critical?


Very interesting thought. Those changes within the program, even if you are doing some sort of reliable forward-predicting, can be a real bug-a-boo to solve. But as you say, how critical is it?
I remember as a teen ager watching the timing mark on the car flywheel bouncing all around under the timing light, as the advance weights twisted everything around. But the relative BTDC at various rpms was repeatable enough that I never had to spring for a big dollar distributor. There is a big distance between "it works", and "it works perfectly," and somewhere in there, the pragmatist has to say, "it works well enough."  It goes along with the old saying, "It's time to shoot the engineers and get on with production." But I totally understand the obsession. It is our nature/curse. 
Lloyd


----------



## 74Sprint

willray said:


> I remain surprised that works.  Of course, the processor is much faster than the mechanical bits, but even at 0.001 degree jitter (which astonishes me that you can get it that small - I'd have expected just simple slop in the crank bearings to contribute more variability than that!), that's still 10% of your (500RPM) pulse width.  It doesn't matter how fast the processor can calculate/time things, if the RPM estimate is wrong, it seems like that'd play havoc with calculating the right value for the delay between seeing the pulse and firing the plug.
> 
> Unless I'm completely misthinking something, a 10% error in the pulse width produces a 10% error in the RPM estimate.  And a 10% error in the RPM estimate should produce a 10% error in your delay-until-firing calculation.  That could be 36 degrees...
> 
> Ah, but wait wait wait -- you're not predicting a delay for an almost complete revolution, your pulse occurs somewhere "close to but before" the earliest possible firing advance, so somewhere maybe 45deg BTDC?  10% error in that's 4.5 degrees, but maybe that's not critical?


Your right, I should have mentioned that crank fore and aft play (crank walk) does play a role. Some of the guys complained about this on the cheap China engines and they changed the code do like Eccentric has mentioned and did an averaging of the pulse timing. On the better built engines this wasn't a problem much once the engine got above 500 RPM. I now with the after market race car ignitions with a crank pickup if the sensor is too far away from the crank magnets then crank walk can show jitter at low RPM <2,000. Another problem with those is crank flex and detonation which shows up at higher RPM and load. With crank walk there is also less jitter depending on how the magnet and Hall are positioned. For example if the magnet is placed near the end of say the flywheel and is placed with the south pole pointing outward so it's on the edge of the flywheel instead of on the face with south pointing to the front or back of the engine, then there is less jitter and crank walk it not much of a factor. Unless crank walk is really bad, in which case it means something is really wrong with that engine. Almost everyone drilled a hole/pocket in the flywheel so the south pole was pointing out. 

As far as the error is concerned what's the real difference between 500 and 550 to an engine, not much. If we're talking about a hit-n-miss, one can adjust the distance and orientation of the magnet/Hall to manage error or change either the magnet or Hall-Effect. We also found by adjusting the pullup resistor value helped with error a lot along with using a Hall-effect that wasn't to sensitive. The most error I saw was <= 5 degrees on the cheap China engines and it wasn't constant. You are kind of right in your later thinking because most of the time the pickup signal was usually around 45deg BTDC which, had to be entered into the software program. It needed to know where in degrees the pickup was. The more advance timing you need the more the pickup has to be away from BTDC. 

Also (starting engine) 200 RPM x 360deg = 72,000 deg. per minute,  72,000 / 60 = 1,200 degrees per second, 1,200 X 1msec = 1.2 degrees, or 10% ERROR 1,200 X .9msec = 1.08 degrees, 1,200 X 1.1msec = 1.32 degrees. The amount of error can be corrected with testing it's a trial & error thingy.

One of the biggest problems to get rid of was the noise from the ignition spark. Things like the negative spike from the ignition coil caused anything from a second spark to burning up parts. Also because it was a CDI ignition we had to use 'snubbers' on the capacitor charging circuit (primary side of Txfrm). 

Why do I feel like I highjacked this thread? sorry.

Cheers
Ray


----------



## 74Sprint

Lloyd-ss said:


> Very interesting thought. Those changes within the program, even if you are doing some sort of reliable forward-predicting, can be a real bug-a-boo to solve. But as you say, how critical is it?
> I remember as a teen ager watching the timing mark on the car flywheel bouncing all around under the timing light, as the advance weights twisted everything around. But the relative BTDC at various rpms was repeatable enough that I never had to spring for a big dollar distributor. There is a big distance between "it works", and "it works perfectly," and somewhere in there, the pragmatist has to say, "it works well enough."  It goes along with the old saying, "It's time to shoot the engineers and get on with production." But I totally understand the obsession. It is our nature/curse.
> Lloyd


Oh I hate it when the timing bounces around like that. I find it is usually related to worn out timing gears or the cam & distributor gear are worn out. Like the Chevy 4.3L V6, they are bad for wearing out early (razor thin teeth on the dizzy gear).

Ray


----------



## willray

74Sprint said:


> Also (starting engine) 200 RPM x 360deg = 72,000 deg. per minute, 72,000 / 60 = 1,200 degrees per second, 1,200 X 1msec = 1.2 degrees, or 10% ERROR 1,200 X .9msec = 1.08 degrees, 1,200 X 1.1msec = 1.32 degrees. The amount of error can be corrected with testing it's a trial & error thingy.



If I understand the error (in degrees) you stated a few messages back, the error is in the measurement of the width of the pulse, not in the the motion per msec.

A 10% Error in the measurement of the width of the pulse, unless I'm completely misthinking, will produce a linearly proportional error at any other width you use that measurement as a scale for:  So if you use a width measurement with +/10% jitter error to calculate how long you have to wait for the crank to rotate 45 degrees, it could really be rotating anywhere between 40.5 degrees and 49.5 degrees.  That's enough to move an intended 3deg ATDC starting timing, to firing 1.5deg BTDC (which could be spelled "ouch"), or to 7.5deg ATDC, which is probably OK.

Of course, all of that is entirely "on paper".  You've done it and it obviously works, so either I've gone sideways somewhere with the on-paper thinking, or some combination of practical reality works to make all of this a tempest in a teakettle!

Will


----------



## 74Sprint

willray said:


> If I understand the error (in degrees) you stated a few messages back, the error is in the measurement of the width of the pulse, not in the the motion per msec.
> 
> A 10% Error in the measurement of the width of the pulse, unless I'm completely misthinking, will produce a linearly proportional error at any other width you use that measurement as a scale for:  So if you use a width measurement with +/10% jitter error to calculate how long you have to wait for the crank to rotate 45 degrees, it could really be rotating anywhere between 40.5 degrees and 49.5 degrees.  That's enough to move an intended 3deg ATDC starting timing, to firing 1.5deg BTDC (which could be spelled "ouch"), or to 7.5deg ATDC, which is probably OK.
> 
> Of course, all of that is entirely "on paper".  You've done it and it obviously works, so either I've gone sideways somewhere with the on-paper thinking, or some combination of practical reality works to make all of this a tempest in a teakettle!
> 
> Will


I think your over thinking this. Everything is either based on measured time or clock counts. Clock counts are more accurate at 16Mhz. Unless you have severe vibration there is almost no jitter to speak of. All the R/C ignitions I have seen usually have less than 1 degree of jitter, depending on how it is mounted. As for the pulse width we are talking about nano seconds to micro seconds in possible jitter. As for the pulse width I WANT to see the pulse width shrink with RPM. The Hall-Effects I use are very accurate and repeatable in results. I'm going to be putting my degree wheel, made from an old DVD drive together with my grand-daughter right away. Using a 13,000 rpm DC motor and the degree wheel (Blank DVD) has 2 magnets, so Ill see how that goes and I'll try to simulate vibration. Wait for the movie hopefully later today. I hope to show the pulse width changing with RPM and that the leading edge point/degrees never changes. Ah crap I forgot, I have to make a new timing light, I borrowed parts off the old one. 

Ray


----------



## bluejets

bluejets said:


> Bit of free time so whipped up a mod circuit using PaulC idea but different bias arrangement and also dc block cap.
> If one needs to use a remote Hall effect 3144 type to reduce size of the pickup hall as apposed to the KY-003 module, one could simply remove it from the KY-003 module or use a descete part and add any indicators themselves.
> If using the module, it has all the necessary components on board except for the 0.1uF capacitor.
> Relay i used was a small 12v unit, details on the drawing but just about any small coil would suffice.
> This particular one was chosen due to coil resistance of around 700 ohm.
> I cut a small hole in the top of the case and filled it with epoxy, probably not necessary but did it all the same.
> My opinion would be that this type of coil would produce a better pulse due to it's inbuilt core whereas the reed coil has an air core.
> As best I could tell with my little DS150 scope, trigger pulse is around 8-10V.
> 
> View attachment 128785
> 
> 
> View attachment 128786



Currently preparing a JLCPCB board to cover this arrangement as there have been a few calls locally interested.
5 boards with approx. 15 panelized on each, so plenty and at that rate relatively "next to nothing cost per board".
Will advise when I have completed the arrangement.


----------



## paulc

bluejets said:


> Currently preparing a JLCPCB board to cover this arrangement as there have been a few calls locally interested.
> 5 boards with approx. 15 panelized on each, so plenty and at that rate relatively "next to nothing cost per board".
> Will advise when I have completed the arrangement.



Good one!  I like the original mini relay packaging,  neat!

All the bench tests I did here were impressive and I could stretch the spark about 1" and still push 18,000 spark per minute on the lathe.   So I thought what the heck for giggles lets hook it up to one side of our 9 cylinder radial's ignition which at WOT runs 3500 RPM x 4.5 sparks / rev =  15,750 sparks / min.  Now we do have compression in play now but the spark plug gap is no longer 1".  Anyway at high power and RPM  the engine would break down, which surprised me.  There is also the possibility of interference from the 18 spark plug leads in the local area and I was not sure if this could possibly be causing some false triggering,  although this does not happen on our stock Hall effect ignition (kettering) which used the same hall sensor. So I suggest the ignition has hit its limit.  I tried a variety of CDI coils, some worked better than others but all broke down at WOT.
There is also the factor that we run a distributor cap with carbon brush etc etc,  so even more work for the ignition.

But with all that aside this ignition would be great for a smaller single cylinder or lower cylinder count engine that did not push the sparks /min too high.

My gut tells me that CDI would work best for coil over plug, and so only use one tiny coil and CDI per cylinder and not ask one CDI and coil to do so much work?

All good stuff.


----------



## paulc

You could consider developing a board that packages the small coil and HT  lead all built in.  Then you just plug in the CDI and connect the Hall  lead and the spark plug lead to the engine.


----------



## bluejets

Ok...thanks for the review.
Multi cylinder or at least 9 cyclinder were not what I had in mind during the initial setups nor was it the original intention, however, good to see your ground work.
Most applications are for the average engine builder who would seldom ever go above a single running at maybe 4-5000 rpm at best.
I do intend a little further down the line to try it on my V8 design (still sitting in castings as yet) and even then, not difficult to do a 2 x black box design.
Mostly used for marine application and again, if it runs over 3 to 4000rpm I'd be very much surprised.
My little 25cc 4 cylinder in the Rivierra runs to 10,000rpm but glow and alcohol fuel but again, bench runs not practical use, more like maybe 4 to 5,000 as well.
Cheers Jorgo

No intent to do any coil, ht stuff.....this was an exercise in getting off-the-shelf cheapo stuff working.
Plenty of room for the original design, even with 2 black boxes...


----------



## giel

why not use a rcexel as a base?
  there ia a scematic on internet that can use 12 ignition leads controlled with Arduino nano. with easy adjustable dwell angle rev limiter and easy start mode, using only 1 hall sensor and a knocking sensor can be added.

i use it on a joined 2 cylinder zenoah g4k pushing 8.5hp at 17000rpm
can be used as only a controller with coil on plug system ( i use from bosch for honda they are not much bigger than the sparkplug head 
or with custom coils that are in the scematic.. if you're interested just let me know and i look it up..


----------



## bluejets

giel said:


> why not use a rcexel as a base?
> there ia a scematic on internet that can use 12 ignition leads controlled with Arduino nano. with easy adjustable dwell angle rev limiter and easy start mode, using only 1 hall sensor and a knocking sensor can be added.
> 
> i use it on a joined 2 cylinder zenoah g4k pushing 8.5hp at 17000rpm
> can be used as only a controller with coil on plug system ( i use from bosch for honda they are not much bigger than the sparkplug head
> or with custom coils that are in the scematic.. if you're interested just let me know and i look it up..



Just post the reference you have .....people will do with it what they like.
The more the merrier, someone might get some ideas from it. 
Cheers


----------



## bluejets

Submitted the board design to JLCPCB for review before payment and there were a couple of issues with the layout.
A bit new to this online pcb stuff so understandable I guess.

Long and short of it, cancelled that one layout and presented another for review and it was acceptable.
Panalized out at 2 columns x 4 rows x 5 panels so still cheap as at less than AUD$10.00 boards cost and a bit over $10 for postage (20days).
So around 50c a unit.


----------



## Stefan-K

[QUOTE="giel,
if you're interested just let me know and i look it up..
[/QUOTE]

Hi there 
I'm interested in this scematic. Where can i find it?


----------



## bluejets

giel said:


> why not use a rcexel as a base?



For starters they cost around $80 AUD.


----------



## paulc

giel said:


> why not use a rcexel as a base?
> there ia a scematic on internet that can use 12 ignition leads controlled with Arduino nano. with easy adjustable dwell angle rev limiter and easy start mode, using only 1 hall sensor and a knocking sensor can be added.
> 
> i use it on a joined 2 cylinder zenoah g4k pushing 8.5hp at 17000rpm
> can be used as only a controller with coil on plug system ( i use from bosch for honda they are not much bigger than the sparkplug head
> or with custom coils that are in the scematic.. if you're interested just let me know and i look it up..


Hi There, I'm interested in this.  Please send me any links or references you may have.


----------



## giel

Arduino Based CDI  single cylinder.. a few hours of reading..


Arduino Car Ignition System... the Carduino!.  

here is a car version.. but just google there is a lot to find on the topic!

and the rcxel code is also available on the i net but you will need to have a pic chip programmed by someone or buy a programmer (€5) 



			CDI Ignition
		


rcxel ignition 1 cylinder is 15€ and 5 cylinder is €50 now on ali expr 

one drawback on them is they do not have a programmable dwell angle and knock sensor.. on the Arduino versions there are versions with buttons to preset max rpm adjustable dwell angle 
there even is a 2 /4 stroke efi version with piezo injectors so you don't need a high pressure fuel pump ..


----------



## Stefan-K

Hi Giel
The Links to the Websites you Provided are already ancient. And so are the  ignitions. And most of the members here should already have seen them. Either they are way too big to fit in a Model engine or they simply dont have what has already been discussed here. Im interested in the RCexl ignition scematic and the Code for the Chip inside. Afaik there is none of IT to find on the i-net. If it were that easy.... just a Look at Google and youre done we would not need the discussion and all the work that the members Do here.


----------



## giel

use a arduino micro version?? need only 6/10 wires to the arduino i included a pic version of the rcexl cdi they analized the dwell angle from rcexl back in 2003 out of .y head if you want to have a 1:1 copy just buy one! at hobbyking they are €25 here in nl you can't build one for that money including hours.. 

before i wanted adjustable dwell angle i just used a coil on plug and a hall sensor.. and 3xlion. batteries...
adjust the hall sensor until you get the max rpm at your desired throttle setting..

costs €1 hall sensor and magnet and €2 for a coil on plug at the breakers weighs 50 grams with wires and batteries 100 grams and your ready..


----------



## Stefan-K

Really?? What a comment! "Go to Hobbyking and buy one"?  
I believe you didn't get me. 
It's not about just having or buying an ignition. But anyway, i stop talking about this now, knowing its another worthless comment. Nothing But warm air......


----------



## bluejets

giel said:


> Arduino Based CDI  single cylinder.. a few hours of reading..
> 
> 
> Arduino Car Ignition System... the Carduino!.
> 
> here is a car version.. but just google there is a lot to find on the topic!
> 
> and the rcxel code is also available on the i net but you will need to have a pic chip programmed by someone or buy a programmer (€5)
> 
> 
> 
> CDI Ignition
> 
> 
> 
> rcxel ignition 1 cylinder is 15€ and 5 cylinder is €50 now on ali expr
> 
> one drawback on them is they do not have a programmable dwell angle and knock sensor.. on the Arduino versions there are versions with buttons to preset max rpm adjustable dwell angle
> there even is a 2 /4 stroke efi version with piezo injectors so you don't need a high pressure fuel pump ..



Your link to "CDI Ignitions" is as old as, never worked properly and was the reason behind several more advanced attempts to rectify.
"Carduino" I never saw before but "instructables" have a reputation of failed or incomplete or untested systems.


----------



## bluejets

As a lead on from post #99, I received the newly designed interface boards and made a short video of the working cdi with mods similar to PualC.

Note I did not use his extra transistor or reed coil, instead I used a small relay direct on the hall signal open collector output.

Works well as can be seen.

I'll drop the files for the board in here later.



Cheers Jeff


----------



## awake

What is the life expectancy of the relay? I thought they couldn't cycle but so many times -- ??


----------



## bluejets

awake said:


> What is the life expectancy of the relay? I thought they couldn't cycle but so many times -- ??



It is using just the coil so life expectancy of a relay doesn't come into it


----------



## awake

bluejets said:


> It is using just the coil so life expectancy of a relay doesn't come into it


Ah, that's interesting. I had missed that.


----------



## bluejets

As #180, have added the EDA files here for anyone interested.
Also the final schematics for Hall Effect KY-003 module operation.

Have also included a version schematics for operation with everyday points if anyone so desires.
Note there is no requirement for the "points condensor" as in Kettering system.
Added one of these units to my old Atkinson engine yesterday and results are really good.

Might pay to note that I ran this points unit on 7.4v LiPo battery and it works fine even at that level.
Must remember though it's max rev requirements are probably 2000 rpm and would suit many old timer engines.

Forgot to add value of resistor for the timing LED in the points schematic....... 1k0 1/4w ...cheers


----------



## MarkySparky

Does anyone have the 12VDC CDI module drawn up with a BOM and gerber files and the like?  I want to make my own circuit board for an old hit and miss oil jack pump engine.  I cant tell you how long I have been looking for this!  Please advise.

Thanks in advance.

- Mark


----------



## bluejets

I have but it may be protected info.
Anyhow, you won't even start to build it for the price you can buy the complete system, coil and all.

Many have tried their own uC cdi's in the past with varying levels of success/failure, the latter more prominent.

74Sprint (Ray) I think is currently working on yet another approach, as yet unfinished as far as I know.
Details of that are in the forum here.


----------



## werowance

Lloyd-ss said:


> Come on now, don't go talking bad about my chicken projects. It was something far more sophisticated than a simple "Chicken Waterer".  It was a "Solar Synchronized Chicken Coop Door Opener". It had to be sophisticated to make up for the deficiencies in the tiny chicken brains. The door had to be coordinated with the seasonal variations in solar sunrise and sunset. The clocks in chickens are embedded, and cannot be re-programmed. Dusk to dawn timers won't work either, and the chickens will either get trapped inside or outside, and always on the wrong side. And several safety interlocks are necessary so that no chickens get mashed in the operating door. In the end, I don't think the chickens cared one way or the other.


Lloyd,  i just now was reading this thread and saw your post.  several years ago i was a member of the technology council in SW Virginia and there was mention of someone using technology for the chicken door opener.  if i recall the Gov. of Va at the time was even at that meeting.  i want to say it was Dutt and Wagner they were mentioning as the egg producer but i could have just assumed that since they are just down the road from me and where the meetings were always held.  just sounds like to much of a coincidence that this had to be you that they were talking about.  this had to be at least 10 years ago i guess but seems like yesterday.

i see your location is Charlottesville VA so maybe it was you.  but i do recall this being mentioned as a huge inovation and how technology and farming were coming together.


----------



## Lloyd-ss

werowance said:


> Lloyd,  i just now was reading this thread and saw your post.  several years ago i was a member of the technology council in SW Virginia and there was mention of someone using technology for the chicken door opener.  if i recall the Gov. of Va at the time was even at that meeting.  i want to say it was Dutt and Wagner they were mentioning as the egg producer but i could have just assumed that since they are just down the road from me and where the meetings were always held.  just sounds like to much of a coincidence that this had to be you that they were talking about.  this had to be at least 10 years ago i guess but seems like yesterday.
> 
> i see your location is Charlottesville VA so maybe it was you.  but i do recall this being mentioned as a huge inovation and how technology and farming were coming together.


Wow, small world. No, that wasn't me, although I went to VaTech and lived in Floyd County and know my way around that region. Beautiful country, but so is Charlottesville.

The automatic chicken door was just one of those compulsive projects that you put a stupid amount of hours into and it turns out good, but was it a sensible use of your time, LOL.  That door is still working with no repairs and no mashed chickens. It had remote LEDs that were visible from a window in the house to show if the door was open or closed or in operation. Fun stuff for sick minds.


----------



## Lloyd-ss

Deleted, sorry, wrong post.
Lloyd


----------



## 74Sprint

bluejets said:


> I have but it may be protected info.
> Anyhow, you won't even start to build it for the price you can buy the complete system, coil and all.
> 
> Many have tried their own uC cdi's in the past with varying levels of success/failure, the latter more prominent.
> 
> 74Sprint (Ray) I think is currently working on yet another approach, as yet unfinished as far as I know.
> Details of that are in the forum here.


I'm sorry guys that I haven't done much on the programmable ignition lately but the wife has laid down the law with me after I bought 2 snowmobiles. They weren't running but I worked a little magic on them and they fire now but, all the fuel lines need replacing and carbs need to be cleaned, real bad. Anyway I have been working on the yard and house and when that is done I'll finish the programmable ignition. Interesting, both sleds have AC-CDI ignitions with fixed timing and have very little adjustment . . . . for now. TTYL

Cheers
Ray


----------



## MarkySparky

bluejets said:


> I have but it may be protected info.
> Anyhow, you won't even start to build it for the price you can buy the complete system, coil and all.
> 
> Many have tried their own uC cdi's in the past with varying levels of success/failure, the latter more prominent.
> 
> 74Sprint (Ray) I think is currently working on yet another approach, as yet unfinished as far as I know.
> Details of that are in the forum here.


BLUEJETS

I am not trying to make this for $.  I am trying to get an old engine working again for my father's farm.  The CDI module I built only works from a plug-in transformer.  I want to just build one DC CDI.  I don't want to buy it.  I know it sounds stupid to everyone that reads this statement, but I just need to build it.  if you can help at all my email is [email protected]


----------



## 74Sprint

Just a bit of an update on what I have been doing. To start with I haven't given up on the programmable ignition, it's right in front of me but, I have been helping out a fellow member (Mark Hamilton) get a more reliable CDI ignition for his 120 year old (I believe) horizontal engine. At the same time I'm trying to work the bugs out of my Sparky-1 CDI ignition and Mark is helping with that by testing it.

When I designed the board and I wanted to try something out with the copper pours on the board. I never really measured the output of this little board and others told me "oh the spark isn't that strong", well they were way off and didn't know squat. Turns out the board is arcing out across 0.070" to the on board ignition coil at between 500-700 volts. I will have to redesign the board the right way. Bread boarded the primary voltage goes to 1,100 volts on 5 volt power supply. Right now using 12.5 volts power supply the current draw is only 0.034 amps! No that is not a typing error. This brings another problem, Mark is using 2 x12 volt truck batteries that are solar charged. The circuitry was never designed to use 12.5 volts, it was meant for 5 volts. So the power output is way to high, never thought I would say that.

I use a CC/CV power supply to limit the current, otherwise it tends to burn things up. We have been looking around to find a cheap current limiter and have tried a few things but, nothing we have tried so far works out. So I'm going to try and design a current limiting circuit I have seen before. If that works then I'll string everything together.





Your browser is not able to display this video.





One thing Mark had asked for which, keeps the ignition that he has now and to keep the engine in 1 piece is a RPM limiting cutout circuit. The cutout needs to trip at 500 RPM and remove power to the ignition and stay locked out. Getting something to stay running at 15Hz but trip at 16Hz was not easy (wasted spark).  So 450 RPM is ok but, 480 RPM is not. Anyway I ended up using a Frequency-to-Voltage chip (LM2907N-8/NOPB) that is used to make tachometers and it works beautifully and has adjustable trip limit. The chip will work with different signals but can be sensitive to different waveforms. I also found the datasheet and it's formulae to be out to lunch, most of the time. But if you want to make your own tach then this is the chip to use. For the cutout relay (latching) I'm using the standard automotive 30 amp 5 pin relay. You know the pin 30 and 87a stuff. Current draw on this circuit alone is 0.134 amps at 12 volts.

The image below shows the 16Hz (on) and the 2 LEDs show trip limit and cutout on. I don't have a momentary N/C switch in there, I just turn the power off to reset.






There are other ways to use this circuitry as a cheap rev limiter on almost any ignition. Next thing to do is the current limiting circuit and a new board design.

Cheers
Ray


----------

