Homemade datalogging project

Need technical Q/A then you're in the right place

Moderator: martauto

milescook
E30 Zone Camper
E30 Zone Camper
Posts: 1285
Joined: Thu Jan 13, 2011 11:00 pm
Location: The 'bran of Cwm

Post Sat Jul 27, 2013 7:13 pm

As some may be aware, after seeing Grrrrmachine's thread on data capture http://www.e30zone.net/modules.php?name ... light=data I decided it woul be jolly good fun to try and setup some data logging, for throttle position, brake position, steering, speed, revs, tempreature and maybe more.

Today I came back from Maplins with a goody bag of electrical "stuff" that I need to learn about, but importanlty coming back with a raspberry pi and arduino.

My vision is the Pi (powered by the car battery) sits in a box with an arduino (powered by the pi) acting as the interface, with it's out of the box support for analog inputs. The PI will log data to it's flash card, it's wifi dongle will allow me to connect a laptop up to a web service and download logs in excel, see pretty graphs etc. From there it's not too tricky to sync and overlay data (free open source tools are availble) onto video and gps data from my phone app trackmaster.

The stuff in Grr's thread about how the signals translate to analog signals that can be used is over my head for the moment, but with a few more bits of kit and tapping into wires and putting potentiometers in certain places, the above will fall in to place. Hopefully! :D

Got started, and through the PI the Arduino (or piduino data logger as I've branded it...) is streaming live potentiometer data.

Image

I do already have soem questions for down the line. Where's the best place for potentiometers for steering throttle and brake? I'm thinking for the throttle to mount it underneath the tps somehow connecting it to the middle

Image

Thoughts?
The story so far... http://www.cookracing.co.uk/

Also please help the race budget by watching some videos :) https://www.youtube.com/cookracinguk
Grrrmachine
E30 Zone Wiki / Team Member
E30 Zone Wiki / Team Member
Posts: 8043
Joined: Sat Feb 09, 2008 11:00 pm
Location: Warsaw, Poland

Post Sat Jul 27, 2013 7:39 pm

It's funny how the signal conversion is too complex for you. That was a doddle for me, but any programming beyond 10 PRINT "HELLO 20 GOTO 10 is black magic from my perspective.

Let me know how you get on, and I'll take some pics of my circuitry if you have any troubles wiring it all up - my setup is all in bits at the moment.
milescook
E30 Zone Camper
E30 Zone Camper
Posts: 1285
Joined: Thu Jan 13, 2011 11:00 pm
Location: The 'bran of Cwm

Post Sat Jul 27, 2013 7:57 pm

Cheers Grr! Good job we all have expertise in different areas :D

I've now got the whole setup logging the potentiometer inputs to percentages in a CSV file :D That's my throttle software side set up at least. 8)
The story so far... http://www.cookracing.co.uk/

Also please help the race budget by watching some videos :) https://www.youtube.com/cookracinguk
milescook
E30 Zone Camper
E30 Zone Camper
Posts: 1285
Joined: Thu Jan 13, 2011 11:00 pm
Location: The 'bran of Cwm

Post Sat Jul 27, 2013 10:49 pm

As a proof of concept, I've added a second potentiometer to the arduino, ran it, played with both potentiometers and copied the csv output into a template with a graph.
Image
Getting somewhere - I guess this is the easy bit! :mad:

Oh, and this kit so far costs around £50 :D :cool:
The story so far... http://www.cookracing.co.uk/

Also please help the race budget by watching some videos :) https://www.youtube.com/cookracinguk
User avatar
Steve
E30 Zone Team Member
E30 Zone Team Member
Posts: 13158
Joined: Sun Dec 19, 2004 11:00 pm

Post Sat Jul 27, 2013 11:20 pm

I started a similar project when got hold of a Pi but I was planning on getting my data from MS.

I even got a screen mounted where the obc normally resides for live data.

Image
webmaster@e30zone.net
Grrrmachine
E30 Zone Wiki / Team Member
E30 Zone Wiki / Team Member
Posts: 8043
Joined: Sat Feb 09, 2008 11:00 pm
Location: Warsaw, Poland

