BlueWave Studio forum
Mazda 3 2006 - factory navigation retrofit - Printable Version

+- BlueWave Studio forum (https://bluewavestudio.io/community)
+-- Forum: Head-unit projects (https://bluewavestudio.io/community/forum-89.html)
+--- Forum: Your projects (https://bluewavestudio.io/community/forum-62.html)
+--- Thread: Mazda 3 2006 - factory navigation retrofit (/thread-3766.html)

Pages: 1 2 3 4 5 6 7 8


Mazda 3 2006 - factory navigation retrofit - AnnieC - 04-02-2023

Hello all,

First of all thank you for the creators of OpenAuto Pro and this community because I learned a lot from reading this forum and OpenAutoPro makes it quite easy to get started.

I have a Mazda 3 from 2006 and I plan to keep that car as long as its possible, it's a great little car to drive while being quite practical as well. I inherited it from my father so I have an emotional connection to it. Since the first time I saw that there was a factory navigation option I wanted get one, and thanks to one of my colleagues I could get the original navigation with the remote control and DVD ROM shipped to me for quite a low price so I could start tinkering with it. The process goes quite slowly as I don't have a lot of free time, but visible progress was made so I thought I'll start sharing where I am.

Here is a picture of the car:
[Image: 72918.jpg]

Stock navigation after unpacking everything:
[Image: IMG_20230207_124336751.jpg]
[Image: IMG_20230207_1249524143.jpg]
Stock navigation screen powered up without anything else connected to it based on this diagram:
   



I will post the plans, the technical details, more pictures of the process, parts list and scripts used in the next posts.


RE: Mazda 3 2006 - factory navigation retrofit - AnnieC - 04-02-2023

I found the animation here on the forum, the red Mazda wallpaper customised by me:



RE: Mazda 3 2006 - factory navigation retrofit - AnnieC - 04-02-2023

This is the screen I'm using(I got good deal on it)
Raspberry Pi 3 Display Hdmi Touch Screen Monitor | 7 Inch Hdmi Monitor Raspberry Pi - Lcd Monitors - Aliexpress

Officially PWM backlight control is not supported, as in they wouldn't tell me where I could connect the PWM signal, so I started my experiments with various methods to control the backlight, I had three different methods in mind after inspecting the circuit board when I disassembled the screen:

  1. I2C  - DDCUtil for Raspberry Pi
  2. Directly controlling the backlight buttons from the Pi
  3. PWM backlight control with the PWM pin on the Pi like explained in the manual for a similar screen

A picture of the back of the display:
   

I2C  - DDCUtil for Raspberry Pi
When I disconnected the cable in the middle I discovered an I2C port, the display wouldn't communicate with DDCUtil on HDMI so I soldered jumper wires to the board and connected them to the I2C pins on the Rasperry Pi. DDCUtil could read a lot of properties from the display but changing the backlight or anything else didn't work, not even with very low baud rates so after a day of fiddling with it I concluded that I could use this to read the screen brightness state but not much else.

Directly controlling the backlight buttons from the Pi
The right side of the circuit board, the buttons could be connected to Raspberry Pi GPIO pins directly, simulating key presses, but that would mean "Backlight X" being displayed on the screen during automatic backlight adjustment, which I couldn't get rid of, so this was always kept as a last resort idea.

PWM backlight control with the PWM pin on the Pi 
As this screen is not a direct copy of other similar screens, I had to understand where and how the backlight is controlled on the circuit board. I found documentation for the controller chip, for some of the voltage converter chips(or similar ones) and I measured the voltages to see which one is changing with the backlight level changes until I found the chip which seemed to have the same pinout as another chip I found documentation for, so with my limited understanding I hoped that removing the R29 resistor and attaching a wire to the pin which is in connection with pin 6 of the little LED current controller(pin 1 is marked with a triangle) I would be able to control the backlight directly.
   

Reading light sensor data from TSL2591
I had some issues with reading the Lux values from the TSL2591 light sensor with the methods described here on the forum so I based my proof of concept on this solution:
Raspberry Pi and TSL2591 sensor python example | Pi bits

This code is very simple, just a crude combination of the example above and the PWM backlight control commands:
#!/usr/bin/python3 -u
# Simple demo of the TSL2591 sensor.  Will print the detected light value
# every second.
import time
 
import board
import busio
import subprocess
 
import adafruit_tsl2591

subprocess.run("gpio -g pwm 18 1024", shell=True)
subprocess.run("gpio -g mode 18 pwm", shell=True)
subprocess.run("gpio pwmc 1000", shell=True)
subprocess.run("gpio -g pwm 18 512", shell=True)
 
# Initialize the I2C bus.
i2c = busio.I2C(board.SCL, board.SDA)
 
# Initialize the sensor.
sensor = adafruit_tsl2591.TSL2591(i2c)
 
# You can optionally change the gain and integration time:
# sensor.gain = adafruit_tsl2591.GAIN_LOW (1x gain)
# sensor.gain = adafruit_tsl2591.GAIN_MED (25x gain, the default)
# sensor.gain = adafruit_tsl2591.GAIN_HIGH (428x gain)
# sensor.gain = adafruit_tsl2591.GAIN_MAX (9876x gain)
# sensor.integration_time = adafruit_tsl2591.INTEGRATIONTIME_100MS (100ms, default)
# sensor.integration_time = adafruit_tsl2591.INTEGRATIONTIME_200MS (200ms)
# sensor.integration_time = adafruit_tsl2591.INTEGRATIONTIME_300MS (300ms)
# sensor.integration_time = adafruit_tsl2591.INTEGRATIONTIME_400MS (400ms)
# sensor.integration_time = adafruit_tsl2591.INTEGRATIONTIME_500MS (500ms)
# sensor.integration_time = adafruit_tsl2591.INTEGRATIONTIME_600MS (600ms)
 
# Read the total lux, IR, and visible light levels and print it every second.
while True:
	# Read and calculate the light level in lux.
	lux = sensor.lux
	#print("Total light: {0} lux".format(lux))
	# You can also read the raw infrared and visible light levels.
	# These are unsigned, the higher the number the more light of that type.
	# There are no units like lux.
	# Infrared levels range from 0-65535 (16-bit)
	infrared = sensor.infrared
	#print("Infrared light: {0}".format(infrared))
	# Visible-only levels range from 0-2147483647 (32-bit)
	visible = sensor.visible
	#print("Visible light: {0}".format(visible))
	# Full spectrum (visible + IR) also range from 0-2147483647 (32-bit)
	full_spectrum = sensor.full_spectrum
	#print("Full spectrum (IR + visible) light: {0}".format(full_spectrum))
	brightness_cmd = 'gpio -g pwm 18 "%s"' % (lux*20)
	subprocess.run(brightness_cmd, shell=True)
	time.sleep(0.01)


The results, as I cover the lights sensor with my finger the screen dims automatically:



RE: Mazda 3 2006 - factory navigation retrofit - AnnieC - 04-02-2023

I plan to use the original remote as well, I couldn't find the plastic piece which originally holds the remote so I bought the version which is widely available and I cut away enough material to be able to fit the remote.

[Image: IMG_20230222_2310252863.jpg]

I bought another one of the cigarette lighter part as well because I plan to install extra USB ports there.

[Image: IMG_20230223_1826261802.jpg]
[Image: IMG_20230223_1832073482.jpg]

I tried to make sense of the signals that are coming from the remote when it's powered up, but no luck so far, standard UART with Arduino doesn't seem to work.


RE: Mazda 3 2006 - factory navigation retrofit - GSPW - 04-02-2023

Wow, fantastic thread, keep us posted! Love how you come up with custom solutions that look factory-made, keep it up!


RE: Mazda 3 2006 - factory navigation retrofit - KreAch3R - 04-02-2023

Hello fellow Mazda owner! I'm glad to see people modifying the stock screen, it's there for takes! Check out my version, you may find something useful: https://bluewavestudio.io/community/thread-2290.html


RE: Mazda 3 2006 - factory navigation retrofit - AnnieC - 04-02-2023

(04-02-2023, 11:48 AM)GSPW Wrote: Wow, fantastic thread, keep us posted! Love how you come up with custom solutions that look factory-made, keep it up!

Thank you! I have quite a few ideas and plans, but when it comes to implementation I'm figuring out a lot of things as I go. Keeping a stock look is important to me, I love the original head unit and those kind of old fashioned orange lights when I change the volume so I decided against replacing the head unit with a touch screen. From what I've seen in the service manual I could have used the original display from the stock navigation but it's an old display, almost anything nowadays has better resolution and image quality, not to mention the touch capability which can come in handy, but it's probably safer to use the remote while driving so that's why it's important to be able to use that as well.

(04-02-2023, 04:17 PM)KreAch3R Wrote: Hello fellow Mazda owner! I'm glad to see people modifying the stock screen, it's there for takes! Check out my version, you may find something useful: https://bluewavestudio.io/community/thread-2290.html

I have seen your solution and I love it, it inspired me and I used it to show others what's possible.


RE: Mazda 3 2006 - factory navigation retrofit - AnnieC - 04-06-2023

Ordered a CarPiHAT PRO, should be able to continue the hardware related work next week. I could have figured out most of the stuff without the HAT, but based on the description it's exactly what I need, so I don't want to reinvent the wheel here. Until it arrives I'll improve the screen brightness control script. The plan is to be able to configure a curve which will define the relationship between ambient light levels and the screen backlight strength and to make the backlight changes slower to avoid flickering at every little change of ambient light.


RE: Mazda 3 2006 - factory navigation retrofit - AnnieC - 04-10-2023

Ordered this camera to be used as reverse camera, as it's USB it doesn't need a video grabber:

2mp Usb Webcam 1080p Hd Mini Cmos Ov2710 Uvc Otg 170degree Fisheye Lens Wide Angle Cctv Security Usb2.0 Camera - Ip Camera - AliExpress


[Image: 2MP-USB-Webcam-1080P-HD-Mini-CMOS-OV2710....jpg_.webp]
I plan to install it between the two license plate lights after making sure it's more or less waterproof.

If it doesn't work with OpenAuto Pro, I can use it for something else, so it won't be wasted, whatever the test results are.


RE: Mazda 3 2006 - factory navigation retrofit - GSPW - 04-10-2023

Last I heard, OA Pro supports the official RPi camera only so you would likely be on your own here. I don't recall anybody here using a USB camera but I could be wrong.