Another problem that I have run into while working with this Bluetooth auto start is an erratic crank behavior. Per the code, it should not start the crank circuit if the engine is already running. However, on 2 occasions, it happened anyways. I was not plugged in with a laptop at the time, so I don’t know what the issue was, and I can’t go back in time to hook up and review the logs.

IMG_20180723_071854

Notice that the white auto start box is gone. I’ve relocated it to the glove box.

I plugged in the laptop and went through the functions and processes again. The only thing I can come up with is if the “runbool” flag did not get set somehow, and it didn’t believe that the truck was running. So, I decided to add yet another layer of safety.

Here is what I came up with:

 

@@ -174,16 +174,16 @@ void loop(void) {


if (startTimer == 0 && startAttempts > 0) {

if (voltVoltage >= 0.9) {

// Turn everything off because it is running.

// Turn everything to a run state because it is running.

// I had to add this as a safety. Once or twice this cranked when it shouldn’t have,

// before this code existed. Now it can’t crank without checking first!

digitalWrite(16, LOW);

digitalWrite(15, LOW);

digitalWrite(7, HIGH);

digitalWrite(11, HIGH);

digitalWrite(7, LOW);

digitalWrite(11, LOW);

crankTimer = -1;

startTimer = -1;

runTimer = -1;

runTimer = 600; // We are here because something messed up, but set the clock to 10 minutes.

startAttempts = -1;

Serial.println(” Already running! “);

} else {
… …
@@ -194,7 +194,7 @@ void loop(void) {

Serial.println (” crankTimer ON “);

}

} else if (startTimer == 0 && startAttempts == 0) {

// Turn everything off from to many attempts.

// Turn everything off from too many attempts.

digitalWrite(16, LOW);

digitalWrite(15, LOW);

digitalWrite(7, HIGH);
… …
@@ -220,7 +220,7 @@ void loop(void) {

Essentially, I am just running one last voltage check right before turning on the cranking power. If the voltage is above 13 volts, the engine must be running, so I don’t want to crank.

Using voltage this way is somewhat risky, because it is possible that the charging circuit of the car is not working, and voltage has depleted, causing the cranking circuit to engage the already running motor that just isn’t charging the battery. That is why I would like to pursue some sort of tachometer sensor input.

Until then, I think this will keep me (relatively) safe, as long as the vehicle charging system works properly.

Linux – keep it simple.

Leave a Reply

Your email address will not be published. Required fields are marked *