Post Sun Jul 28, 2013 3:00 pm

Nice little screen Steve - pales in comparison to my 7-inch though :cool:

What sort of info are you going to display?
appletree
E30 Zone Addict
E30 Zone Addict
Posts: 3479
Joined: Fri Jan 20, 2006 11:00 pm
Location: Retford

Post Sun Jul 28, 2013 3:16 pm

I always fancied a little screen like the indoor outdoor temperatures you get for the kitchen window sill but extend it and use it for doing air temperature before and after the intercooler, suppose it wouldn't be to hard to log it. Then again it would be nice to have RPM and road speed on there aswell . :D

If you like playing around with car electrics and stuff you might Lind this thread interesting, guy makes his own antilag systems as well awsorts of other electric wizardry.

http://www.pistonheads.com/gassing/topic.asp?t=1098374
Image

You should never underestimate the predictability of stupidity

M42 Supercharged 285bhp + M3 6speed box
Grrrmachine
E30 Zone Wiki / Team Member
E30 Zone Wiki / Team Member
Posts: 8043
Joined: Sat Feb 09, 2008 11:00 pm
Location: Warsaw, Poland

Post Sun Jul 28, 2013 3:24 pm

If you want little screens, it may make more sense to switch to the poverty-spec fascia:

Image

This is the one I've switched to, and I'm thinking about converting the two side strips to red LCDs, making an Alpina-gauge copy...
milescook
E30 Zone Camper
E30 Zone Camper
Posts: 1285
Joined: Thu Jan 13, 2011 11:00 pm
Location: The 'bran of Cwm

Post Tue Jul 30, 2013 2:49 pm

Struggling for ideas how to mount the potentiometers now :? I would rather not cut in to the tps mechanism, and a bit lost where the brake one could go and on the steering too.any ideas?
The story so far... http://www.cookracing.co.uk/

Also please help the race budget by watching some videos :) https://www.youtube.com/cookracinguk
Grrrmachine
E30 Zone Wiki / Team Member
E30 Zone Wiki / Team Member
Posts: 8043
Joined: Sat Feb 09, 2008 11:00 pm
Location: Warsaw, Poland

Post Tue Jul 30, 2013 4:30 pm

Maybe you should look for linear pots rather than rotary:

Image

That way you can connect one to the secondary throttle arm (where the cruise control normally clips on), as well as the rods of the clutch and brake cylinders.
milescook
E30 Zone Camper
E30 Zone Camper
Posts: 1285
Joined: Thu Jan 13, 2011 11:00 pm
Location: The 'bran of Cwm

Post Tue Jul 30, 2013 6:22 pm

I have a few of those fader types too, its looking like they are best. Now I have to work out how to fabricate aome brackets :? Are there very versatile brackets worth looking out for, or any techniques to making them? Otherwise its off to b and q for more aluminium lengths!
Oh as a update it turns out the whole thing will work from the car battery no prob.
The story so far... http://www.cookracing.co.uk/

Also please help the race budget by watching some videos :) https://www.youtube.com/cookracinguk
milescook
E30 Zone Camper
E30 Zone Camper
Posts: 1285
Joined: Thu Jan 13, 2011 11:00 pm
Location: The 'bran of Cwm

Post Sat Aug 03, 2013 5:58 pm

Right had an interesting day today with help from Grr's thread here http://www.e30zone.net/modules.php?name ... a&start=25

My speed voltage from pin 26 of the yellow plug starts at 4.45 at rest and decreases as you speed up. I couldn't tke any useful readings as I was holding a multimeter and wires and just driving backwards and forward!

The tacho from pin 7 of the blue plug - I didn't the issues of the tacho not working? - fed a non linear range as far as I could tell - though perhaps this is bad contacts trying to ground...?

Revs and voltage:
Idle approx 750 8.2
1.5k 7.5
2k 7.1
3k 6.4
4k 4.9
5k 3.2

Struggling with the arduino a touch it's reporting fluctuating figures, should be something simple enough. I'm a biy confused though because measuring a potentometer is simple enough - 3.3 or 5v on live terminal, ground to the negative, and the analog signal for the actual reading. Not sure how the circuit should work with a voltage straight from the car - I've been connecting ground to the car's ground. Please bear in mind I'm pretty new to electronics!
The story so far... http://www.cookracing.co.uk/

