Knock sensor | The Z Club of Great Britain
  1. The Z Club relies on the support of it's paid members - join the club or renew your membership here.

Knock sensor

Discussion in 'General discussion' started by jonbills, Jun 15, 2017.

  1. jonbills

    jonbills
    ZClub Administrator
    Staff Member Committee Member

    I've started building a knock sensor, mainly for fun, but inspired by wanting to know if my engine is pinking or worse.
    It's based on an Arduino uno kit with a Hyundai Accent knock sensor.
    So far, if progressively lights 3 LEDs, depending on force of the 'knock'.
    https://youtu.be/L48oXoT2nMo

    Next step is to add a potentiometer so I can dynamically change the force thresholds that it lights the LEDs at and then attach it to the engine and see what happens with it running.

    How many on here are have done Arduino projects? Any Z related?
     
  2. Paul_S

    Paul_S
    Z Club Member

    Very cool!

    I'm playing with the 370Z stereo steering wheel controls changing tracks, play/pause, etc. on my tablet. That's using a Teensy.
     
  3. jonbills

    jonbills
    ZClub Administrator
    Staff Member Committee Member



    I hadn't heard of Teensy - are you using an ARM one? What made you choose it over Arduino etc?
     
  4. Paul_S

    Paul_S
    Z Club Member

    It's not ARM (I think!) It's based on Arduiono but is much smaller and can emulate keyboards, mice, joysticks, serial, etc. out of the box.

    It's a neat little thing that is very easy to hide away in the dash.

    I got one to play with a long time ago and invented this use for it!


    Edit: I just checked, it is ARM. I'd obviously forgotten that!
     
    Last edited by a moderator: Jun 15, 2017
  5. Russell

    Russell
    Z Club Member

    Love an Arduino!

    I'm using a small colour screen that will hide in one of the switch blanks and connect to all the error sources on the 1JZ ECU so that I will be able to see Engine light, Oil Pressure, Oil Level etc. etc. in the correct pictoral format as you would on a modern car.
     
  6. jonbills

    jonbills
    ZClub Administrator
    Staff Member Committee Member



    That sounds smart - does it cycle round the those things or show them all at the same time? How's it talking to the ecu? Is it obd?
     
  7. Paul_S

    Paul_S
    Z Club Member

    Nice!
     
  8. Russell

    Russell
    Z Club Member



    It really got cracking with it yet, just thinking about the code which is simple.

    The screen has an sd card which can display picture files stored on it.

    The ECU has a separate wire for each "error", each of which is an earth.

    The Arduino detects a pin being pulled to earth and displays the relevant error by displaying the appropriate picture file.

    Will probably set it to cycle if multiple pins are earthed at once.

    It will either be off or display Z logo of some form when no errors are reported.

    An led in front of me will light when any errors occur which will make me look at the screen for the issue.

    I could go nuts and add engine temp, fuel level and other things but no point making it more complicated than it has to be.

    The stereo has a clock, boost gauge will go where the clock is, boost controller by my knees, still deciding on whether to go for a round wideband afr or a digital one but everything else I would need to know will already be displayed somewhere and as subtle as possible so sitting in the drivers seat doesn't give away what's under the Bonnet until the key is turned.



    Sent from my iPhone using Tapatalk
     
  9. jonbills

    jonbills
    ZClub Administrator
    Staff Member Committee Member

    That sounds doable - I was imagining some heavy obd or canbus stuff. That would be scary from scratch.

    I guess once you've got it in the car you can keep adding functions.
    I'm already imagining I could perhaps use it to get replace my add on AFR and oil temp gauges.
     
  10. Russell

    Russell
    Z Club Member

    Na, keep it simple I say.

    Would love to see how to integrate a Wideband into it and not need another screen. My issue is that it would have to work perfectly all the time!
     
  11. jonbills

    jonbills
    ZClub Administrator
    Staff Member Committee Member

    My knock sensor is now in test!
    https://youtu.be/QDOppYRy9DA

    There's a potentiometer to adjust the knock detection thresholds and 3 leds to show progressively how strong any knock is.

    Test procedure I've come up with is to set the threshold just above the noise level from the engine running unloaded in the garage with definitely no knock.

    So far no knock reported at any engine speed, with and without vacuum advance.
    Next step, advance the ignition so it will knock to see if it detects it.
    [​IMG]
     
    Last edited by a moderator: Sep 9, 2017
  12. jonbills

    jonbills
    ZClub Administrator
    Staff Member Committee Member

    Surprisingly, that worked first time!
    I set all-in spark timing to 40 and my knock sensor detects knock at about 3500 rpm.

    I think I'll do an engine management system next :)
     
    Last edited by a moderator: Sep 10, 2017
  13. AliK

    AliK
    Z Club Committee
    Committee Member

    So JB, I've been thinking about this - do you have details of what you did / bought to build this up?

    Tempted to build the wiring into the loom I'm going to re-wrap and hide the LEDs in the glove compartment (at the top with a "hinge-out" action so everything looks stock until needed).

    Also, forgive me if I didn't read the thread properly, where on the engine did you place the sensor?

    Even if I don't do it right now, it will be good to have the wiring in, in preparation.
     
  14. jonbills

    jonbills
    ZClub Administrator
    Staff Member Committee Member

    Ah. Um. It doesn’t actually work, my confirmation bias fooled me and for some reason I failed to mention it here
    I shelved it when I repurposed the hardware to be a throttle position display (which really did work).
    I was thinking about it last week and think my logic was prob too naive, just considering amplitude of sound rather than filtering for knock frequencies.
    When I was thinking I also looked up some commercial standalone offerings and there do seem to be a couple in affordable range (<300).
    The sensor they all use I think is the Bosch donut type 0261231006.
     
    AliK likes this.
  15. AliK

    AliK
    Z Club Committee
    Committee Member

    I did think it was a little too easy ;)

    But then again, I had assumed the sensor itself had a built in filter. I started to design my own on paper using an op-amp and some Darlington pair transistors to protect the circuit but then thought your solution was less hassle / more flexible. I'm still convinced this is doable your way with an adjustable filter, just needs fiddling time!

    Good for you for repurposing - so why is the throttle position important to you on a carb fed engine? Is that a dumb Q to ask?
     
  16. jonbills

    jonbills
    ZClub Administrator
    Staff Member Committee Member

    The throttle position thing is/was to know where the throttle plate was in relation to the progression holes, when it stumbled opening the throttle a little more e.g. when you get a bit of incline on the motorway.
    Turns out the stumble was between 2nd and 3rd holes.
    Here it is - the horizontal bar at the bottom is how open the throttle is, and the 6 vertical lines above it are the begin and end positions of the three progression holes. Quite a gap from hole 2 to 3. So the throttle has in this pic uncovered half the first progression hole.
    [​IMG]
    This is why people advise small chokes on road cars - the bigger the chokes, the smaller throttle movemement you need to add a little more air, which effectively stretches the gaps between progession holes. Compounded by the fact that the slower moving air means the main jet starts later.
     
    Last edited: Apr 30, 2018
    AliK likes this.
  17. johnymd

    johnymd
    Z Club Member

    I’ve been watching this thread with great interest and I’m still hopeful you will get a system working. Are you saying that you need to filter out general engine noise so the peaks you see are only knock? I would imagine this is very difficult. The sensor will only pickup in the 3-25khz range so will this not be sufficient?

    When I look at my ecu knock sensor traces you can clearly see all the general engine noise. You the Set the control fresh holds to just above this level. It does require a bit of tweaking to get the most out of it. The high spike are easy to see and immediately act on but it’s the ones that just go over the threshholds and reduce ingnition timing when it may not be required.
     
  18. jonbills

    jonbills
    ZClub Administrator
    Staff Member Committee Member

    My immediate problem was that the background noise took it to max voltage well before the redline, so I couldn’t set a threshold.
    It could be that I only need a voltage divider to scale it back down and set a max for ‘normal’ noise.
     
  19. Russell

    Russell
    Z Club Member

    There are a few people undertaking these sorts of projects, using micro controllers and the like. From my fairly involved project joining the 1JZ to the original gauges, this project, Ali's stereo etc.

    Is it worth introducing a new section into the forums to capture these?

    The possibilities are almost endless and allows original equipment to be updated and modified whilst retaining its 70's charm.
     
    AliK likes this.
  20. Rob Gaskin

    Rob Gaskin Membership Secretary Staff Member Committee Member

    Jon, what will you do when you have built a good knock sensor - how will you use it? Will you retard your ignition, alter the advance curve, use different fuel?

    Also I'm assuming that you are concerned that your car may be suffering from pre-ignition that you can't hear? I can tell straight away if my engine is 'pinking' - is the 'knocking' that triggers the sensor different than the pinking we can hear.
     

Share This Page