New gauges programming.

I got a fair amount accomplished with programming the gauges today. At least the temp gauge at any rate. I didn’t do anything with the fuel gauge)Thermistors are fickle little things that don’t lend themselves to easy programming for a novice. They don’t have a linear resistance profile that would make them easy to read from. They are logarithmic.

There are equations that can relate the ADC input in the microcontroller to the real temperature, but I don’t need actual temperatures, as I’m only driving a dummy gauge. Close enough is good enough. The actual engine temp is calculated in the Megasquirt and I don’t have to program that thankfully.

I do however have a sheet that shows what the resistance reads at various temperatures, and from that I can calculate the ADC, and from that I can assign a position in the stepper motor.

I used a function called a “MultiMap” in Arduino. It allows me to assign certain inputs to certain outputs, and between the points are linearly approximated. For example, I know that at operating temp (190F) I want the needle to point right to the first line on the gauge. 230F I want at the beginning of the overheat, and 240F I want the needle pegged at the top. I’ll probably set it to flash some warning lights as well when it starts to overheat.

The points on the gauge aren’t linear with the temperatures I want for them so writing an equation is out of the question.

At first I was calculating what the ADC input would be at a given temperature with a given bias resistor by hand, but after doing that for 20 minutes I realized Excel should be able to make quick work of it.

I spent 2 hours writing the formulas in the sheet and teaching myself how to use the “concatenation” capabilities, but it was weĺl worth it. Depending on which bias resistor I choose for the top half of the voltage divider, I could gain resolution in the higher temps. But the downside is the circuit then consumes more power. Because I’m not displaying ACTUAL temperature, I don’t really need too much resolution. Right now I’m using a 2.2k bias resistor, but I’m going to lower it to 680 ohms when I design the actual board. That will be a very easy change in the code thanks to the multimap generator I wrote.

I made up some SMD adapter boards that allow me to use my SMD components on my breadboard. That makes it so I don’t have to stock 2 of all my components (one through hole and one SMD) This way they all pack very nicely into my SMD parts organizer, and there’s zero risk of shorting out the long exposed legs on through hole resistors pushed into the breadboard. I still need to populate the rest of the boards though.

You can see in the pictures the screenshot of my Excel spreadsheet. I put in the values I want and it spits it out so all I have to do is copy and paste it, and it’s already in the correct format and syntax. I highlighted one of the output cells so you can see what the formula looks like to make it in case you need it for something else.

After I got the multimap generator finished I installed the GM temp sensor into my motor. The water neck has two spots for coolant sensors. One was no doubt for an emmissions computer, and the other for the gauge. My EFI tstat housing has three spots I believe. I hope to eventually drive all the gauges through the CANbus from the Megasquirt, but if that doesn’t work out, I can still discreetly measure everything I need.

I was able to put a lighter on the end of the sensor and drive the needle all the way up the scale, then it would slowly cool back to ambient.

The GM sensor has a 3/8NPT thread on it. The factory senders have some metric thread on it. Luckily the factory thread is very close in size to 3/8NPT so I just need to run the tap through it. I tapped it and installed the new sensor.

I have a battery powered USB phone charger that I use to power a cheap bluetoth receiver for my garage radio. I used that to power the Arduino and plugged it in to the sensor. It read exactly where I expected it to at around 75F. I’ll probably lower that point a little further towards the “cold” line.

I started the engine and let it idle for 20 minutes. It was extremely satisfying watching the the needle slowly creep up then stop right below the operating temp line. I must have a 180F or 185F thermostat in it. It’ll take ten seconds to change that datapoint in the multimap.

I also found the other fender mirror and debugged my electric mirror adapter board. I’ll send two of those boards off to be made, and I’ll post those details when I install and wire them up. But at least now I have two fender mirrors and shortly I’ll have a proper temp gauge!

I still need to cough up the $40 for the capacitive fuel level sender. That one will be a linear input and that will make it very easy to program the gauge. Physically installing it will be a different matter though. I’m not yet sure how I’m going to do that, but I’m sure it won’t be too tough once I get into it!

I drove the car to work the other day, (first recent time driving in the dark) and the headlights wouldn’t turn on. All the marker lights worked fine, and I could hear the relay clicking, but no power. I had to drive to work while pulling on the blinker handle because that made the brights turn on. First I disassembled the relay thinking it had dirty contacts. Everything was good. The headlight relay can be turned around and plugged in 180 degrees around, and that can help trouble shoot if the problem is in the relay. So I decided it must be on the steering column.

 

I knew the blinker switch assembly was the same as in my 77 Corolla that I just scrapped, so I grabbed that switch assembly and quickly plugged it in, and the headlights worked. So I assumed the entire assembly was bad. I pulled it apart and switched it out and after screwing in the new one, the lights didn’t work again. Turned out it was a slightly melted wire in the connector, then it dawned on me I had had the problem 6 years ago. I did a temporary fix on the wires, and they worked great. One more reason for a rewire.

 