Also please help the race budget by watching some videos :) https://www.youtube.com/cookracinguk
Grrrmachine
E30 Zone Wiki / Team Member
E30 Zone Wiki / Team Member
Posts: 8043
Joined: Sat Feb 09, 2008 11:00 pm
Location: Warsaw, Poland

Post Sat Aug 03, 2013 6:09 pm

Both speedo and tacho are square waves, so you'll need to find/build a frequency-to-voltage converter to make it work - you won't get any sense from the raw "voltage" you're seeing on those wires. With an F2V board you'll get a direct linear relationship between revs/speed and voltage.

Read the last post in my thread 8)
milescook
E30 Zone Camper
E30 Zone Camper
Posts: 1285
Joined: Thu Jan 13, 2011 11:00 pm
Location: The 'bran of Cwm

Post Sat Aug 03, 2013 6:42 pm

Ok I see - so the voltage is a bit of a wild herring then. I'm sure the Arduino can count frequency though? I'm googling but it could all frankly be written in Chinese to me....Ill plug away.

What am I looking for to indicate a pulse, just any input?
The story so far... http://www.cookracing.co.uk/

Also please help the race budget by watching some videos :) https://www.youtube.com/cookracinguk
Grrrmachine
E30 Zone Wiki / Team Member
E30 Zone Wiki / Team Member
Posts: 8043
Joined: Sat Feb 09, 2008 11:00 pm
Location: Warsaw, Poland

Post Sat Aug 03, 2013 7:14 pm

You need an oscilloscope to measure frequency.
mani
E30 Zone Camper
E30 Zone Camper
Posts: 1143
Joined: Mon May 26, 2008 11:00 pm
Location: London

Post Sun Aug 04, 2013 10:57 pm

Cool stuff .
User avatar
gromgsxr
E30 Zone Regular
E30 Zone Regular
Posts: 451
Joined: Tue Dec 06, 2011 11:00 pm

Post Sun Aug 04, 2013 11:25 pm

I think if read somewhere the auto car tps sensor has the idle and wot switches like the manual one but also has a potentiometer built in it as well think it has 6 wires in total. Maybe some else can confirm this.
milescook
E30 Zone Camper
E30 Zone Camper
Posts: 1285
Joined: Thu Jan 13, 2011 11:00 pm
Location: The 'bran of Cwm

Post Mon Aug 05, 2013 12:24 am

Bugger me! :mad:

http://www.e30tech.com/forum/showthread.php?t=40920
Cheers for the suggestion it's certainly an idea.

Guess I'd still need an external FtV convertor chip though? Still struggling to see why the Arduni couldn't do that onboard, googling isn't helping :(
The story so far... http://www.cookracing.co.uk/

Also please help the race budget by watching some videos :) https://www.youtube.com/cookracinguk
User avatar
gromgsxr
E30 Zone Regular
E30 Zone Regular
Posts: 451
Joined: Tue Dec 06, 2011 11:00 pm

Post Mon Aug 05, 2013 12:43 am

Grrrmachine
E30 Zone Wiki / Team Member
E30 Zone Wiki / Team Member
Posts: 8043
Joined: Sat Feb 09, 2008 11:00 pm
Location: Warsaw, Poland

Post Mon Aug 05, 2013 5:53 am

A F2V chip should cost you about two quid, including a handful of resistors, and an hour of your time with the soldering iron.
milescook
E30 Zone Camper
E30 Zone Camper
Posts: 1285
Joined: Thu Jan 13, 2011 11:00 pm
Location: The 'bran of Cwm

Post Mon Aug 05, 2013 8:18 am

Good stuff! Just ordered a couple of those from ebay now. http://cgi.ebay.co.uk/ws/eBayISAPI.dll? ... 0750180977

The biggest incentive I can see is trying to achieve this with software of several inputs would take valuable processing power away from the Arduino, sacrificing data resolution or features.

