I created one with LM741 but it has a problem with hysteresis and it starts to “flap” at the edge. Now I’m seeking for some other ways to make this work. The circuit can use max 10mA when “sleeping”. I don’t necessarily need a ready circuit but just some pointers what kind of chips etc. to use. Thanks.
http://uk.farnell.com/texas-instruments … dp/1755063
.. add an input and output smoothing cap, and you’re done.
The output of the voltage regulator should come up quite cleanly, and could be 3v3 or 5v or 12, whichever is appropriate to “wake up” the rest of your circuitry.
on obd2 i think the ultimate most adventurous ones actually replace the fuel injection ecu with arduino, some even wants to fly with it, any 1 would try debugging over st-link jtag/swd at 60 miles an hour?
https://forum.arduino.cc/index.php?topic=213700.0
https://www.youtube.com/watch?v=GGhO0160SJ4
http://www.hainesengineering.com/rhaine … rduino.htm
or any 1 bother to do a ‘graphical’ ILI9341 fuel injection ecu that show the dynamic O2 concentration vs the cm3 per secs of petrol injected and dynamic ‘horse’ power computation with fft filtering to remove noise ? oh and for that you may need f4 that blow the tops of 500mflops overclocked
maybe add some whizz bang neural net machine learning to ‘auto tune’ for smallest cm3 per secs of petrol vs o2 concentration vs max engine ‘horse’ power produced per drop of fuel ![]()
http://uk.farnell.com/texas-instruments … dp/1755063
.. add an input and output smoothing cap, and you’re done.
The output of the voltage regulator should come up quite cleanly, and could be 3v3 or 5v or 12, whichever is appropriate to “wake up” the rest of your circuitry.
on obd2 i think the ultimate most adventurous ones actually replace the fuel injection ecu with arduino, some even wants to fly with it, any 1 would try debugging over st-link jtag/swd at 60 miles an hour?
https://forum.arduino.cc/index.php?topic=213700.0
https://www.youtube.com/watch?v=GGhO0160SJ4
http://www.hainesengineering.com/rhaine … rduino.htm
or any 1 bother to do a ‘graphical’ ILI9341 fuel injection ecu that show the dynamic O2 concentration vs the cm3 per secs of petrol injected and dynamic ‘horse’ power computation with fft filtering to remove noise ? oh and for that you may need f4 that blow the tops of 500mflops overclocked
maybe add some whizz bang neural net machine learning to ‘auto tune’ for smallest cm3 per secs of petrol vs o2 concentration vs max engine ‘horse’ power produced per drop of fuel ![]()
http://uk.farnell.com/texas-instruments … dp/1755063
.. add an input and output smoothing cap, and you’re done.
The output of the voltage regulator should come up quite cleanly, and could be 3v3 or 5v or 12, whichever is appropriate to “wake up” the rest of your circuitry.
In only got as far as plugging on into my car and reading data via an android app, but @bennehboy is doing a lot more.
I am not an expert in this, But you can read engine RPM via OBD so in theory the device could use that data to determine if the engine is running.
I think the complication is that there are different communication protocols used by OBD2.
In only got as far as plugging on into my car and reading data via an android app, but @bennehboy is doing a lot more.
I am not an expert in this, But you can read engine RPM via OBD so in theory the device could use that data to determine if the engine is running.
I think the complication is that there are different communication protocols used by OBD2.
I’m not sure it would be quite as simple as that. When the battery is charged it will indeed rise to around 14V, but I’m not sure for example if you turn the headlights on, then start the car, how long it will take the battery to get to 13V if the battery was not fully charged prior to starting the car
You may be better off looking for alternator ripple or other noise on the supply voltage, as alternators used to introduce some nice sine waves in the audio part of the spectrum.
i.e pass though a high pass filter or a band pass filter.
One possiblity could be to monitor for voltage drop which happens very quickly when car is started. Again, no idea how to detect this with a simple circuit that draws max 5-10mA.
I was going to mention that the battery voltage normally drops very sharply when the starter motor is running.
I’ve not checked my current car, but I remember some old cars I had the battery voltage dropped well below 10V when the starter was turning
Of course the car may not start if you just turn the key for a split second or release before it fires on a cold day, so I’m not sure the voltage drop method is that reliable
The alternator noise or OBD RPM data method are probably the most reliable methods
I was going to mention that the battery voltage normally drops very sharply when the starter motor is running.
I’ve not checked my current car, but I remember some old cars I had the battery voltage dropped well below 10V when the starter was turning
Of course the car may not start if you just turn the key for a split second or release before it fires on a cold day, so I’m not sure the voltage drop method is that reliable
The alternator noise or OBD RPM data method are probably the most reliable methods
Have you checked what OBD protocol it uses.
I have an old Subaru, which seems to use a fairly standard protocol
I’m not sure where all of these things are listed but mine appears to be listed here
http://www.outilsobdfacile.com/vehicle- … bd2/subaru
and is compatible with the ELM327 module that I have
Have you checked what OBD protocol it uses.
I have an old Subaru, which seems to use a fairly standard protocol
I’m not sure where all of these things are listed but mine appears to be listed here
http://www.outilsobdfacile.com/vehicle- … bd2/subaru
and is compatible with the ELM327 module that I have
But it looks like your BMW may output RPM on pin 9 of OBD 2
https://en.wikipedia.org/wiki/On-board_ … ics#OBD-II
But it looks like BMW only.
In which case it should be fairly simply to trigger off that signal, either if its a pure analogue level or some sort of PWM or PPM etc
But it looks like your BMW may output RPM on pin 9 of OBD 2
https://en.wikipedia.org/wiki/On-board_ … ics#OBD-II
But it looks like BMW only.
In which case it should be fairly simply to trigger off that signal, either if its a pure analogue level or some sort of PWM or PPM etc
srp
and i’d think the odb2 protocol itself seem to have messages to read engine rpm
https://en.wikipedia.org/wiki/OBD-II_PIDs#Mode_01
https://en.wikipedia.org/wiki/On-board_ … ics#OBD-II
https://en.wikipedia.org/wiki/OBD-II_PIDs
as for powering stm32, perhaps a ‘simplier’ way is to simply use an external battery, i think those blue pill / maple mini LDOs can easily take say 6v from 4×1.5v batteries ![]()
Currently the wire that gets main power +12V will power the display from BP’s 5V pin. So it’s not enough to just put stm32 to sleep
‘usb 5v lipo chargers’ seemed rather abundant on ebay though
http://www.ebay.com/sch/i.html?_odkw=li … +&_sacat=0
and it seem there are some threads discussing if these lipo chargers are after all sufficiently safe
stm32 may be made to run in low power modes e.g. with the lipo batteries, perhaps adjust systick to fire at lower intervals (note this would break millis and system_uptime_millis) and perhaps poll obd2 periodically for the engine rpm, perhaps some kind of ’round robin scheduler’ and with WFI (wait for interrupt) to catch that systick interrupt. http://www.stm32duino.com/viewtopic.php?f=18&t=2117
the downside is that this is literally an ‘always-on’ design
i’d think to save power and perhaps even disable systick. one option may be to use RTC perhaps to set alarms, interrupts to fire at say a few seconds interval. but then this is still an ‘always-on’ polling design, just that the polling interval is ‘stretched out’
the alternatives may simply be to let stm32 boot up when you turn on power / ignition, then perhaps ‘talk’ over obd2 protocols to get the engine rpm. but this is ok if you don’t need an ‘always on’ design. e.g. assume that when there is no power, the engine should after all be ‘off’ ![]()
I dont know if RPM is sent by all ODB but it works on my Subaru.
Though I think potentially that its not being “sent” but the phone app I’m using is probably constantly requesting RPM ( and other data depending on its configuration)
A whole load of other data seems to be available e.g. speed, engine temperature, air flow etc, and the app I use also displays fuel consumotion (mpg), but I dont know if its computing mpg from speed / fuel usage
Re: Problem with running from 12v
It sounds like the linear voltage regulator is the issue here, as they inherently take current all the time.
but, I thought @ahull had suggested a low current regulator.
stephen
I dont know if RPM is sent by all ODB but it works on my Subaru.
Though I think potentially that its not being “sent” but the phone app I’m using is probably constantly requesting RPM ( and other data depending on its configuration)
A whole load of other data seems to be available e.g. speed, engine temperature, air flow etc, and the app I use also displays fuel consumotion (mpg), but I dont know if its computing mpg from speed / fuel usage
Re: Problem with running from 12v
It sounds like the linear voltage regulator is the issue here, as they inherently take current all the time.
but, I thought @ahull had suggested a low current regulator.
You could tap into the ‘idiot’ light terminal from the alternator. This terminal goes high when the engine is running, so you could put a simple circuit in this line which would sense this and power up the mcu when the alternator is turning. The beauty of this is no power consumption when off, and it’s a neat hardware solution.


