Tablet install to replace sat nav (Build thread)

sk93 said:
working sketch:

Code:
#define OPEN_BUTTON 6
#define CLOSE_BUTTON 7
#define STEP_OPEN 2
#define STEP_CLOSE 4

void setup() 
{

  //establish switch pins
  pinMode(OPEN_BUTTON, INPUT_PULLUP);
  pinMode(CLOSE_BUTTON, INPUT_PULLUP);
  pinMode(STEP_OPEN, INPUT_PULLUP);
  pinMode(STEP_CLOSE, INPUT_PULLUP);
  
   //establish motor direction toggle pins
  pinMode(12, OUTPUT); 
  pinMode(13, OUTPUT);
  
  //establish motor brake pins
  pinMode(9, OUTPUT); 
  pinMode(8, OUTPUT); 

}

void loop(void)
{
  int switchValue;

  switchValue = digitalRead(OPEN_BUTTON);
  if (switchValue==LOW)
  {
    //screenUp();
    sk93_screenUp();
  }
  switchValue = digitalRead(CLOSE_BUTTON);
  if (switchValue==LOW)
  {
    sk93_screenDown();
  }
  switchValue = digitalRead(STEP_OPEN);
  if (switchValue==LOW)
  {
    stepOpen();
  }
  switchValue = digitalRead(STEP_CLOSE);
  if (switchValue==LOW)
  {
    stepClose();
  }
}


void sk93_screenUp(void)
{
  for (int i=0; i < 14; i++)
  {
    digitalWrite(9, LOW);  //ENABLE CH A
    digitalWrite(8, HIGH); //DISABLE CH B

    digitalWrite(12, HIGH);   //Sets direction of CH A
    analogWrite(3, 255);   //Moves CH A
  
    delay(25);
  
    digitalWrite(9, HIGH);  //DISABLE CH A
    digitalWrite(8, LOW); //ENABLE CH B

    digitalWrite(13, LOW);   //Sets direction of CH B
    analogWrite(11, 255);   //Moves CH B
  
    delay(25);
  
    digitalWrite(9, LOW);  //ENABLE CH A
    digitalWrite(8, HIGH); //DISABLE CH B

    digitalWrite(12, LOW);   //Sets direction of CH A
    analogWrite(3, 255);   //Moves CH A
  
    delay(25);
    
    digitalWrite(9, HIGH);  //DISABLE CH A
    digitalWrite(8, LOW); //ENABLE CH B

    digitalWrite(13, HIGH);   //Sets direction of CH B
    analogWrite(11, 255);   //Moves CH B
  
    delay(25);
  }
  
  //set all pins off after operation
  digitalWrite(8, LOW); //DISABLE CH B
  digitalWrite(12, LOW); //DISABLE CH B
  digitalWrite(9, LOW); //DISABLE CH B
  digitalWrite(13, LOW); //DISABLE CH B
  analogWrite(3,0);
  analogWrite(11,0);
}

void sk93_screenDown(void)
{
  for (int i=0; i < 14; i++)
  {
    digitalWrite(9, LOW);  //ENABLE CH A
    digitalWrite(8, HIGH); //DISABLE CH B

    digitalWrite(12, HIGH);   //Sets direction of CH A
    analogWrite(3, 255);   //Moves CH A
  
    delay(25);
  
    digitalWrite(9, HIGH);  //DISABLE CH A
    digitalWrite(8, LOW); //ENABLE CH B

    digitalWrite(13, HIGH);   //Sets direction of CH B
    analogWrite(11, 255);   //Moves CH B
  
    delay(25);
  
    digitalWrite(9, LOW);  //ENABLE CH A
    digitalWrite(8, HIGH); //DISABLE CH B

    digitalWrite(12, LOW);   //Sets direction of CH A
    analogWrite(3, 255);   //Moves CH A
  
    delay(25);
    
    digitalWrite(9, HIGH);  //DISABLE CH A
    digitalWrite(8, LOW); //ENABLE CH B

    digitalWrite(13, LOW);   //Sets direction of CH B
    analogWrite(11, 255);   //Moves CH B
  
    delay(25);
  } 
  
  //set all pins off after operation
  digitalWrite(8, LOW); //DISABLE CH B
  digitalWrite(12, LOW); //DISABLE CH B
  digitalWrite(9, LOW); //DISABLE CH B
  digitalWrite(13, LOW); //DISABLE CH B
  analogWrite(3,0);
  analogWrite(11,0);
  
}