I needed to change out the assembly anyway because the plastic piece that holds the horn contactor was broken. I took the opportunity to install my new OEM horn contactor I bought off eBay. Big difference! The new one came with a new spring, “C” clip, and the contactor itself.

 

You can see in the pictures some of the creative wiring I did when I installed the keyless entry system. Once upon a time it would blink the headlights and toot the horn when I locked and unlock it. The keyless entry will now lock the drivers door, but it won’t unlock it, and it does nothing with the passenger door. Oh well.

 

I also took some pictures on how to open up the ends of the headlight/blinker arm and the wiper arm. Many people don’t know how those open so I figured I’d show how.

We made it to the Utah Japanese Classic Car show yesterday. I’ve now put about 100 miles on the car, and the carburetor called down nicely with the fresh gas. It idles pretty well and doesn’t stall at all any more. The accelerator pump cleaned out with the sea foam and works like it should now.

There wasn’t really much interest in my car at the show. Not too surprised though because it doesn’t really look all that good. (Okay, okay it looks like crap!) But the point was to just get it there.

I need to make the gap in the VR sensor smaller, as it starts to break up around 4500 RPM. I already knew that was likely so no surprise there.

The water pump needs to be changed. It’s terrible noisy and rattly. It also leaks a little bit. But now I have time as I’m not rushing to meet a deadline.

I have a pretty loud valve click. I used my automotive stethoscope and it’s either #2 or #3 exhaust valve. I’m pretty sure it’s #2, but it’s definitely on the exhaust side. The click was there before so that’s not new.

It leaks oil, but not completely sure where from. I need to take it to a car wash and blast it clean. Then I should be able to see where it’s coming from.

While I was driving, my oil pressure light would randomly turn on, and my fuel pump would turn off. I have the oil pressure switch disconnected so I know that’s not causing it. Initially I would just play with a fuse and it would reset and turn the fuel pump back on. On the freeway I had about 10 seconds after the light turned on until the engine died.

After a couple times, playing with the fuse wouldn’t fix it so I pulled over and was going to just hot wire the pump until I got home, but it would mysteriously start working again. I eventually found out just turning the key off then back on reset it. Playing with the fuse apparently just pulled power momentarily and reset it, then stopped resetting because it had scratched the contacts enough that it no longer broke connection. I also think I burned up the fuel level gauge or sender. I put 12 volts to what I thought was the fuel pump connection, but it was the connection for the sender. So now I have no fuel level reading. I’m hoping it’s a bad gauge because I have spares of those, but I don’t have a spare sender. If the sender is bad I may just have to make my arduino gauge for the fuel level sooner rather than later.

Just some more electrical gremlins, and more reasons on the list pointing towards rewiring the entire car.

I developed an awful “squeak” while driving today. I recognized it because it had happened before in my corolla. The bolt holding the rotor to the back of the hub came loose and would rub once per revolution. It sounded particularly bad at lower speeds. I pulled the hub and I was right. It was a loose (and bent) bolt. I replaced it and put it all back together. I don’t think I’ve ever changed the rotors since I’ve owned it, so I don’t think it was me. But I don’t know for sure.

My son Mika was “helping” me work on the trunk popper. He found a length of wire and the correct male and female terminals. He brought me the wire strippers and crimpers and asked me to put the wire together. He was super proud when he put the wire in, and even happier when it popped with the button!

I also painted the headlight trims and grill with black truck bed liner. Same stuff I used on the taillight surrounds.

18RG running pretty well!

The motor would run well when cold, but as soon as it warmed up, it would run absolutely awful. It would misfire constantly and stall at every stop. Once it stalled it would be impossible to restart. I deduced it was ignition related. I hate distributors. I had converted this one to electronic ignition with parts from a 22R electronic distributor, so I knew there were no problems with the points (because there were none). The coil was new (Autozone special) so that wasn’t the problem. I changed all the wires with a known good pair and it didn’t change it. I still don’t know exactly what was causing it.

I bought an 18RG pulley with a 36-1 tooth wheel welded to it along with a VR sensor and sensor mount from my friend Stu many years ago. I ended up using the sensor on my 77 Corolla EFI conversion, and I lost the 18RG mount. 🙁

I just crushed the Corolla the EFI was in so I had the system sitting on the shelf. I decided to install the Megasquirt quickly just to control the ignition. When I convert the entire motor to EFI I’m going to use a Megasquirt MS3X and will have sequential injection and ignition. That will be different post though, and likely a winter project (because I’m DEFINITELY not driving it in winter any more!)