Also further to my last tired post, overnight realised that the auto TPS of course is a potentiometer not a pulse generator ... :mad:

On a side note I was thinking about the TPS and perhaps making a bespoke replacement case to easily connect a rotational pot, or fabricate an arm for a linera one. I got looking at 3d printers... http://www.maplin.co.uk/3d-printer Oh mummy I want one :mad: Think that can wait though :D

For the throttle sensor, that's my next hurdle which I haven't fully decided on a solution yet.

Image

Pinched this image and added the red hatched area to show where a small plastic / metal box would go, containing the linear pot with a protruding arm along the same lines as the cruise control cable. Would a plastic rod suffice? Can I buy the plastic clips from the cruise control system seperately or a decent copy? Obviously my above solution would be scuppered by cruise control which I don't have, and I'm guessing most track cars don't. Cheers!
The story so far... http://www.cookracing.co.uk/

Also please help the race budget by watching some videos :) https://www.youtube.com/cookracinguk
Grrrmachine
E30 Zone Wiki / Team Member
E30 Zone Wiki / Team Member
Posts: 8043
Joined: Sat Feb 09, 2008 11:00 pm
Location: Warsaw, Poland

Post Mon Aug 05, 2013 9:07 am

Using the cruise cable mount to hold a linear pot is a sensible idea, but you'll need decent fabricating skills to make something heavy-duty enough to cope with the constant movements. It wouldn't surprise me at all to find that you need to replace the pot on an almost weekly basis.

The good news is that the clips on the right-hand side of your pic can be bought separately. But remember that by converting rotary to linear you will get some false readings - you won't get a linear scale from the potentiometer.
User avatar
Brianmoooore
E30 Zone Team Member
E30 Zone Team Member
Posts: 49360
Joined: Mon Jan 10, 2005 11:00 pm

Post Mon Aug 05, 2013 9:25 am

Easiest way to sort the TPS is to use one from a switchable auto E30. You get a standard E30 throttle switch and a potentiometer all in one case. Uses a different plug, so you need that and a few inches of loom as well.
Grrrmachine
E30 Zone Wiki / Team Member
E30 Zone Wiki / Team Member
Posts: 8043
Joined: Sat Feb 09, 2008 11:00 pm
Location: Warsaw, Poland

Post Mon Aug 05, 2013 9:46 am

I'd agree with Brian on that. Not a bad idea at all.

As for your Frequency-to-voltage boards; I built a few with those reduced chips and couldn't get sensible readings. So I used the boards I'd built for an older project (an Audi 80 B2), which look like this:

Image

You can see I used the full-fat LM2917N chips, supplied with 12V from the car directly. In the E30 I supplied it with 3.3V directly from my input/output board.

The design is done on a generic circuit board, and if you look closely you can trace the circuit layout. It's an exact copy of the layout on this page:

http://foz11.tripod.com/DIY_MOD_s/Digit ... peedo.html

The other four potentiometers are just voltage dividers that I can configure to get perfect scaled readings.

For reference, on the blue wire-holders, pin 1 is input, pin 2 is output.
milescook
E30 Zone Camper
E30 Zone Camper
Posts: 1285
Joined: Thu Jan 13, 2011 11:00 pm
Location: The 'bran of Cwm

Post Tue Aug 06, 2013 1:39 pm

TPS for autos seem to be going for around £150! 8O

I'll see if I can get one from here, a normal TPS seems to be around £10 - £20.

I'm considering just hooking up the brake switch to the logger rather than try to measure the braking force, again down to my inexperience with fabricating a Potentiometer bracket that isn't going to fall off or jam the mechanism. Overlaying these inputs with video should give me plenty of data to work from when analysing my runs.

Cheers so far, nore updates to follow...
The story so far... http://www.cookracing.co.uk/

Also please help the race budget by watching some videos :) https://www.youtube.com/cookracinguk
User avatar
Brianmoooore
E30 Zone Team Member
E30 Zone Team Member
Posts: 49360
Joined: Mon Jan 10, 2005 11:00 pm

Post Tue Aug 06, 2013 1:50 pm

