Looking to do a few projects with my car

I downloaded the Arduino IDE to my Pi. Copy and pasted the program into the sketch area, and started looking through the code. I made some changes to the number of cylinders. The program was written for a 4 cylinder mine is 6 cyl.

The original program lit 4 LEDs in 4 stages I only need 2 stages so I took away 2 stages within the brackets and put the correct RPM I need in the 2 remaining stages.

I left 4 pins for output though. I have a feeling that only 2 pins will activate the way it is. I'll need to make a change so 2 pins go on at the first stage, then 2 more at the second stage.

Also the code was written to light LEDs and there is an LED_update_interval = 200, Which if I understand it correctly is for blinking at a certain rate. I just need the solenoid pins to be on at their perspective stages.

There is a bit of code about a rev limiter in there, set to blink the LEDs as a warning when it gets to 5800 rpm. I changed it to 6800, which is the number I need the valves to close at. So I need to change what happens at the rev limiter to full off which would close the solenoids and turn off the LEDs.

Do I use the brackets to drop the entire code in so you guys can see. Having a hard time determining what is or isn't relevant to show with all I got up here. This goes more to new, (to me,) forum etiquette :smiley: Let me know

One Arduino has arrived. It has a usb connection on it, is that only good for power or can I program through it?

I have 2 more arduinos on the way. I wanted to use one to simulate RPMs for testing the main project. Should I use a simple Blinking LED program controlled by a Pot. for my signal simulator? If I'm calculating correctly 4k rpms (6 cyl = 3 sparks per rotation = 360 crank degrees= 12k sparks per minute,) should work out to 200 sparks per second. So I'd need that as an output anywhere from below 4000rpm to just above 6800 should cover all I need for this.

Slowly figuring out how the original program worked and tweaking and copy/pasting into my own version
There's a bool revlimiter false in the program that causes the LEDs to blink in the original program. I'd like to edit that that out and replace the bool with a simple both solenoids or pins off when RPMs get to 6800, no flashing. Do I need a true/false statement for 6800 rpm?

Update: I bought an UNO R3 from the store, a dual relay device, breadboard and test leads. This allowed me to program blink and blink without delay, without having to disassemble something for an LED. Once I'd tinkered with that for a bit I figured out how to program the pro micro I bought. Since I still didn't have an LED I figured out how to test the pro micro using the dual relay board, using one of the blink programs. It all seems to be working. I also soldered the legs on (drawing a blank on the actual name atm,) took about 2 min for all 24, they're straight and level. I can see this becoming a competitive sport someday. Gas soldering iron, get one.

Programming side of things, I found a tach simulator program so I should be able to use that to test my main Arduino project. Got a voltage regulator too.

As to the car, I have to rebuild my spare engine to use temporarily. I damaged the crankshaft a little. Ironically at low rpms, due to having poor idle quality for about a year. This caused the crank pulley to get hammered back and forth, breaking the woodruff key. The woodruff key is made of a softer metal and is used to lock the pulley in place. Anywho my nitrided forged steel crank got a little dinged in the keyway. Hopefully this can be repaired and cleaned up. I have another crankshaft, but swapping crankshafts is not a simple process and I'd have to pay more than I did for the engine to get the whole assembly balanced so it won't shake itself to pieces in a year. Engine 1 has higher compression pistons so there's no hope that one set of pistons would match the weights of the others. Aaaand I stripped the threads out of a tensioner bolt hole. Once those 2 repairs are made the engine goes back in.

I'm also working on an automotive project (for older vehicles, but I understand what you're working on) and you're project is very simple. It's a good starter, for sure. Like you I started with zero knowledge of Arduino but I've been at this for 5 months and have learned a ton.

I would first work on figuring out RPM. That's actually my only hang-up. I have the working code for it, but I'm having trouble getting a noise-free source so that my readings don't go nuts. Ideally I'm looking for something that could either clip to the spark plug or go directly to the coil, but engines weren't designed to have very clean digital outputs.

After that you can wire up a couple relays. That part will be very easy- you can use digital pins to send signal out to a relay that will trigger your solenoid and thus your vacuum ports. You will just have to program the Arduino to send voltage when RPM is greater 4000 but less than 6800, etc.

I'll let you know if I find a good RPM solution!

What about some kind of filter to clean up the noise, like a rectifier? For me this is phase 1

Phase 2 I'm going to try basing an ignition system off of a converted distributor, light on one side, 6 sensors in the cap, with a disc with a hole in it to trigger the sensors. Can't be any less reliable than the factory distributor :smiley: Anyway, wasted spark or coil on plug, we'll see.

No rectifier normally.
More likely you'll be using a Schmitt trigger. Those are great for cleaning up digital signals.
That said, I wouldn't want to connect a spark plug signal directly to an Arduino. Better put an optoisolator in between.
A small capacitor may also work in this case, but you risk filtering out your wanted signals in the process.

For specific suggestions on how to clean up the signal you will first have to figure out what the signal looks like: how big is the noise, what are the highest peaks, how long is the pulse you want to measure, how long are the noise peaks.