newprotest.org: Datsun 510 Blog

Datsun 510 Blog

I blog about everything. Even my car.

510 TELEMETRY PROJECT

2018-05-30 08:46:55
by: jovial_cynic


It's been a while since I've posted on here about my Datsun 510. I think the last post was in March of 2016, although I've posted quite a few short posts and images on Facebook, Twitter, and Instagram. I'll probably spend some time going through all of those posts and copying the content here, so I have it on my own server.

Speaking of my server, I haven't posted much since my webhost updated their Perl server, so I had to go in and update a bunch of my code to even post!

Anyhow, I've done quite a bit on the 510 lately. Between upgrading all of my brakes (discs all around), fabbed up new intercooler plumbing, and finally dumping the R33 skyline gauge cluster, I decided that the next major project to tackle would be the big electronic project: the Arduino/Raspberry Pi telemetry and custom gauge cluster system. It doesn't sound like much, since I haven't seen many overly complex Arduino or rPi builds, but this has been a pretty significant undertaking.

The basic premise of this project is this:

Use the Arduino to pull data from no less than 16 sources. On a standard Arduino UNO, this is not possible; there are only 6 analog inputs. However, using the magic of multiplexing, there's a way to quickly poll multiple sources over a single analog input; with two 8-channel multiplexers, we get that 16, plus the remaining 4 on the board itself.

Once the data is pulled (either direct 0-5v values or values drawn from a voltage divider circuit), it is neatly organized into a (name:value) pair, and sent as plain-text serial data via USB into the Raspberry Pi. On the rPI, I'm using Perl/Tk to pull in that serial data and display it graphically on a custom instrument cluster as well as saving the data for future analysis.

And then all of that is displayed on a 9x5" LCD screen.

Easy, right? Well, then there's the whole project of packaging it all up. So, that's where the 3d printer comes in. I assembled an ANET-A8 3d printer, learned how to use Blender, and printed out some bits to bring it all together.

The first thing I needed to print was an enclosure for the LCD driver. It came as a PCB board attached to the LCD screen with a power supply line and a ribbon cable; boxing it up meant printing a custom enclosure that I found and modified on thingiverse.com.


The model online didn't include a lid, so I used Blender to build one.


Fits like a glove.


Perfect!

The next thing I needed to do was to figure out a way to mount the LCD. It's going to sit in the Datsun 510, so I can't just have it sitting on the dash. I printed these corner brackets, and they seem to work just fine. It's not beautiful, but it is very functional.


Again, using blender to design it. I've used the bracket in several of my 3d prints, as it's perfect for small screws.


Fits the LCD screen. It's a little loose, but maybe I'm compensating for heat distortion?


Test fit.


And screwed down to a piece of plywood.

The next project was to build a custom Arduino. Yes, you read that correctly. Because I have a need to take things apart and put them back together, I wanted to do one of those custom "minimalist Arduino" projects where I just use the atmega chip, a few resistors, a crystal, and some capacitors, and voila - homemade Arduino.


Here's an UNO. It's the one I used to test all of my code.


And here's the Arduino connected to the two 5041 multiplexers.


Perf board with the chip plugs. Always use these things; soldering down (and then trying to remove) a chip sucks if you have to re-orient later.


Here is my minimalist Arduino board, together with the two multiplexers and a USB interface board.


In case you're nerdy, here's the multiplexer pintout.


And here's the Arduino atmega chip pinout.

With 16 inputs, I didn't want a bunch of loose wires everywhere, so I decided to use some JST clips to organize my wiring. I couldn't find any 16-terminal JST plugs, so figured having 4 sets of 4 would work just fine.


This is a 4-wire JST clip set.


Not satisfied with having the clips dangling about, I did some test printing and built a holster for the clips.


Perfect fit! However, this holster was just a proof-of-concept. I wanted to make sure they would fit properly so I can build an Arduino housing model that would incorporate the design.


And here's a shot of the prototype of the Arduino housing. You can see the brackets that I've reused from the LCD clips, as well as the JST holster.


And the arduino+multiplexer perf board fits perfectly.


And here's a tall lid for the enclosure.

At the time of this writing, I'm still trying to figure out how to pull it all together neatly. Right now, I've just thrown it all onto a piece of plywood. It works, but this is not likely the final product.


