When you click on links to various merchants on this site and make a purchase, this can result in this site earning a commission. Affiliate programs and affiliations include, but are not limited to, the eBay Partner Network.
Any way to keep Tablet install turned on during Engine Start
This isnt in the TL but I have a Nexus 7 installed in another vehicle and have it wired into the factory radio harness. The tablet turns on when it gets power and turns off when the power gets turned off. On this vehicle it stops sending power to the radio when the key turns to start the engine. Because of this sometimes the tablet gets out of sync with Tasker and stays on when I turn the vehicle off. Is there a way to keep power supplied during those few seconds of engine cranking?
1. Delay power for tablet. I did it for my install. Check my last post (#16) in this thread ("Yet another Nexus 7 installation. '07-'08 no-navi TL specific.") :
I had problems with old battery as it was lower capacity than I anticipated so I removed it. "Something to 9V converter" is connected to 5V line from charger.
Code is modified to :
It's simple program to delay the tablet from getting power at the second time.
By default it uses pin #12 for output and pin #2 for input.
Share as you want, just leave my name at the top.
One part of the script (sleep function to be precise) is taken from playground.arduino.cc.
*/
int relayPin = 12; //pin used for signaling the relay to send power to the tablet
int sensePin = 2; //pin used for detecting the power from the car
//bool delayEnabled = false; //bool for delaying second power-up
int firstDelay = 2000; //amount of ms to delay before sensing and powering up tablet for the first time
//int secondDelay = 3000; //(...) for the second time
//int secondDelayCounter = 0;//used to reset delayEnabled if there's no power for some time
//int sleepDelay = 30000; //amount of ms before going to sleep
//int sleepDelayCounter = 0;//used to keep track of time
//will execute at the wakeup, I'm leaving it blank
//void atWakeup() {
//
//}
//
////puts arduino to sleep to save the battery, "borrowed" from playground.arduino.cc
//void sleep() {
// //blink red LED, used only for test, you might want to remove it
// for (int i = 0; i < 5; i ++) {
// digitalWrite(LED_BUILTIN, HIGH);
// delay(100);
// digitalWrite(LED_BUILTIN, LOW);
// delay(100);
// }
//
//
//
//
// set_sleep_mode(SLEEP_MODE_PWR_DOWN); // sleep mode is set here
// sleep_enable(); //"enables the sleep bit in the mcucr register"
//
// // use interrupt 0 (pin 2) and run function
// // wakeUpNow when pin 2 gets HIGH
// attachInterrupt(digitalPinToInterrupt(2), atWakeup, HIGH);
//
// // here the device is actually put to sleep!!
// // THE PROGRAM CONTINUES FROM HERE AFTER WAKING UP
// sleep_mode();
//
// // first thing after waking from sleep:
// // disable sleep...
// sleep_disable();
//
// // disables interrupt on pin 2
// detachInterrupt(0);
//}
//standard arduino function, performed once at the startup
void setup() {
pinMode(LED_BUILTIN, OUTPUT);
pinMode(relayPin, OUTPUT);
pinMode(sensePin, INPUT); //will be used for input from power
//
// Serial.begin(9600);
//
// attachInterrupt(digitalPinToInterrupt(2), atWakeup, HIGH);
}
//sets relayPin to high and turns on LED
void powerUp() {
digitalWrite(relayPin, HIGH);
digitalWrite(LED_BUILTIN, HIGH);
}
//sets relayPin to low and turns off LED
void powerDown() {
digitalWrite(relayPin, LOW);
digitalWrite(LED_BUILTIN, LOW);
}
//simpler version for checking if there is power at sensePin
bool isPower() {
if (digitalRead(sensePin) == HIGH) return true;
return false;
}
//standard arduino function, will complete all the time
void loop() {
//check if there's power
if (isPower()) {
//first thing : reset sleep counter
// sleepDelayCounter = 0;
// //if it's second power-up, delay it for couple seconds
// if (delayEnabled) {
// delay(secondDelay);
// }
// //if it's first power-up
// else {
delay(firstDelay);
// }
//check if there's power again
if (isPower) {
//finally power up the relay
powerUp();
//do a loop while relay is powered to prevent the rest of the function from executing
while (isPower()) {
delay(1);//wait some time before rechecking
}
//assume that there's no power anymore :
powerDown();
//set second delay bool
// delayEnabled = true;
}
}
//if there's no power count down to reset delayEnabled bool
else {
//if delayEnabled is set
// if (delayEnabled) {
//
// //wait around 10 seconds before resetting it :
// if (secondDelayCounter < 10000) {
// secondDelayCounter += 1;
// delay(1);//wait 1ms
// }
// //if enought time has passed :
// else {
// secondDelayCounter = 0; //reset counter
// delayEnabled = false; //reset power-up counter
// }
// }
//
// //that executes when the board is not doing anything
// else {
// //is it the time to go to sleep ?
// if (sleepDelayCounter >= sleepDelay) {
// sleep();
// }
// //if not, then continue counting...
// else {
// sleepDelayCounter += 1;
// }
// }
}
delay(1); //wait 1ms before doing the whole loop again
}
Basically all not needed stuff was commented (//).
If you turn the key on and start engine fast, tablet will not power at all before starting the engine -> no problem
If not, then tablet will power on -> engine is turning so power is off -> tablet goes to sleep -> engine in on, power is on -> delay of couple seconds before re-powering tablet -> tablet power on -> no problem !
It's overkill, as using two relays and arduino and this converter is just too expensive. It might be achieved by simple timer IC etc.
2. Something like that (paint hero) :
3. Some battery/capacitor and logic board and relay thing to keep charging the tablet even if there's no power. Probably too complicated.
Thanks! I figured I could just run an add a circuit to the ecu fuse or something that stays on during start and have that trigger a relay for the radio. I like the feature this vehicle has though where itll keep the radio on even when you remove the key until you open the door and Id lose that but its not a terrible loss because I dont usually sit around in it very often anymore like it did back in college or something.