If you want to measure braking force you need a load cell under the pedal rubber.
milescook
E30 Zone Camper
E30 Zone Camper
Posts: 1285
Joined: Thu Jan 13, 2011 11:00 pm
Location: The 'bran of Cwm

Post Tue Aug 06, 2013 2:48 pm

The story so far... http://www.cookracing.co.uk/

Also please help the race budget by watching some videos :) https://www.youtube.com/cookracinguk
Grrrmachine
E30 Zone Wiki / Team Member
E30 Zone Wiki / Team Member
Posts: 8043
Joined: Sat Feb 09, 2008 11:00 pm
Location: Warsaw, Poland

Post Tue Aug 06, 2013 4:56 pm

You're much better off getting a generic accelerometer for the Arduino. As long as you mount it properly, it'll give you acceleration and braking forces for the car.
User avatar
Brianmoooore
E30 Zone Team Member
E30 Zone Team Member
Posts: 49360
Joined: Mon Jan 10, 2005 11:00 pm

Post Tue Aug 06, 2013 6:20 pm

milescook wrote:TPS for autos seem to be going for around £150! 8O
Can't think why. There must be loads around with the pot. doing absolutely nothing, sitting in the engine bay of autos that have been converted to manual.
User avatar
Brianmoooore
E30 Zone Team Member
E30 Zone Team Member
Posts: 49360
Joined: Mon Jan 10, 2005 11:00 pm

Post Tue Aug 06, 2013 6:23 pm

Grrrmachine wrote:You're much better off getting a generic accelerometer for the Arduino. As long as you mount it properly, it'll give you acceleration and braking forces for the car.
Depends if you want to measure brake pressure or the effects of brake pressure.
Pedal pressure could also be measured by teeing a pressure transducer into a brake line.
milescook
E30 Zone Camper
E30 Zone Camper
Posts: 1285
Joined: Thu Jan 13, 2011 11:00 pm
Location: The 'bran of Cwm

Post Tue Aug 06, 2013 7:27 pm

I'll see about a TPS. I'm more interested in my own ham fisted inputs to the controls to analyze. My phone (which I'll use for video recording) app actually records acceleration with the inbuilt accelerometers but perhaps long term I might get ones for the box.
The story so far... http://www.cookracing.co.uk/

Also please help the race budget by watching some videos :) https://www.youtube.com/cookracinguk
milescook
E30 Zone Camper
E30 Zone Camper
Posts: 1285
Joined: Thu Jan 13, 2011 11:00 pm
Location: The 'bran of Cwm

Post Fri Aug 09, 2013 9:25 pm

Oh dear... confused.com :( Trial and misguided error are getting me some varying voltages as I'm simulating tacho pulses from an arduino. Not really sure what pins connect to what though for sure.

Can anyone please help an out of depth novice? Have an LM2907N-8 frequency to voltage convertor and baffled how it works even looking at the documentation.

Image

Just to add, I have 3.3V or 5v outputs and ground to play with.
Last edited by milescook on Fri Aug 09, 2013 9:46 pm, edited 1 time in total.
The story so far... http://www.cookracing.co.uk/

Also please help the race budget by watching some videos :) https://www.youtube.com/cookracinguk
Grrrmachine
E30 Zone Wiki / Team Member
E30 Zone Wiki / Team Member
Posts: 8043
Joined: Sat Feb 09, 2008 11:00 pm
Location: Warsaw, Poland

Post Fri Aug 09, 2013 9:46 pm

Trouble is, that circuit doesn't apply to what you're doing. Tacho doesn't work off a magnetic pickup.

Why don't you follow the circuit diagram I've talked about three times already? Or for a few quick I'll just build the whole thing and post it to you.
Speedtouch
Old Skooler
Old Skooler
Posts: 14123
Joined: Tue Feb 14, 2006 11:00 pm
Location: Canterbury

Post Fri Aug 09, 2013 11:46 pm

Try searching in Google images for circuit diagrams, for example:

http://code.google.com/p/multidisplay/wiki/RPM
///M aurice
ECU Upgrade EPROM Chips, £40 posted within the UK. Note these are not Zone chips.
viewtopic.php?f=6&t=279421