On the left is the Raspberry Pi, connected by HDMI to the LCD driver housing in the center. On the right is another project - it's going to be the power supply for the whole thing. The LCD screen requires a 12v power supply - no problem. The Datsun 510, like most cars, has a 12v battery. I'll need to include a voltage regulator circuit to address voltage spikes and reversals, since that'll destroy my electronics. The Arduino and the rPi, on the other hand, only need 5 volts, so I have a switching converter to create a 5v power supply. This is particularly useful because several of my sensors need a 5v source as well: the MAP sensor (boost sensor), for example. The Arduino also accepts 0 to 5 volt inputs, so building voltage divider circuits from here is also important.


Here, I have the Arduino hooked up and ready to go.


The Raspberry Pi is loading...


And we're in X-Windows on the Raspberry Pi.


And here's the Arduino IDE serial monitor, and it's correctly reading the values from the rPi and multiplexers. There's no sensor data at the moment, so all the inputs read high. They would read low if they were grounded, and they would read correctly if they were connected to sensors properly.


And lastly, here's the custom gauge cluster I coded. The tachometer is from an image of a Nissan Skyline tach; the Fuel Level, Oil Pressure, and Water Temp gauges were just cobbled together from some generic images online. I drew up the Boost gauge, and it may change to fit the scheme better. Once I have some data coming in from my accelerometer, I'll have the "g-force meter" working properly as well. This is all done within Perl/Tk.

Stay tuned. More to come.

comments [0]

np category: 510
technorati tags:

SHEET METAL WORK

2016-03-29 15:50:54
by: jovial_cynic
Because I've become comfortable cutting up the Datsun 510 and welding it back together, I decided to try my hand at some panel repair.

A couple of years back, I tore apart the rear panel of my car to address a significant bondo issue. As in, there was too much of it, and it just needed to be removed. This time around, I decided to fix a portion of the rear passenger panel. This actually required a bit more work, because I had to fabricate the 510's signature lines.

Now, I could have bought a replacement panel from Futofab, and this particular piece would have only been about $100. However... I do like doing things myself and learning in the process, so... here we go.

Between my bead roller and some careful hammering, I got pretty close:



And here's the reason I needed to make that panel:



It's pretty amazing how much better this looks... and it's not even attached to the car yet. Having a straighter line makes a world of difference.



Here it is welded up. You can tell it's not perfect, but it's so much better, and I don't mind correcting the minor errors with a little bit of filler.



comments [0]

np category: 510
technorati tags:

R33 CLUSTER IN THE SR20DET 510

2015-06-03 20:55:50
by: jovial_cynic
My latest project with my 510 has been to get the instrument cluster from an R33 Skyline (RB25DET motor) into my car, and hooking it up to my SR20DET motor. I don't think anybody else has done this, and from the responses I've received when I've mentioned it, I don't think it's a popular modification. It's just not "period correct," as I've heard it said... which is odd, because the engine isn't exactly period-correct either.




Anyhow, I picked this instrument cluster because it has all the gauges that I like in one place without having to include a bunch of separate gauges. I especially like the boost gauge... although that particular gauge has been giving me a bit of trouble.

I looked all over the place online and found a few places where somebody has explained the wiring of the cluster, and at least one place that gave a rough explanation about how the boost sensor itself is wired, but I didn't find anything that spelled it out for me in a way that made sense.




So... between following all the traces on the back of the cluster, putting together the complete wiring diagram, I was able to actually put something together that should help me figure this thing out.




The image above is the FULL diagram with the boost gauge lines colored in so I could see what was going on. It's a 5mb+ image, so click at your own risk.




