Continue to Site

Eng-Tips is the largest engineering community on the Internet

Intelligent Work Forums for Engineering Professionals

  • Congratulations SSS148 on being selected by the Eng-Tips community for having the most helpful posts in the forums last week. Way to Go!

quick and nasty datalogger 1

Status
Not open for further replies.

MRSSPOCK

Mechanical
Aug 29, 2010
303
Does anyone know if there is a quick and nasty way to log a crude digital signal?

Rather than use the correct kit, is there a way to make use of let's say an audio recorder, using the microphone input socket to record a pretty raw / rough digital signal, even if it's barely recognisable as a digital signal?

I don't really care about the quality at all.

I just want to do a live test on my car to prove there is some activity while driving.

I want to T into the wire that pulses a solenoid on the car, and record the live data.

Am I being silly?

I know when I open a WAV file for example in a WAV editor, that the sample rate is 44100 per second, so I presume that is the rate it can be recorded at if I use a the microphone input?

I'm even just thinking of winding a small diameter copper wire around the solenoid control wire that provides the pulses, and hopefully even a small inductive signal can be recorded.

I only want to know when the solenoid is being pulsed, and the duty cycle at the time.

Just before someone suggests OBD, I have no kit to do that and I don't really intend buying any.

I just want to know if my crude solution is feasible or am I missing something?

I have a minidisc recorder, so the plan is to use that.

I think as long as the voltage doesn't go above 1.2V there shouldn't be a problem.

Does that make sense?

I just don't want to damage my minidisc recorder.

Thanks
 
Replies continue below

Recommended for you

Sure. There are tons of ways. You could also buy a piezo-electric buzzer that runs off 12VDC for less than a buck on eBay: that you could even use without the recorder and just listen for it.

TTFN
faq731-376
7ofakss

Need help writing a question or understanding a reply? forum1529
 
If it's a solenoid simple switching on and off at different times then it won't work since you are trying to record 2 different DC levels and recording equipment will filter out DC and you couldn't hear DC anyways to know something was happening.

It might work if the signal is a varible PWM signal to the coil.

But then, why not just connect a meter or light bulb or buzzer as already suggested to the wire to see if it turns on and off?
 
Since you value the minidisc recorder, it doesn't make sense to risk using it for datalogging on an automobile. The transients are awful/awesome depending on your perspective, and the DC on/off will just appear as clicks unless you use the solenoid voltage to gate an audio tone, or maybe tape a reed switch to the solenoid and use that to do the gating.

In any event, building the interface is going to cost you way more than $20 in parts and trips to Radio Shack.

Buy the datalogger.

Star to imcjoek.


Mike Halloran
Pembroke Pines, FL, USA
 
Thanks for your input. I suppose I should elaborate a little bit more.

I have a 5 wire EGR valve.

2 wires go to the solenoid which gets a square wave pulse, as and when the ECU demands some pintel movement.

The other 3 wires are for feedback to tell the ECU the pintel postion, i.e. a 5V supply to a pot, a GND to the pot, and a signal wire connected to the pot's wiper.

I'm convinced there is some strange activity regarding the control of this valve.

I have attached my scope to the wire which pulses the solenoid, but trying to operate the scope and drive the car is proving a bit of a challenge.

Because the EGR activity is programmed for control under driving conditions, doing any testing while parked is a not very conclusive, since it's not so easy to remain at certain throttle positions for any real duration and since the engine speed v throttle postion v vehicle speed etc are all factors in the EGR's map, any stationary test would be pretty useless anyway.

I had hoped to be able to somehow simply record the square pulse, then take a look at it once I come to a halt.

I have a simple square wave generator which I hooked up to my sound card today and the result wan't too bad.

At least it looks a bit like a square wave.

The $20 device looks good, but 1. I'm not sure if 50Hz is adequate, and 2. I know absolutely nothing about how to use such a thing. I know absolutely nothing about UART and so on.

My main aim is to determine if the behaviour is consistent.

I think sometimes it works and sometimes it doesn't.

I want to just do some respetitive acceleration runs, recording the square wave pulses sent to the solenoid and then compare the different runs to see if there is any similarity.

I know for sure the solenoid is controlled by a PWM since I have seen it on my scope.