After I had it installed, the engine fire up immediately on the first crank! After cleaning up the install a little, (I put the Megasquirt at the passenger floor after pushing the wires through the grommet hole.

I pulled the factory distributor and plugged the 18RG dizzy hole.

photo 20150822_105056_zpszijuzar7.jpg

photo 20150822_105105_zpsczrosii9.jpg

I had to build a new VR sensor mount. Luckily it was very simple. Basically a bent piece with holes in it. 20 minutes and I had it ready.

photo 20150822_110044_zps05mcdui8.jpg

photo 20150822_110141_zps15rhphdc.jpg

photo 20150822_110217_zps1uuf1tul.jpg

I need to make this gap a bit smaller, but it works for now. (The RPM signal will likely start to break up at higher RPM’s with this big of a gap)

photo 20150822_110635_zpsbrzxd2gk.jpg

It ran when I had all this just sitting up on top. But I couldn’t drive it like that.

photo 20150822_111749_zpsrh7fx9jn.jpg

I pulled off the fender to route the wires inside. You can see some of my other “amazing” wiring work from 5 years ago when I did a wire tuck. It all works.

photo 20150822_112746_zpswei5k1yt.jpg

photo 20150822_115045_zpsoghxhxlt.jpg

I modified these Megasquirt wiring diagrams to fit what I did with my harness.

photo 20150822_110826_zpsop6cwiod.jpg

photo 20150822_110833_zpsrinxx1sj.jpg

I drove it 10 miles today in a single drive and it didn’t stall once! So I *think* it’s ready to go to the car show tomorrow. 🙂

I could only find one of my fender mirrors. The other has just disappeared. My son probably hid it somewhere. I’ll show some more pictures later today.

Anybody need an electronic 18RG distributor?

For some reason Tumblr doesn’t like the photos from my thermal imaging camera, so I’ll try to upload them later today.
 

I used the thermal imaging camera to find out which cylinder was dead. It was #4. I pulled and cleaned the spark plug and boot with brake cleaner to get the residual oil off thinking it was grounding through the oil. No go. Switched plugs with #3 to see if the misfire moved, no go. Switched wires and the misfire moved to #3. Checked the wire and everything appeared fine. They were only used for about 4 months before I parked the car in 2011, so they’re oldish, but haven’t been used much.

 

Put in an old wire from my Corolla and bingo the problem went away and it ran much better!

 

You can see in the thermal images where blue is cold, and green/red is warmer. #4 was dead cold. You can also see when I switched the wires how #3 starting going cold and #4 was warming up.

 

After I put in the Corolla wire and had all four going, I found #2 exhaust runner to be quite a bit colder than the rest. That means it’s running richer, and can surely be attributed to the non equal length runners in my awesome homemade manifold! Oh well. Fuel injection will solve that.

 

I also used an ultrasonic leak detector and found a monstrous vacuum leak at the base of the carburetor. I did what you shouldn’t do and just smeared some silicone on the outside of it, and it went away. The engine immediately calmed right down. Took it for a drive around the block again and it didn’t die a single time!

 

I got the interior cleaned out (there was a lot of junk in there!) I repainted the taillight surrounds with truck bed liner as well. I painted them four years ago with black VHT wrinkle paint, and they turned gray and the paint started flaking off within a couple months. The wrinkle paint has completely peeled off both chrome surrounds so that’s why I paint them with truck bed liner. No pictures in today’s post though, I’ll have pictures of them tomorrow.

 

Nate

Drove it around the block for the first time in four years! It died several times on me though.

When I made the manifold I didn’t put in a vacuum nipple for the brake booster so brakes were tough. I drilled and tapped a 1/8NPT hole in the #4 runner and very carefully used a magnet to get all the metal shavings out of the hole. I applied silicone to the threads on the fitting and screwed in a barbed fitting and now the brakes work again! 🙂

You can see in the pictures that the #3 and 4 spark plug tubes are FULL of oil. Amazing it even ran. I pulled the valve cover and made new gaskets with cork material. I wish I had a laser cutter. I could have drawn them up and cut them quicker with that than the time it took me to do it with scissors and a blade. Oh well, hopefully I can get it soon.

Cleaned all the oil out and reinstalled it. No more leaks!

I installed the new fuel pump and it works great now. No bottle feeding gas to the motor.

The Weber carb came from a 20R which is a 2.2 liter, but the 18RG is only a 2.0 so I know it’s not jetted correctly. I have a misfire at idle, and it smells very rich, but in order for it to run well, I need to close the choke (thereby making it richer). So I’ll need to troubleshoot the misfire. I can borrow a thermal imaging camera from work so I should be able to see temperature differences in the runners on the exhaust manifold. (The misfiring cylinder should be cooler than the others.)

My 4 year old son was helping me the entire time, and is very interested in taking things apart. We have to hide all my screwdrivers because he’ll take apart anything with a screw, including plug and switch covers in the house. 🙁