The odd thing is that after going over the diagram and the cluster for hours, I finally figured out that the diagram is wrong. The diagram and chart above spells it out a bit; the plug on the far-right is written in exactly backwards (instead of 1-to-12, it's 12-to-1). So, I put my own chart together and hopefully that makes it easier for me (and anyone else doing this) to figure the wiring out.



comments [0]

np category: 510
technorati tags:

GAS TANK UPGRADE

2015-01-27 17:06:34
by: jovial_cynic
The stock 510 gas tank doesn't have a built-in fuel pump. There are some debates about the benefits of in-tank or external fuel pumps, but in the end, I think I prefer the in-tank pumps because they are quieter. And while it seems like extra work to have to pop open a tank to access the pump if anything goes wrong, I've messed with this one enough times to tell you that it's just a matter of pulling a few bolts. It's really not that big of a deal.


Cutting a proper hole into the top of the stock tank takes a steady hand. If you're going to use a plasma cutter, you MUST either fill the tank with water or flood it with an inert gas so you don't blow yourself up. Even the tinest bit of gas fumes can wreck your day or KILL YOU if you don't protect yourself.


I picked up a whole 1995 Honda Civic gas tank for $20 and cut the pump access off of it and welded it on top of the hole I cut out for the 510 tank. Again, because you are welding in a potentially deadly environment, either flood the tank with water or an inert gas to protect yourself. DON'T DIE doing this.


Once the pump access is welded on, bolting down the seal is easy. And all the wiring for the pump is right there on top.

comments [0]

np category: 510
technorati tags:

SR20DET FITMENT

2015-01-27 16:52:36
by: jovial_cynic

The first part of getting an SR20DET into a 1971 Datsun 510 is (aside from actually acquiring one) is figuring out how to get the engine into the engine bay. It wasn't meant to be in there.


Problem #1 is that the stock 510 crossmember is backwards relative to the oil sump on the SR20 engine.


Cutting and flipping is a common option. I decided to cut and reinforce with some 1" square tubing I had sitting around. I don't know why.


Here you can see the crossmember attached to the car, but if you look closely at the left side motor mount, you can see something wrong.


The stock mounts don't line up with the SR20, so some modifications were necessary.


Specifically, I had to add some length to both motormounts to get it to stand off from the crossmember enough to fit. I also had to make sure that this didn't make the engine sit too tall to close the hood. We're good.


And here you can see it fitting up just nicely.

comments [0]

np category: 510
technorati tags:

2015-01-27: SR20DET RELAY BOX 2015-01-27: NEW SEATS 2015-01-27: FINGER CHOPPING FAN BLADE 2013-05-20: ADVENTURES IN BODYWORK 2012-12-02: BEAD ROLLER 2010-10-03: PAINT JOB RESULTS: GOOD ENOUGH 2010-09-27: RUSTOLEUM PAINT JOB 2010-03-20: JUST AN INCH 2010-02-27: SIDE SHOTS 2010-02-27: MORE ODDS AND ENDS 2010-02-20: ODDS AND ENDS 2010-01-30: DATE AT THE JUNKYARD 2009-12-02: JUNKYARD HEAVEN 2009-11-29: FISCH ART 2009-10-24: LIGHT AT THE END OF THE TUNNEL 2009-10-14: FIVE DEGREES 2009-10-12: DIY DYNO RUN 2009-09-29: FUEL PUMP SPACER 2009-09-27: ALL ABOUT TIMING 2009-09-12: TWO WIRES 2009-05-09: NEW KICKS 2009-04-26: BY THE SEAT OF MY 510 2009-04-20: DATSUN 510 PICTURES 2009-04-08: BACK ON THE ROAD 2009-03-15: MORE DRIPPING 2009-02-24: HERE A DRIP, THERE A DRIP 2009-02-17: NISSAN/DATSUN TRANSMISSIONS 2009-02-16: ENGINE AND TRANNY 2008-11-21: REAR WINDOW INSTALLED 2008-11-06: RING GEAR INSTALLED 2008-10-23: NEW ALTERNATOR 2008-10-23: PULLED THE RING GEAR 2008-10-20: PULLING THE ENGINE 2008-10-20: REMOVING THE ENGINE AGAIN 2008-10-18: MAKING IT SAFE 2008-08-05: RAT OF A CAR 2008-06-28: BANJO 2008-06-24: TINKERING 2008-06-19: CLUTCH MASTER CYLINDER 2008-06-17: ON THE ROAD AGAIN 2008-02-02: SPEED BLEEDERS 2008-01-27: DRIVING AROUND AGAIN 2008-01-26: THROTTLE CABLE 2008-01-26: TIMING SORTED OUT 2007-11-17: TIMING THE DISTRIBUTOR 2007-11-16: ELECTRONIC DISTRIBUTOR 2007-10-25: SMALL PROGRESS 2007-08-06: RADIATOR: THE CONTINUING SAGA 2007-07-30: WRONG ABOUT THE RADIATOR 2007-07-28: NO RADIATOR SWAP 2007-06-30: ACHIEVED IDLE 2007-06-23: BACKFIRE 2007-06-23: SHE'S RUNNING! 2007-06-22: COOLANT LINES 2007-06-17: SU CARBS INSTALLED 2007-05-14: LOTS OF PICTURES 2007-04-20: SU CARBS 2007-04-17: VACUUM LEAK 2007-04-15: EXHAUSTING EXHAUST WORK 2007-04-12: FLEX TUBE != EXHAUST PIPE 2007-04-11: AROUND THE BLOCK 2007-04-09: RUNNING SMOOTH 2007-04-09: SHE LIVES! 2007-04-06: WATER, WATER, EVERYWHERE! 2007-04-02: INCHES AWAY 2007-03-29: WHOLE LOTTA NOTHING 2007-03-17: CAR PORN 2007-03-08: ROUND AND ROUND WE GO 2007-03-04: PAPER 510 2007-02-28: PROBLEMS WITH EVERYTHING 2007-02-16: ELECTRICAL GREMLINS 2007-02-14: ENGINE INSTALLED. AGAIN. AGAIN. 2007-02-13: EARLY BIRD GETS THE CAR DONE 2007-02-08: COMPRESSION RATIO? 2007-02-05: STARTER ISSUE FINALLY RESOLVED 2007-02-02: EXTERIOR FRAME: RADIATOR SUPPORT 2007-01-30: PLANS FOR THE EXTERIOR FRAME 2007-01-29: MEASURE TWICE, CUT ONCE 2007-01-29: EXTERIOR FRAME TOO WIDE 2007-01-27: OUT OF BODY EXPERIENCE 2007-01-24: PREP WORK FOR SECOND INSTALL 2006-12-24: NEW YEARS PLANS 2006-12-01: PAINT? 2006-11-04: NEW CLUTCH KIT 2006-11-04: ROADSTER CLUTCH KIT 2006-10-05: BUILDER'S BLOCK 2006-10-02: CHOP CHOP 2006-06-05: THROWING MONEY AWAY 2006-05-06: TRANSMISSION MOUNTED 2006-05-05: MORE ENGINE WORK 2006-05-05: ENGINE INSTALLED 2006-04-30: ASSEMBLY NEARLY COMPLETE 2006-04-14: NEW TIMING CHAIN 2006-04-14: CHEAP TIMING CHAIN 2006-04-13: WORKING ON THE CAR 2006-04-13: STRUTS WILL WORK! 2006-04-12: MAXIMA STRUTS 2006-04-10: MORE CAR WORK 2006-04-10: NEW SEAT 2006-03-10: NEW FRONT COVER 2006-01-22: CLEANING UP THE HEAD 2006-01-15: PISTONS INSTALLED 2006-01-13: BREATHING IS NICE. 2006-01-09: MILLING BY HAND. 2006-01-07: PUTTING IT TOGETHER. AGAIN. 2005-12-28: RODS SAVE THE DAY 2005-12-24: CRANKSHAFT INSTALLED. 2005-12-24: OOPS. WRONG PISTONS. 2005-12-23: PROGRESS! 2005-12-22: PUTTING IT TOGETHER. SLOWLY. 2005-12-16: HEADER... WEEE! 2005-12-15: STILL NO MAIN BEARINGS. 2005-11-28: GAH! WRONG BEARINGS! 2005-11-18: UGH. THIS IS EXPENSIVE. 2005-11-06: FUN AT THE MACHINE SHOP 2005-10-18: NOT USING THE KA 2005-10-06: CRANK IS IN 2005-09-22: KA/Z/L2.1 2005-08-06: CHEAP ALTERNATOR 2005-08-01: BAD ALTERNATOR? 2005-07-25: ALTERNATOR INSTALLED 2005-07-20: JB WELD FOR EVERYTHING! 2005-07-18: DOOFUS = ME 2005-07-13: TACH INSTALLED 2005-07-11: GAUGE CLUSTER INSTALLED 2005-07-07: CLUTCH PUSHROD 2005-07-04: GROUND STRAP ISSUES 2005-06-30: IDLE ACHIEVED - YAY GASKET SEALER! 2005-06-26: NOT QUITE THERE... 2005-06-25: CARB TROUBLES 2005-06-24: FIRED IT UP