Volvo Community Forum. The Forums of the Volvo Owners Club

Forum Rules Volvo Owners Club About VOC Volvo Gallery Links Volvo History Volvo Press
Go Back   Volvo Owners Club Forum > "Technical Topics" > S80 '98-'06 / S60 '00-'09 / V70 & XC70 '00-'07 General
Register Members Cars Help Calendar Extra Stuff

Notices

S80 '98-'06 / S60 '00-'09 / V70 & XC70 '00-'07 General Forum for the P2-platform S60 / V70 / XC70 / S80 models

Information
  • VOC Members: There is no login facility using your VOC membership number or the details from page 3 of the club magazine. You need to register in the normal way
  • AOL Customers: Make sure you check the 'Remember me' check box otherwise the AOL system may log you out during the session. This is a known issue with AOL.
  • AOL, Yahoo and Plus.net users. Forum owners such as us are finding that AOL, Yahoo and Plus.net are blocking a lot of email generated from forums. This may mean your registration activation and other emails will not get to you, or they may appear in your spam mailbox

Thread Informations

Volvo RTI navigation project with Android (Odroid platform)

Views : 14757

Replies : 22

Users Viewing This Thread :  

Reply
 
Thread Tools Display Modes
Old Apr 10th, 2017, 10:01   #1
arpi2390
Junior Member
 

Last Online: Jul 23rd, 2022 20:16
Join Date: Jan 2009
Location: Targu Mures
Default Volvo RTI navigation project with Android (Odroid platform)

Hi everyone,

I haven't been too active on this forum, I just consume the information here so I thought I'd give back something to the community.

I've been driving a really lot the last couple of months, long trips outside the country (around Europe) and for navigation I've used a GPS that attaches to the windshield and my phone with Waze. Waze is really great so I've been switching more and more to my phone and I'm ditching the GPS slowly (still have to use it abroad because of roaming cost). The problem is that I don't like the idea of keeping my phone in the sun so I've mounted a holder to the HU and I keep it there but it's not really "in my face" down there and I do have to "give up" the phone a bit when I'm using it, it's not a major problem because it's connected to the HU via bluetooth and I can have calls.

While driving at night I like to have a sort of heads up display of the road in my field of view. Another minus with the phone is the smaller screen size.

My solution: OEM Volvo RTI screen which "runs" Android. Something that is a bit more complicated then it sounds...as I found out later...

A little heads up, I don't have a lot of experience in the field of electronics (next to nothing) and not a lot of knowledge in programming hardware components (a few PIC controller projects in uni a few years ago turning on LEDs ).


First step in the project was to get an RTI screen with the lift mechanism, which I got from a donor car from a local breaker.
Next steps were identifying the problems and solving them. First problem, the RTI screen...well it's a bit more complicated then your average desktop monitor... A few sleepless nights searching on the internet turned up some answers on what to use and how to turn on the screen. Second problem, finding something that runs Android (for Waze, Youtube and other apps) well enough to be used day to day, "the internets" helped me out here too. I'll detail below.

So here's the current setup:



As you can see there are 3 components in the setup, firts off the OEM RTI screen, there's an Arduino Mega controller (an open-source electronic platform, I'll explain it's use later on) currently I switched the Mega to an Arduino Nano and last but not least an Odroid running Android (a sort of Raspberry Pi - don't mistake it for a raspberry pie it's not the kind of thing that you eat - that runs Android really well).


A bit more in detail:

The RTI is connected to 12V, ground and 12 ACC. Currently it's running off of a 12V power supply which has 12V and ground, the power supply is connected to the connector on the right side (with 5 pins) which is normally blue, you need to connect 12V to PIN 1 (right most pin), ground goes to PIN 5 (left most pin) and ACC - which I understood to be live only when the engine is running - also takes 12V so I connected the 12V from the power supply to that too, ACC is PIN 3.

So as follows:

PIN 1 <- 12V
PIN 5 <- Ground
PIN 3 <- 12V


