What's a good way to read from an engine pickup coil, to an MCU? - Page 1
Forum section: electronics / projects

author: tinymini
author_rank: Contributor
timestamp: October 04, 2024, 01:42:18 pm
content: Hello everyone, I'm working on making my own motorcycle ignition controller, and am stuck with 1 problem:How do I read from the pickup coil?Here's a document demonstrating its basic principles:And here's a link of a design that I found:https://web.archive.org/web/20200801010554/sportdevices.com/ignition/ignition.htmAnd here are some scope shots from the original ignition controller:Ch. 1: pickup coil inputCh. 2&3: ignition coils outputCh. 4: tachometer outputIf measured when disconnected, the pickup input of the ignition controller has the following characteristics:1. one of the 2 inputs is connected to chassis ground (0V).2. the DC resistance is about 3k Ohms.Assuming that the AC impedance doesn't change much from DC resistance above, the energy that goes into the controller is:- ±8Vp-p @ 1,182 rpm (2.7mA)- ±30Vp-p @ 5890 rpm (10mA)--------------------------------------------------------------------------------------------------------------------------------------Given the above information, I need an analog to digital converter that:1. Can detectreliablyfrom as low as 500RPM (first ignition), up to 8500 RPM (red zone)2. Does not destroy itself with the range above3. Btw, the input is inductive, and really fast as high RPMs!4. Oh, I also need to detect both phases as different inputs (technically, I just need the rising edge while crossing 0V in the scope)So how do I achieve that?Following is a simulation of 2 designs that I've come up with, but only works until <=10kHz inputs (which given the edge @8500 RPM(140Hz) isn't enough)pickup_input.asc(4.65 kB - downloaded 41 times.)Does anyone have an indication of a circuit that can handle those inputs?An inductive current sensor that can detect <=1mA might be a logical choice, but I can't seem to find one (at least at a reasonable price).

author: moffy
author_rank: Super Contributor
timestamp: October 06, 2024, 11:30:56 pm
content: A suitably biased comparator with some hysteresis and input clamping, and AC coupled, is a possible candidate.

author: langwadt
author_rank: Super Contributor
timestamp: October 06, 2024, 11:52:27 pm
content: Quote from: moffy on October 06, 2024, 11:30:56 pmI know of one that has used a largish resistor into a HCT14 biased to ~1.2V for cranks sensors for many different carsthe resistor limits the current to a safe level with high voltage and ~1.2V is right in the middle between Vih/Vil so the signal only needs to be a few hundred mV

author: moffy
author_rank: Super Contributor
timestamp: October 07, 2024, 03:00:16 am
content: Quote from: langwadt on October 06, 2024, 11:52:27 pmIt's workable, I would still probably add a pair of schottky diodes for protection and a small cap for glitch suppression.P.S. Checking the datasheet for 5V supply, the positive going threshold is 2.1V which you would like to be above so that a no signal is always the same state.

author: SteveThackery
author_rank: Super Contributor
timestamp: October 07, 2024, 07:59:15 am
content: Quote from: tinymini on October 04, 2024, 01:42:18 pmJust a point: it depends on your bike, but 500rpm is almost certainly too high. You should be thinking around 300rpm as a more realistic cranking speed. Not many bikes crank at 500rpm.Alternatively you could measure the cranking speed yourself, which is the best approach as then you'll have that parameter nailed down.

author: langwadt
author_rank: Super Contributor
timestamp: October 07, 2024, 08:58:27 am
content: Quote from: moffy on October 07, 2024, 03:00:16 amHCT is ~1.6V positive going and ~1V negative going. The datasheet allows exceeding the max input voltage spec as long as the current into the ESD diodes are limited to +/-20mA

author: Psi
author_rank: Super Contributor
timestamp: October 07, 2024, 09:39:07 am
content: A reluctance sensor IC might work, like MAX9926.Not cheap IC though.but its automotive rated and designed to read pulses of AC with a wide voltage range and turn them into DC pulse ref to gnd.

author: langwadt
author_rank: Super Contributor
timestamp: October 07, 2024, 10:04:57 am
content: Quote from: Psi on October 07, 2024, 09:39:07 amor,https://www.lcsc.com/product-detail/ADCs-DACs-Special-Purpose_onsemi-NCV1124DR2G_C152274.html

author: moffy
author_rank: Super Contributor
timestamp: October 07, 2024, 10:07:19 am
content: Quote from: langwadt on October 07, 2024, 08:58:27 amThe datasheet I looked at:https://www.ti.com/lit/ds/symlink/sn74hct14.pdf?ts=1728271863777&ref_url=https%253A%252F%252Fwww.ti.com%252Fproduct%252FSN74HCT14page 5 mentions Vt+(Max) as 2.1V for 5.5V supply so about 2V for 5V supply. I also prefer external clamping because they are easier to replace and are more robust, just a personal preference.

author: squadchannel
author_rank: Frequent Contributor
timestamp: October 07, 2024, 10:43:09 am
content: Honda be like:

author: mikerj
author_rank: Super Contributor
timestamp: October 07, 2024, 03:02:14 pm
content: The LM1815 is the grandaddy of integrated VR amplifiers, still available and pretty easy to use but not very cheap.This threadmight be of interest, the OP has posted a schematic of a VR amplifier reverse engineered from a Siemens ECU which uses common, cheap comparators.

author: tinymini
author_rank: Contributor
timestamp: October 08, 2024, 12:56:53 pm
content: First of all, thank you all for your valuable inputs!I Sorry for the late reply, I wasn't at home for a few days.Quote from: moffy on October 07, 2024, 03:00:16 amNever thought of using low threshold schmitt triggers! 2.1V @5V VCC should be doable, but I'll have to look at the details. And yes - I'll add a TVS diode if I go this route.Quote from: SteveThackery on October 07, 2024, 07:59:15 amTrue, I'll have to re-measure the RPM when only cranking. Should be doable by unplugging the igniter or spark plug cables.Quote from: langwadt on October 07, 2024, 10:04:57 amYou, sir (@Psi) saved my day! "reluctance sensor" was the keyword I was missing! I knew someone should've made an IC for this purpose!I'll have to dig further, but judging by cost alone onsemi's NCV1124 should be the one I pick, if I go this route.Quote from: squadchannel on October 07, 2024, 10:43:09 amYup, that'll be one of the simplest circuits. Though I didn't knew transistors with Vce>=50V existed! Heck, I like this design - it's simple and elegant.The sole problem is that I don't have accurate values on the input's characteristics, so fiddling with those RC values might require a lot of fiddling.Quote from: mikerj on October 07, 2024, 03:02:14 pmThat thread is very much worth a read, thanks!------------------------------------------------------------------------------------------------------------------------------------------------2 new information from me:1. If I lower the current limiting resistor to 500Ohms, and the pullups to 10k Ohms, my 2nd design seems to work at 100kHz.Though since a inductor is a current generating device, I don't think lowering the resistance to 1/6 is a good idea.(Yes, I know that this peaks at around <3.7V, but since the MCU's input pin protection diode's Vf≒0.5~0.6V, it should be fine)2. I got a schematic of OSR-CDI, an open-source CDI made for 2 stroke bikes. They used a photocoupler for input, and that model (TLP785) supports up to 1A @<100us!This is some insane rating for a photocoupler, and they're dirt cheap. I might just go this route.circuit-diagram-v152.pdf(115.04 kB - downloaded 38 times.)

author: tinymini
author_rank: Contributor
timestamp: October 11, 2024, 09:04:15 am
content: After cleaning up (and potentially damaging) an original board, I found out that the original design just uses a zener. So looks like this works good enough.