Discussion forum for the BasicX family of microcontroller chips.
|
wrote: > I have an accelerometer (Memsic MXD202) with a 100 Hz fixed frequency PWM > output. > > I want to interface this to a BX-01 chip, ending up with an RS232 output > showing the duty cycle. > > Only trouble is, I have no idea how to achieve this. I have done some > searching on PWM, but everything I have seen involved PWM outputs (mostly > to motors) and not inputs. > > Can I just stick the sensor PWM outputs (there are 2 - X & Y axis) into > input pins on the BX-01 & develop some software which will somehow sense > the edges & calculate the duty cycle? I'm not sure whether the BX-01 could > keep up with 2 signals & calculate a % duty cycle & spit it out. > > Or should I feed the PWM outputs into some sort of filter to convert it to > a DC voltage & then do an A/D conversion? I can't imagine this will give me > the response I need though. > > I am looking to strap this accelerometer to a car engine block & see if it > can be used to detect the RPM of the engine, or at least to tell whether > the engine is running or not, and to log this info on a PC. Not sure if > it's going to work, but I want a sensor that has no connection to moving > parts (apart from physical contact with the engine block) and a sensor that > will hopefully work with many engine types without having to make changes. > > Dave Dave: Some thoughts on your problem: To detect engine rpm for spark ignited gasoline engines, detecting the spark plug firing impulses is one way to do it. In a four stroke engine the plugs fire at half the engine speed. Eg. If the engine speed is 30 Hz, the plugs fire at 15 Hz etc. An inductive pick up that is conditioned to give out a 5V TTL signal could be used. For diesel engines, though, a more direct indication of the engine speed would be needed since there are no plugs and an inductive proximity probe could be used on an exposed gear if available, or some reflective optical tacho would need to be used on the engine crankshaft pulley or damper. Use of an accelerometer will only give you a general indication of the vibration activity of the engine that may tell you that the engine is indeed working. The acceleration signal contains information at one times engine rpm (engine speed) but to extract that information would require much more signal processing(FFT) than any of the direct means of doing it. This is because four stroke engines have a vibration signature that contains odd and even orders (multiples of engine rpm) starting from 0.5, 1.0 1.5 ....etc) You would need to extract the first order alone to monitor engine speed using an accelerometer. Others in this forum should be able to shed more light on the BX-24's capability. Vinoo |
|
|