PIN 2 and PIN 4 is I guess a backup connection for 12V and ground I didn't connect them up (PIN 2 - 12V and PIN 4 - Ground).


The other connector is the more interesting one, the green one on the left side. This in my setup has 3 important pins, PIN 4, PIN 7 and PIN 10.

Green connector pins explaind:

PIN 4 - serial connection (this is the communication port, we'll use it to send commands to the RTI, it's a unidirectional communication, the RTI is always the receiver)
PIN 7 - ground (you need to ground this to your controller)
PIN 10 - composite video in (we'll send the video feed here, I'm using NTSC but PAL is available on this pin too)

The Arduino is used to start the RTI screen and lift the screen up, also it can control the brightness of the screen.

Connecting the Arduino to the RTI: The ground pin I think is self explanatory, you hook PIN 7 to a ground on the Arduino. This is easy because the Arduino has all of it's pins marked you just connect it to something marked GND and you are good. PIN 4 is the interesting one because this needs to send through serial commands so we will need to connect this up to a serial communication pin on the Arduino too, on the Arduino Mega you have a few transmission pins, the Arduino Nano has just one. It's again easy to find the serial communication pins on the Arduino because they are marked (on the Mega because there's more then one you also have a lable "Communication" where you'll find all the communication pins) we will need to transmit data so you should be looking for TX pins, for best practice I suggest using TX0 pin even on the Arduino Mega and you only have the single TX0 pin on the Nano. (I also used these so my code is compatible with PIN TX0).

So this is the setup for Arduino to RTI:

PIN GND on Arduino -> PIN 7 RTI
PIN TX0 on Arduino -> PIN 4 RTI


Those who have been paying close attention know that there's one component left. The Odroid which is running Android and will output from the CVSB pin (composite video, NTSC) to the RTI.