The attached image shows what I recorded from my square wave generator via my sound card today.

It did record symmetrical on the zero line, but it is just offset because I was messing with the DC offset and that's why it looks like it does.

I will give it a try soon on the car for real.

Thanks again
 
 http://files.engineering.com/getfile.aspx?folder=88285e76-bd6b-41ba-b2cf-3b18bfd6d8d1&file=squarish_wave.jpg
But, what's the frequency of the solenoid signal?

Note that your generator probably puts out less than 1V, while your solenoid signal is likely to be at least 12V, and possibly more if there's no snubber in the circuit.

Seems to me that the buzzer producing sound for the recorder is still a viable option.

TTFN
faq731-376
7ofakss

Need help writing a question or understanding a reply? forum1529
 
@IRstuff Oh, I see what you mean now. I thought you meant just listen to the buzzer, but I realise now you mean to record the buzzer via a microphone. That should be pretty handy. Thanks. I will try that. I ought to be able to analyse the recorded WAV file and determine the frequency.
 
Roughly speaking the highest fundamental frequency you'll see in an ignition circuit is 50Hz ie (RPM/120). As you are dealing with square waves there will also be harmonics at 3,5,7 etc times the fundamental. As such an old cassette machine will probably pick up enough.


Cheers

Greg Locock


New here? Try reading these, they might help FAQ731-376
 
@ GregLocock Sorry, I can't really grasp the relevance of your 50Hz comment. You just seem to be referring the frequency of the mechanical elements? Maybe I haven't explained things very well. Have a look here for example. You see here the sort of activity taking place with fuel injectors for example. 50Hz sampling isn't really going to be much use.
 
.. or an even simpler example is a 36 tooth crankwheel and sensor. At 4000 RPM the frequency is 2400Hz. The 50Hz sensor wouldn't really help in that scenario if you were looking for a rouge pulse. I have no idea of the frequency of the PWM signal to my EGR, but I'm expecting much more than 50Hz
 
" Sorry, I can't really grasp the relevance of your 50Hz comment. "

I'm saying that the frequency of the data you need to capture is fairly low, you don't need huge sampling frequencies - in fact your real problem is that you can't record down to DC on domestic gear.



Cheers

Greg Locock


New here? Try reading these, they might help FAQ731-376
 
There's no particular reason to derive the EGR jiggle-pin control valve signal from a timed spark pulse.

There's no particular reason to derive it from a high speed clock, either, but there has been a bragging rights race among autoEEs, so current ECUs have many more bits of bus width and many more MHz of clock speed than they actually need to stay ahead of an engine. ... which has the side effect that the PWM frequency _could_ be higher than the ignition frequency. ... or, not. Since we don't know which ECU or vehicle make/model/year is being monitored here, we can't even offer a decent guess.

However, even if a too-low sampling rate causes aliasing, it will still probably detect the _presence_ of EGR control valve command activity, which seems the logical next step.
>>>
I just want to do a live test on my car to prove there is some activity while driving.<<<

By the way, what does the official factory shop manual say is the next step in the diagnostic tree?

Is there anything wrong with the vehicle, or are you just poking around?




Mike Halloran
Pembroke Pines, FL, USA
 
@ MikeHalloran Sorry, I'm probably out of my depth here. I don't have any real knowledge of these things but I just like to try to learn what I can. All I know is I have an intermittent acceleration hesitation. A few Google searches have steered me towards an EGR problem. I think I detected inconsistency in the solenoid control pulses while driving with my scope attached, but it's difficult to be sure. I also watched some video on Youtube of someone trying to sort out a fuel injector problem, and that system was using a frequency of 128Hz and PWM to control fuel delivery. I'm just presuming my solenoid might have a frequency of a similar magnitude, so I supposed something taking samples at less than half that frequency (50Hz) isn't going to provide very good results if I am trying to compare numerous runs for consistency.

The next logical step in my mind would be to determine if the intermittent problem is due to an intermittent electrical problem. Is it a intermittent break in the control pulse wire circuit to the solenoid, or an intermittent break in feedback signal circuit. Until I can do some live recording I can't really know very much more. If I see an intermittent problem on a wire, then I will try to T into the same wire up at the ECU to determine if the temporary interruption is outside the ECU or inside.