void stepOpen(void)
{
  if (digitalRead(STEP_OPEN)==LOW)
  
  digitalWrite(9, LOW);  //ENABLE CH A
  digitalWrite(8, HIGH); //DISABLE CH B

  digitalWrite(12, HIGH);   //Sets direction of CH A
  analogWrite(3, 255);   //Moves CH A
  
  delay(1000);
  
  digitalWrite(9, HIGH);  //DISABLE CH A
  digitalWrite(8, LOW); //ENABLE CH B

  digitalWrite(13, LOW);   //Sets direction of CH B
  analogWrite(11, 255);   //Moves CH B
  
  delay(1000);
  
  digitalWrite(9, LOW);  //ENABLE CH A
  digitalWrite(8, HIGH); //DISABLE CH B

  digitalWrite(12, LOW);   //Sets direction of CH A
  analogWrite(3, 255);   //Moves CH A
  
  delay(1000);
    
  digitalWrite(9, HIGH);  //DISABLE CH A
  digitalWrite(8, LOW); //ENABLE CH B

  digitalWrite(13, HIGH);   //Sets direction of CH B
  analogWrite(11, 255);   //Moves CH B
  
  delay(1000);
}


void stepClose(void)
{
  if (digitalRead(STEP_CLOSE)==LOW)
  
  digitalWrite(9, LOW);  //ENABLE CH A
  digitalWrite(8, HIGH); //DISABLE CH B

  digitalWrite(12, HIGH);   //Sets direction of CH A
  analogWrite(3, 255);   //Moves CH A
  
  delay(1000);
  
  digitalWrite(9, HIGH);  //DISABLE CH A
  digitalWrite(8, LOW); //ENABLE CH B

  digitalWrite(13, HIGH);   //Sets direction of CH B
  analogWrite(11, 255);   //Moves CH B
  
  delay(1000);
  
  digitalWrite(9, LOW);  //ENABLE CH A
  digitalWrite(8, HIGH); //DISABLE CH B

  digitalWrite(12, LOW);   //Sets direction of CH A
  analogWrite(3, 255);   //Moves CH A
  
  delay(1000);
    
  digitalWrite(9, HIGH);  //DISABLE CH A
  digitalWrite(8, LOW); //ENABLE CH B

  digitalWrite(13, LOW);   //Sets direction of CH B
  analogWrite(11, 255);   //Moves CH B
  
  delay(1000);
}


I've a few bugs to fix on the auto open/close on power part.. so once i've nailed that (probably saturday), I'll share that here too

Perfect, thank-you!
 
So the relay would be triggered by 12v antenna signal but close a circuit that runs on 5v. Would it be easier to use a voltage step down module to achieve the same purpose? Either way, doesn't seem too complicated. Looking forward to the sketch that includes provisions for power.

Edit: the delay of 25ms seems to be the only difference between your two sketches.. are you guys going to try even lower for a smoother action?
 
igeak691 said:
So the relay would be triggered by 12v antenna signal but close a circuit that runs on 5v. Would it be easier to use a voltage step down module to achieve the same purpose? Either way, doesn't seem too complicated. Looking forward to the sketch that includes provisions for power.

Edit: the delay of 25ms seems to be the only difference between your two sketches.. are you guys going to try even lower for a smoother action?


you're correct about the 5v circuit, but you'd take the +5v from arduino, as it has a steady +5v pin specifically for that - no need for a stepdown.
you'd really need to be careful with any other external powersupply into the arduino, as they're only rated for a very minute amperage.


In regards to the differences - they look similar on the surface, but mine includes the required loop to get it to open and close fully (with the correct number of steps :P), it also turns off the motor after the procedure has been run.
two small, but very important changes :thumbsup:


I did try and lower it below 25ms, but I was getting issues with the motor keeping up - it would occasionally miss a step or seamingly go the wrong way.
25ms turned out to be the optimum for speed/smoothness vs reliability
 
As I look more into it the step down is a really bad idea especially for automotive use where the power fluctuates so much. Any normally open relay circuit triggered by 12v should work right? Seemed like it was more complicated while reading with zener diodes and octocouplers

Can I see what you've got going with the sketch and also what bugs you still have to work out for it? Want to see how code is different for something with constant power vs a button press.
 
Here's what I have installed so far:

m8kbo0.jpg


Took a whole day basically to get it all set up, but it looks good at least.

Functionality is 90% there. Using proximity sensor, I have it turn off the screen when its in closed position, and turn on the screen when it gets flipped up. Still have to work on the arduino setup, waiting for motor shield.
 
looking good.. the only bit I don't like is the white showing behind the two drilled holes.
Have you considered using plastidip to recolour the tablet black?

Also, are you thinking of installing a small bit of plastic in the holes (or will that intefere with the sensors?

Final question - what tablet is that, as it looks like it fits almost as well as the ascend mate :thumbsup:



btw - you're invited to get Fois internet and phone at a great price, plus a limited time special bonus! Who's a lucky boy? :P
 
Good idea on the plastidip for the holes on the side. Thats for the front facing camera, and the proximity sensor (which is used to detect when the screen is up or down). I kind of like the white bezel though that surrounds the screen itself but may also plastidip it black to give more OEM look.

Here's a link to the device that I bought:

http://www.aliexpress.com/item/Best-price-For-mtk6589-Quad-Core-2GB-RAM-16GB-ROM-Note-3-Phone-N7200-6-0/1819447277.html

It's a galaxy note 3 clone, though I don't think the dimensions match up perfectly.. The ascend mate would be a better choice because it has on screen home, menu, and back buttons which means more screen real estate. But the cheapest I found that was for $180, whereas this was only $90 with a discount I had (it was on sale for $115, and then I got $25 back). It has the same specs as the Ascend mate too, so I wasn't sacrificing anything other than on screen buttons.

Edit:

Just sharpied the camera and proximity sensor, both functioning as good as before. Thanks for the idea sk93! Probably going to leave the white bezel.

Thinking about getting a matte screen protector also, to reduce glares and fingerprints. Maybe one from a nexus 7 cut to size, as I can't find one for this particular model.
 
igeak691 said:
Here's what I have installed so far:

m8kbo0.jpg


Took a whole day basically to get it all set up, but it looks good at least.

Functionality is 90% there. Using proximity sensor, I have it turn off the screen when its in closed position, and turn on the screen when it gets flipped up. Still have to work on the arduino setup, waiting for motor shield.

:thumbsup: :thumbsup: :thumbsup:
I still think there are too many diferent between tablet and car using tablet.
I have buy a odb2 device some months ago.It works perfectly when I use it for analysis fault code occasionally.But it is not a good experience for realtime using for too much steps.
http://imageshack.us/a/img802/2474/pyhi.jpg
1.Touchpad is too far from z4's seat if you need frequent operation.
2.how to gain pure music by z4's sound system?
3.Convenient external usb storage etc.
4.More function means losing one-stop or professinal functions.
http://www.z4-forum.com/forum/viewtopic.php?f=29&t=56746
 
Actually I've found due to the size of the Z4, it's not bad at all reaching for the screen. On another car that is larger, this may have been an issue but it's totally within reach; maybe not sitting completely back against seat, but doesn't feel like I'm reaching over the dash like in other cars.

The Z4's sound system has never really impressed me, and to be honest, my 2004 Civic has a better sound system, stock vs stock. I'm not sure if its my particular Z4, but there is no bass that comes out of the rear speakers, only the fronts, and the volume knob is not very sensitive so you have to turn it a lot for a small change in volume. Sound doesn't sound as "solid" either. Might be just me though.

The tablet will be configured so that it can easily be plugged into a laptop to transfer music/videos, etc. Not that I think I'll need it, as I've been used to streaming music rather than having my own music collection, but it'll be good if I need to flash any new roms or general maintenance in the future.

Btw, your thread has a lot of dead images.. can you update them? Would like to see more about this top tier screen of yours that you retrofitted.
 
igeak691 said:
Actually I've found due to the size of the Z4, it's not bad at all reaching for the screen. On another car that is larger, this may have been an issue but it's totally within reach; maybe not sitting completely back against seat, but doesn't feel like I'm reaching over the dash like in other cars.

The Z4's sound system has never really impressed me, and to be honest, my 2004 Civic has a better sound system, stock vs stock. I'm not sure if its my particular Z4, but there is no bass that comes out of the rear speakers, only the fronts, and the volume knob is not very sensitive so you have to turn it a lot for a small change in volume. Sound doesn't sound as "solid" either. Might be just me though.

The tablet will be configured so that it can easily be plugged into a laptop to transfer music/videos, etc. Not that I think I'll need it, as I've been used to streaming music rather than having my own music collection, but it'll be good if I need to flash any new roms or general maintenance in the future.

Btw, your thread has a lot of dead images.. can you update them? Would like to see more about this top tier screen of yours that you retrofitted.

The volume knob sensitivity can be set. You can refer to radio manual or free to click those buttons more than three second then you will see the function.:)
.
You need repeated improvements and lot of time if start the work from very begining but my syetem have not motor under the screen. That is the only regret compare with the oem.
 
https://www.youtube.com/watch?v=lrBspF_o8qA

Still got some bugs to work out. I have changed the sketch up a bit so that the screen works with my setup.
 
igeak691 said:
https://www.youtube.com/watch?v=lrBspF_o8qA

Still got some bugs to work out. I have changed the sketch up a bit so that the screen works with my setup.

:thumbsup: :thumbsup: :thumbsup:
Perfect work!
 
Just a few questions:
What happens if you want to use the car radio or CD player?
How does the tablet connect to the audio?
 
Back
Top Bottom