We have one pin free left from the 3 that we will use in our setup, PIN 10. We need to hook that up to the Odroids video output and we need to ground the Odroid to the whole setup. For ground I grounded the Odroid (there's a ground pin right next to the CVSB on the Odroid) to the Arduino but it can be grounded directly to the RTI too.

So as follows:

CVSB OUT on Odroid -> PIN 10 on RTI
Ground on Odroid -> Ground on Arduino (GND Arduino or any other ground in the setup, the whole RTI metal casing is ground)


Here's an image of the whole setup that I tried to explain in the above lengthy text (if you got lost in it):



The Odroid outputs NTSC video and the RTI is set up to receive NTSC too. RGB can be used somehow too, but I haven't yet got to that. I've been working on this just the last weekend, this is the progress that I made.


Now, the more complicated bit (not that complicated) is programming the Arduino to fire everything up. If anyone has ever coded in C, C++ or any other derivative of these, or more complex programming languages you should be good to go. For the novices in programming I will be your tech support if needed.

The idea is that the RTI needs to receive the "stay alive" command continuously, the "stay alive" command is nothing more then telling the screen what video mode it needs to use, what brightness it should be on (this can be omitted but you still need to send a command instead) and another bit of data, currently not know what this is, I've searched around but didn't find anything on it but to run everything it's needed. Pure speculation on my part for the unknown bit is that it's a sort of end of line character so that the RTI knows that it can execute the command...this is just my thought, could be completely wrong.

I'm using the Arduino to send out these bits and bytes. A more detailed explanation of the 3 pair of bytes we need to send to the RTI:

RTI screen mode: There are several screen modes the RTI can operate on, as follows RGB, NTSC, PAL. Also the first pair of byte controls the on/off of the screen, if you send out either the RGB, NTSC, PAL command the screen will turn on, if you send out the OFF command it will shut down and retract.

The pair of bytes in HEX value for the screen mode: RGB = 0x40; PAL = 0x45; NTSC = 0x4C; Screen off = 0x46;

Screen brightness: There are 16 values for the screen brightness, here are the HEX values from 1 to 16 -> 0x20, 0x61, 0x62, 0x23, 0x64, 0x25, 0x26, 0x67, 0x68, 0x29, 0x2A, 0x2C, 0x6B, 0x6D, 0x6E, 0x2F

The unknown data (probably pair of byte to start executing the command): 0x83 - this needs to be sent out last

Example of turning on the screen with NTSC mode, full brightness: 0x4C 0x2F 0x83 (explination: NTSC | BRIGHTNESS | "Execute Command") - if you want the screen to stay up you need to continuously send this data out, I'm sending it out every 100 ms (added a delay of 100 ms).

A video of my first try:

[YOUTUBE]https://www.youtube.com/watch?v=AuOx__sRwuQ[/YOUTUBE]

In the above video I'm using the Arduino Mega but I switched it out with the Nano later on. Also there was a problem with the screen, the electric motor kept running even after the screen went up or down, that turned out to be a connector that was not plugged in to it's socket inside the RTI, that's what you get when you take it apart too many times, solved it by plugging in back in.

The screen isn't stellar but it will suffice for now, some images:




Another video with a bit of progress, I use push buttons to operate the up/down (turning on/off) motion of the screen and the brightness:

[YOUTUBE]https://www.youtube.com/watch?v=bGd31lbvm7o[/YOUTUBE]

I haven't seen a full guide to implement this so that's why I dared to make such a lengthy post. The code I use isn't entirely my work, it's based on something I found on "the internets" I will find the source again and link it here. That was for a V50 tilt screen.

Here's an example code to get you started:
Code:
// Connect:
// Screen PIN 4 to Arduino PIN 2 (TX) 
// Screen PIN 7 to Arduino ground

enum display_mode_name {RTI_RGB, RTI_PAL, RTI_NTSC, RTI_OFF};
const char display_modes[] = {0x40, 0x45, 0x4C, 0x46};
const char brightness_levels[] = {0x20, 0x61, 0x62, 0x23, 0x64, 0x25, 0x26, 0x67, 0x68, 0x29, 0x2A, 0x2C, 0x6B, 0x6D, 0x6E, 0x2F};


//int current_display_mode = RTI_OFF;
int current_display_mode = RTI_NTSC;
bool send_brightness = true;
char current_brightness_level = 13;

//delay between bytes, ms
const int rti_delay = 100;
int once = 1;

void setup() {
  Serial.begin(2400);
}

void loop() {

  rtiWrite(display_modes[current_display_mode]);
  
  if (send_brightness)
    rtiWrite(brightness_levels[current_brightness_level]);
  else
    rtiWrite(0x40);
    
    rtiWrite(0x83);
  
}

void rtiWrite(char byte) {
  Serial.print(byte);
  delay(rti_delay);
}
This will continuously keep the screen alive, if you want to shut it down you will need to change int current_display_mode = RTI_NTSC; to int current_display_mode = RTI_OFF; and update the Arduino. I just added that code so you can try everything. If you for some reason don't manage to update it just unplug the Arduino, the RTI will notice that it's not getting commands and it will automatically shut down.

Here's a better code where I use push buttons to operate the screen:
Code:
// Connect:
// Screen PIN 4 to Arduino PIN 2 (TX) 
// Screen PIN 7 to Arduino ground

enum display_mode_name {RTI_RGB, RTI_PAL, RTI_NTSC, RTI_OFF};
const char display_modes[] = {0x40, 0x45, 0x4C, 0x46};
const char brightness_levels[] = {0x20, 0x61, 0x62, 0x23, 0x64, 0x25, 0x26, 0x67, 0x68, 0x29, 0x2A, 0x2C, 0x6B, 0x6D, 0x6E, 0x2F};


//int current_display_mode = RTI_OFF;
int current_display_mode = RTI_NTSC;
bool send_brightness = true;
char current_brightness_level = 13;

//delay between bytes, ms
const int rti_delay = 100;
int pinNumber = 5;
int pinBrightness = 6;
int stateChange = 0;

void setup() {
  Serial.begin(2400);
}

void loop() {

  int button;
  int buttonBrightness;
  
  pinMode(pinNumber, INPUT);
  digitalWrite(pinNumber, HIGH);
  button = digitalRead(pinNumber);

  pinMode(pinBrightness, INPUT);
  digitalWrite(pinBrightness, HIGH);
  buttonBrightness = digitalRead(pinBrightness);

  if (button == 0) {
    stateChange = abs(stateChange - 1);
  }

  if (buttonBrightness == 0) {
    current_brightness_level = current_brightness_level + 3;
    if (current_brightness_level == 15 || current_brightness_level == 16) { current_brightness_level = 1; }
  }


  if (stateChange == 1) {
    current_display_mode = RTI_NTSC;
  } else {
    current_display_mode = RTI_OFF;
  }

  
  rtiWrite(display_modes[current_display_mode]);
  
  if (send_brightness)
    rtiWrite(brightness_levels[current_brightness_level]);
  else
    rtiWrite(0x40);
    
    rtiWrite(0x83);
  
}

void rtiWrite(char byte) {
  Serial.print(byte);
  delay(rti_delay);
}
The push buttons are connected to the Arduino through the digital pins, in this case PIN 5 (on/off) and PIN 6 (brightness) and both buttons are grounded to the Arduino (in essence I'm putting voltage on PIN 5,6 and watching when it makes contact with ground).

That's kind of all for controlling the RTI and outputting video to it.

My problems as of now:

1. The biggest one is powering off the Odroid safely after the engine stops. I will need to make a controller that notices if the engine is off and commands the Odroid to shut down, I haven't researched it yet.
2. Finding all the right wires on the car and hooking it up, hopefully not setting everything on fire.
3. Something to control the Odroid, currently I have a mouse hooked up. I want to in the first run hook up a touch pad and install it behind the shifter, in the cup holder. That way I can close it and hide it. I'm also planning on adding a touch screen to the RTI assembly, I have a 6.2" one that will fit really well...but I need to write a controller/driver for it so I can connect it though USB to the Android...need to research it.
4. I also want to change the screen...I ordered a Chinese 7" screen with touch panel (would need to modify RTI because it's bigger but just the plastic part, the metal has just about the clearance to fit everything in with a bit of bending). But being a complete novice in electronics I managed to send 12V to the ground of the screen and connected the 12V rail to the ground of the power supply, reversed polarity...fried a few things, popped a few caps. I changed the capacitors and bypassed a voltage regulator but the main chip is heating up and I can only input RGB, can't switch to HDMI. Will need to investigate further.

The Odroid is running a normal Android, I can use any app that's on the Play Store. I'll use Waze, Google Maps and iGO for navigation.

Plan for the future besides the RTI is to make a simple AUX IN for the HU, connected to the back where the CD changer goes, for now it will be just a simple AUX IN, later on I will try to make something that works like the Grom, Yatour devices.

I'm also aware of the iMIV but as I'm planning on switching out the screen it would be almost useless, I would just use it for the lift mechanism and audio in. I already have those taken care of at the fraction of the cost of an iMIV.

Let me know if you have questions.


PS. Theoretically this should work on any P2 Volvo (up to 2009), and the code that I used was tested by the guy who wrote it on a V50 so it should work on that too.
arpi2390 is offline   Reply With Quote
The Following 6 Users Say Thank You to arpi2390 For This Useful Post:
Old Apr 10th, 2017, 14:19   #2
arpi2390
Junior Member
 

Last Online: Jul 23rd, 2022 20:16
Join Date: Jan 2009
Location: Targu Mures
Default

Missing images in the above post:

Current setup:


How it's all linked:


RTI screen image quality:


If someone could edit the above post and change out the images that would be great. Thanks.
arpi2390 is offline   Reply With Quote
The Following 4 Users Say Thank You to arpi2390 For This Useful Post:
Old Apr 11th, 2017, 14:02   #3
DT19
Master Member
 

Last Online: Yesterday 18:06
Join Date: Feb 2014
Location: York
Default

Oh crap! Why didn't you post this 3 weeks ago? I've just ripped everything out of an RTI unit and fitted a 7" screen and controlled the motor with an Arduino Uno.

At the start I searched the internet for days looking for the pinouts before giving up and binning everything except the frame.
DT19 is offline   Reply With Quote
Old Apr 11th, 2017, 15:00   #4
arpi2390
Junior Member
 

Last Online: Jul 23rd, 2022 20:16
Join Date: Jan 2009
Location: Targu Mures
Default

Look at the bright side, you have a (I'm guessing here) brand new screen in with higher resolution probably. What did you use for the screen?

I also have a cheap Chinese 7" LCD touch screen, but I managed to mostly burn the LCD controller sending in 12V the wrong way...I changed some caps and for now bypassed some voltage regulators and it starts up but it heats up quickly.

Anyway I wanted to add the above LCD to the RTI by laser cutting the plastic frame and adding 1 cm of plastic to the width and height, that should allow me, in theory, to add a 7" screen and the metal case has just about the clearance to allow that if I bend the two ends that go inwards and are the rails for those little white plastic guides on the bottom of the screen. But that will involve cutting plastic, fusing it together and using some plastic putty (not sure if that's the correct term in English) and a working screen.

As for the controller you could have used an Arduino Nano instead, it's a lot smaller and works just as good. It would fit better in the RTI case.

The information about the pins and the serial connection is out there but it's hard to find and to decipher what's what. That's why I put together the above tutorial/explanation. Everything is there with pictures, I'll also add diagrams, and if needed I'll further explain.

Hope it will help others.

P.S. The Arduino Uno might be better suited for the CD-Changer emulator that I want to make if you want to try that out. But I'll need a couple of weekends to work that out and a working HU in the house on my desk (still need to buy one) so that I can test it in house.

Last edited by arpi2390; Apr 11th, 2017 at 15:06.
arpi2390 is offline   Reply With Quote
Old Apr 11th, 2017, 15:34   #5
JRL
Master Member
 

Last Online: Aug 25th, 2022 16:37
Join Date: Jul 2013
Location: Derry
Default

Now that is bloody brilliant! Unfortunately I don't have the hole in the dash for the screen, speaker in the way but I have been thinking for a long time of replacing the stereo with an android tablet, too much work though I think.
__________________
2008 S60 D5 SE LUX
JRL is offline   Reply With Quote
Old Apr 11th, 2017, 17:31   #6
arpi2390
Junior Member
 

Last Online: Jul 23rd, 2022 20:16
Join Date: Jan 2009
Location: Targu Mures
Default

You can replace the full speaker with an RTI screen and speaker combination, granted the speaker is smaller I don't remember the exact size.

As for adding a tablet in place of the HU, that's a bit tricky. Really depends on what route you want to go on, you can either keep the whole HU unit and just put a tablet in front of it and add an AUX IN for the HU from the tablet. The AUX IN isn't simple either, unfortunately. Or you can get rid of the HU, wire up the tablet to an external amp (either OEM or aftermarket) but you won't have any FM/AM radio.

I myself would keep the HU, remove some unnecessary components (CD drive or cassette on older models), fit the tablet somehow in the HU casing, obviously make a cutout for the tablet's display (laser cutting would yield good results) and connect everything up, move the LCD display and buttons of the HU somewhere so even if you want to switch to radio you have control and you can see what's going on.

For the above there's an even more complicated way of going about, where you can control all of the functions of the HU from within the tablet but for that you need good knowledge of the Android OS and micro controllers.

The third and most simple option is just getting a 2DIN Android device/player, there are quite a few Chinese products out there. That can be wired up to the existing system just like any other aftermarket stereo.
arpi2390 is offline   Reply With Quote
Old Sep 4th, 2017, 08:54   #7
arpi2390
Junior Member
 

Last Online: Jul 23rd, 2022 20:16
Join Date: Jan 2009
Location: Targu Mures
Default

Quote:
Hi,
I've been reading through you instructions for thr RTI/Odroid project and I think I might give it a go. I did something similar already and fitted and 8" Android tablet using an arduino to control the up/down bit. After using it for a while I think the screen is a bit too big and it doesn't look right. I've now got myself another unit to play with but I'm already stuck. My unit has blue and grey connectors rather than blue and green in your instructions. Do you know the pinout for this please?
Regards
Andrew
Hi,

I can't yet reply to PMs because I don't have enough posts (30 is the limit) so I'll reply here if it's not a problem.

The actual connector on the RTI unit is grey if I remember correctly, the bit that slides into the connector is green. I kind of left the project at the stage that I posted last time because I didn't have time for it so I don't remember how everything looks but I'll check it later today.

I'm pretty sure the pinout is the same and you only have to connect 3 things on that connector, a ground which is easy to test if you have a multimeter, the other two is the serial pin and CVBS pin (composite video), that can be done with trial and error if the pinout isn't the same but as I've said I don't think it was changed at all throughout the years. If I remember correctly it's even the same on the S40/V50 (2004+) models where the screen rotates out of the dash.

Try it out the way I did and I'm 99% sure it should work. Don't send 12V to any of the pins on that connector and everything should be fine.

Let me know if I can help you with anything else.

P.S. I just remembered that you already used an Arduino to get the screen out so you already know which pin is the serial and the ground pin. The CVBS pin should be easy to find if it's not the same pin as it is on mine, just with trial and error.
arpi2390 is offline   Reply With Quote
Old Sep 4th, 2017, 11:25   #8
DT19
Master Member
 

Last Online: Yesterday 18:06
Join Date: Feb 2014
Location: York
Default

Thanks for that. I spent yesterday fiddling about and I've got it working perfectly now. I only wanted to use the screen to display the rear view camera when reversing. When I select reverse gear the screen comes up then goes down again when I take it out of reverse or switch off the ignition. I've got the brightness adjust working as well. Just doing some more testing and trying to think if anything else needs doing (might switch between 2 cameras). then I'll fit it in my car and take the 8" Android pad version out.

Most of what the Android version does is on my phone as well so I haven't used it as much as I though I might.

I have to say that so far this method has been much much easier than my first attempt.
DT19 is offline   Reply With Quote
Old Sep 4th, 2017, 11:33   #9
arpi2390
Junior Member
 

Last Online: Jul 23rd, 2022 20:16
Join Date: Jan 2009
Location: Targu Mures
Default

Yes, it's almost plug&play if you sort the arduino part out.

Where are you getting the "reverse" signal from? I haven't taken apart the lower part of the center consol yet but I'm guessing there's a switch there with 12V, did you step that down to 3.3V (anything above 5V I think will fry the arduino)?
arpi2390 is offline   Reply With Quote
Old Sep 4th, 2017, 15:03   #10
DT19
Master Member
 

Last Online: Yesterday 18:06
Join Date: Feb 2014
Location: York
Default

Quote:
Originally Posted by arpi2390 View Post
Yes, it's almost plug&play if you sort the arduino part out.

Where are you getting the "reverse" signal from? I haven't taken apart the lower part of the center consol yet but I'm guessing there's a switch there with 12V, did you step that down to 3.3V (anything above 5V I think will fry the arduino)?
I haven't got that far yet. I have a 3" screen at the moment and it takes it's signal from the reversing light bulbs so it will be 12volts.

I'm using a switch in the TX/RX line, try it, it works. I'm going to try using a relay to take the 12v signal to switch the relay to connect/disconnect the signal line.

Edit:
Just tried with a relay and it's works fine

Last edited by DT19; Sep 4th, 2017 at 15:30. Reason: Update
DT19 is offline   Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 07:16.


Powered by vBulletin
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.