This might sound silly, but I don't even want to mention the make / model, because I'm not particularly looking for someone else to fix the car so to speak. That way I don't learn anything. I personally find I learn most by hands on experimentation. I could easily pay someone else to do that job, but my intention is to try to learn more about the bare bones of how these things work.

Thanks for your reply
 
P.S. I wasn't suggesting tieing up my EGR trace to engine revolution timing.

I was only pointing out that there are lots of activities under the bonnet (hood) that occur many more times faster than engine speed, so that's why I was saying the 50Hz value calculated relative to mechanical frequency seemed irrelevant.
 
Well, considering that an engine under load will easily get up to 50 rps, 50-Hz sampling would be inadequate for that. However, aside from that, throttle related things ought not be happening that fast.

TTFN
faq731-376
7ofakss

Need help writing a question or understanding a reply? forum1529
 
EGR control signals are derived from oxygen sensor signals, which are themselves noisy and irregular, but logically slow moving relative to the crankshaft. I wouldn't regard nonperiodicity in either system as abnormal.

That said, an old cranky fellow not far from here rebuilds carburetors for a living. ... or maybe for beer money. So as to not waste his time, he insists on an MMO treatment before removal from the vehicle.

I.e., put a pint of Marvel Mystery Oil in the fuel tank and go for a drive. If it's going to work at all, the difference will be noticeable inside of 20 miles. That will mostly eliminate transient problems associated with dirt/gum/varnish in the fuel and air systems. ( No other fuel additive has ever made a detectable difference for me, and the difference that MMO can make, even in a fuelie car, is dramatic. I have no financial involvement in MMO; I wish I did. )

Shop manuals from the sixties are better for educational purposes, but even the modern ones intended for use by unskilled labor will contain some useful clues. Aftermarket books carried by, e.g. Pep Boys, are better than nothing, but not nearly as good as official factory manuals. Chances are yours is available at helminc.com. Buy the schematics even if they are separate/extra.

Oh. A Helminc manual will cost more than the typical college textbook, but you won't regret buying it.









Mike Halloran
Pembroke Pines, FL, USA
 
Well, I just did a quick trial with the mindisc recorder attached to the car, (if you're old enough to remember a minidisc recorder).

It turns out it is spot on as quick and nasty recorder. (See attachment).

I had the scope attached at the same time as the minidisc, so you can see they are both in agreement.

(If my scope had a bigger memory this thread probably wouldn't exist).

110Hz and 35% duty.

Prior to this minidisc test, I did grab a few shots from the scope while driving and recorded 14.1V, i.e. battery voltage.

So, before hooking up the minidisc I created a voltage divider to limit the minidisc exposure to 1V maximum.

You can see that I also put the probes on back to front, so the scope is showing a duty of about 65% while the minidisc 35%.

(When I recorded the 14.1V trace, the scope was connected correctly and showed 35% duty also).

The bottom right corner of the top trace from the audio file shows 0.092 seconds interval for the highlighted 10 cycles.

Now that I have established I can record an interpretable trace, it's time to get back out and see if I can see any correlation with regards the car's behaviour and EGR activity.

I also discovered I got an added bonus from doing the test, which sort of comes back to IRstuff's suggestion.

I had the earphones plugged into the minidisc during recording, so there is immediate feedback to the driver when the EGR is being pulsed.

Thanks for your input.
 
 http://files.engineering.com/getfile.aspx?folder=2a477e96-7f3b-4831-b197-9087bcb6995a&file=egr_trace.jpg
The ATtiny24 inside the datalogger actually has a maximum sampling rate of around 3 kHz. Moreover, since there is only one ADC on the chip, the 3 inputs that the datalogger provides can be paralleled to get 150 Hz sampling rate. If you modify the code, you can get a single input to run at 150 Hz.

Furthermore, the source code for the datalogger is provided, and by removing the delays encoded in the source code, you should be able to run the datalogger at the maximum frequency of the ADC. Of course, that will severely limit the logging time. Since the ATtiny24 also has an analog comparator, one could code the logger to only collect when PA1 and PA2 detect a transition, and you can log a single counter value. This would substantially extend the logging time.

TTFN
faq731-376
7ofakss

Need help writing a question or understanding a reply? forum1529
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor