Search This Blog

Wednesday, January 30, 2019

Car DVR replacement and related shenanigans - part 2

Moving along with more details, like I mentioned in the previous post, the rear camera was reused from the previous installation. This CCD based camera happens to be superior to the basic CMOS camera bundled with the kit. Both in terms of the quality of the sensor itself and its low light sensitivity, but also regarding the lens, featuring a wider viewing angle (important given its role as a backup camera).

The only change however was a substantial improvement in the mounting design, by having added an U-shaped plate in the rear of the camera, with a 4-screw mount instead of the original 2 screws attached to the sides of the camera. This provides a more solid attachment to the L-shaped aluminium parts that in turn stick to the door through an adhesive:

The existing wiring was used. I also learned that the pinout of the miniature 4 pin connector is the same in both the new and old car DVR units. The cabling goes in through the rear door and through the roof:

in order to reach the compartment near the rearview mirror, where the connectors and cabling meet:

To function properly, similarly to a car stereo, the mirror requires two power rails:

  • ACC - the accessories power source. This rail is only powered while the car key is turned on;
  • B+ - permanent power from the batery. This pin serves to keep the mirror in standby mode, and to prevent the sudden power switching (when the car key is removed from the ignition) from causing data loss or microSD card corruption.
I could easily obtain power in these conditions by selecting the appropriate unpopulated slots in the 

fuse box underneath the steering wheel:

For the B+ power, I selected one of the slots (F39) between the two square high amperage fuses. For the ACC I used another empty slot, which would serve for the heated seats fuses (which my car is not equipped with). Given that the heated seats are only active if the key is turned on, this would be a good point to tap the ACC rail.

Before these terminals that connect to the fuse box, each cable has a 3 Amp fuse, in order to protect each of the rails.

The sketch below depicts the connections and the circuit that is present between the DVR input connector (an 8 pin miniature round connector) and the rectangular 8 terminal connector. The reversing light signal filter is represented, and the camera voltage switching relay as well:

As explained in the previous post, the later serves the purpose of switching the 12 Volts required for the rear camera, through the 5 Volts signal that the DVR is capable of providing (which were enough for the original camera, but not for this one).

The mirror is reasonable discrete, with its conventional design. In operation it is a very useful gadget to have in the car. For example in slow traffic it helps define the expectations for the duration of the journey with the help of Waze:

In general it is a feature rich package, where features such as forward vehicle movement detection are quite useful during the slow traffic, to avoid impacting traffic with the distractions, and lane departure detection, which provides an extra degree of safety, when driver fatigue is a concern.

With the GPS antenna mounted in the vehicle (inside the dashboard), the device is quick to obtain a fix, and the number of locked satellites hardly ever drops below 8. The device is also capable of picking up the chinese satellite constellation, but normally there are few of these satellites in line of sight ( 2 at most, from what I could observe).

Another feature that the mirror was advertised as having, is a hardware police radar detector. In the ecommerce sites where the mirror is for sale, the existence of an app (only in chinese) is advertised. Given that this app was not preinstalled in the device, I asked the seller if he could provide a link to the app. Soon they replied with a link to an apk file with the name "YuanDogRadar 2.6.11". I installed it and it corresponded to the app the presented in the product screenshots:

There is virtually no more information that I could find about this app, other than this screen. It is unclear if there is indeed a hardware detector, and if so, which bands it can detect.

It is worth noting that in the settings screen there is a serial port setting (/dev/ttyMT1). It is unclear however if this is for the hardware detector (if it exists at all), or if it is for the GPS serial port (most apps don'r require the user to provide this info though).

In my testing I have only left the app running, during a test drive. There is a chinese female voice that talks frequently (which I understand 0 % of), and occasionally the application beeps while I am driving the car. It never beeped while passing by the known fixed radar spots. In the center, a dial displays the GPS speed.

Sunday, January 27, 2019

Car DVR replacement and related shenanigans


With the vulgarisation of miniature cameras and computing devices of all sorts, technologies that fundamentally serve the mobile industry become cheap enough and available to the point of being useful for other purposes. That is the case of DVR devices for automotive use.


Some time ago, I bought very cheaply (about 30 Euros) a basic DVR in the form of a rearview mirror. It worked well, serving two main purposes: 1 - continuous recording (of both rear and front cameras) during driving; 2 - provide rear view camera image while backing up the vehicle.

However the device failed partially, when in one occasion I was connecting the reversing camera jack to the device. Because of a mod I did previously (in order to support a replacement 12 Volt powered reversing camera) I let 12 Volts be present at this connector, probably being sufficient to put excessive voltage at the video input during insertion of the jack. The analog input for the rear camera ceased to work ever since.

New device

This was the opportunity to replace this device with a new one. While looking for alternative devices, I found one (among very similar products) that caught my attention: it was a complete replacement of the car original mirror, instead of strapping on top of the later, as it was the case for the previous unit.

While not being a fresh new hardware architecture (it is a 2017 design, featuring a Mediatek MT6735 quadcore chip and running Android 5.1), it still has a number of features which made it an interesting proposition for the price (which is obviously higher the original unit I had). I ordered it from Aliexpress, even though it can be ordered from some other chinese ecommerce sites:

Like other DVRs, it also continuously records to a MicroSD card (it is readily recognized by my Kingston 128 GB (type 10) card formatted in ExFAT), and it displays the reversing camera when the gear is engaged. A second MicroSD slot is available for using with the GPS tracking or other I/O operations that could upset or be delayed by the constant access to the main MicroSD caused by the continuous video capture.

It also has a host of other features, and given that it is a regular Android device, most regular apps such as Waze, Sygic, Torque, etc can be installed.

For example it has some ADAS (Advanced Driver Assistance) features such as warnings for:
  • collision avoidance - it warns if the car is too close to the forward vehicle, from a certain speed;
  • lane departure - it warns if the car leaves the current lane;
  • forward vehicle movement - tells if the vehicle in front started moving,when stopped in a lane of traffic.
While it is not a Mobileye, still in most of the times I could test, it correctly detects these situations. It is a pretty impressive package, considering that is solely based on vision, using generic hardware. It is worth noting that these types of features are often not originally available in many current vehicles.

An app for the smarphone, called CarAssist, is also part of the package:

It provides an interface for managing the DVR recordings, stream the via wifi (the device can be put in hotspot mode), and download/share on social networks.

Using the device own 4G connection, it is possible to monitor the front and rear cameras (with a reasonable quality stream) in realtime, from the app.

These recordings can also be stored locally on the smartphone. At the same time the app displays the location of the car, and the tracking is recorded.


The installation can be a challenge for the less experienced user. Depending on the vehicle, the difficulty may also vary. Regarding the rear camera and the reverse light connection and cabling I did not have to do further work, as I would be using the existing camera and wiring that I had previously installed.

To install the rear camera (perhaps the biggest challenge), the user must find an appropriate spot (I personally choose to install it inside the car, close to the top part of the rear window.

After that the user has to plan how to do the cabling. In my case I have decided to pass it through the roof, between the steel body and the interior lining of the roof. In order to be able to pass the cable, I first pushed a long plastic strip across the roof, and once it reached the far end of the roof, I taped the cable to the strip. After being securely taped, I pulled the strip, and the cable followed. Repeated this process in every path requiring cable to be passed.

While the new DVR had a slightly better original camera:

still it was no match to the FPV camera that I had already installed in the car since the previous DVR.

This camera features better low light sensitivity, and a wider field of view compared to the basic camera provided with the kit. It is a Eachine C800T, typically used in FPV drones. It can also be easily purchased in chinese ecommerce for 10-15 Euros:

Unlike the original camera, which would be powered by the 5 Volts coming from the DVR, for this camera it would not be enough, being in the low end of its voltage range (5 - 15 Volts DC). For stable video, 12 Volts would be ideal for this camera.

Given that the this new DVR also provides 5 Volts for the rear camera, and I would want to retain the DVR ability to control the power to the rear camera (like for example switching it off for power saving), a different solution would be required.

A basic solution would consist of running the camera from the car ACC rail, which provides 12 Volts only while the key is on. This however is not ideal, because during remote operation of the DVR via 4G cellular connection (e.g. during use of the CarAssist app), it would not be possible to power the camera on.

This reduced to potentially just one option: to control the camera through a relay powered by the 5 Volt pin of the DVR. This would allow 12 Volts to be switched based on the state set by the DVR. The 12 Volts would be provided by the battery B+ source (always available) just as one of the DVR power rails.

In order to properly organize the connections and include the relay and a filter for the reverse light signal (more on that later), I built a simple PBC board, containing those two items:

On one end would be the DVR mirror round 8 pin connector, and on the other end, the 8 terminal connector that would mate with the corresponding connector on the car side:

The power (ACC, B+) along with camera signal and reverse light signal would be routed via the different cables towards this connector.

In order to have access to the fuse box, the cables would have to be routed through the inside of the left front window pillar:

Zip ties would allow these cables to be bundled with the existing wire loom. The side opening of the dashboard would allow for access to the fuse box from behind, also allowing the cables from be further tied to the existing structures:

GPS antenna

Given that this device is also enabled in terms of localization, a GPS radio is (almost) necessarily present. In this case, the sensitivity of the receiver is quite impressive, sometimes enabling a lock to be acquired, even withouth the GPS antenna connected.

I wanted to maximize the ability to properly receive the GPS signals, while at the same time keeping the installation clean and discrete, by keeping the antenna concealed.

First, a small optimization in the antenna housing was performed: given that GPS antennas are no more than patch antennas (a square  conductive plate - the active element, on top of a ground plane) featuring a low noise amplifier colocated with the antenna body, the ground plane should in general be as large as possible.

As such I tried to increase the ground plane surface by attaching a copper plate to the bottom of the unit. This would at the same time, depending on where the antenna would be placed, allow the ground plane to be increased by just placing it in contact with another metal structure.

I first opened the antenna casing, which was ultrasonically welded inside:

Drilled an orifice in the center of the plastic base:

Cut a copper plate to match the dimensions of the base:

And soldered the antenna amplifier can to the copper plate:

In order to be easier to attach the antenna to another structure, drilled several orifices in the casing in order to allow zip ties to pass through:

Regarding the location where to attach the antenna, I tried to find a spot inside the dashboard which would not be covered by metal and where the presence of the antenna would not mechanically impact any function on the dashboard.

Without going through greater lengths dismantling the dashboard to find the ideal spot, found a place which would be sufficiently good: under the ventilation fins on the left side of the dashboard:

It was of easy access, and the only obstacle between the antenna and the sky would be plastic and glass, as such with a negligible relevance at the wavelengths the GPS system operates.

Next I will be posting some details on the rear camera installation, and on the overall operation of this new DVR.

Stay tuned!

Saturday, January 5, 2019

Adding metalurgical capability to a biological microscope - part 2

Like I had previously explained, I was able to obtain from eBay (for a minimally decent cost), just the bare vertical illuminator, which didn't include any accessories. The light house was not an exception. The vertical illuminator consists the main body:

and the light house, which in the original device would be based on a halogen bulb of at least 15-20 Watts:

In my case this part was missing, so when I ordered the illuminator, I knew I had to figure out a solution later.

Just as with the regular transillumination system that is built into the microscope, filament illumination was mostly the state of the art back in the 1960's when these microscopes were produced.

But today with high brightness LEDs being obviously mainstream, there is no benefit in trying to preserve the original lighting system. As such I did that modification soon after I received my Olympus KHC microscope. You may see the detailed steps of this conversion in this page:

For the epi-illumination system, it made perfect sense to follow the same approach, which in this case coalesced with the need for building a light source from scratch for this vertical illuminator.

There are hardly any disadvantages in using LEDs for the illuminator: these draw less power for the same amount of visible light, can be somewhat more compact (heatsink size must be factored-in), and the light wavelength is consistent across the entire range of intensity control. This removes the need for adding a daylight filter to the light output. Also, there is very little radiant heat emitted, being less likely to disturb the certain types of specimens.

This light house would have to fit the vertical illuminator tube, the same way as the original part from Olympus. As I don't have any lathe or machining gear, I had to figure out which readily available metal tube of some sort would be adequate.

A trip to the chinese store, and found one of those basic aluminium LED flashlights with the dimensions (in particular the head part) that seemed appropriate. Not exactly this model but somewhat similar:

Image result for led flashlight

The idea would be to use the head (where the LED is housed) and scrap the rest.

The LED itself I didn't reuse. Instead I have ordered a few 10 Watt cool white LEDs:

This would theoretically give a greater power margin if required, and as it is composed of an array of discrete LEDs distributed of a substantial area, could potentially (with a proper diffuser) provide a more evenly distributed light across the area of the vertical illuminator light path.

In order to drive the LED I went for a basic constant current device that can easily be found on chinese suppliers online. It is based on an LM2596S step-down regulator chip:

This is the same model that I have used previously for the transillumination conversion.

I did a small adaptation to be able to control the light from a 1 K linear potentiometer. It consisted of: 1) set the voltage control trimmer pot to an optimal value; 2) use the current limiter trimmer to set the current limit for the LED operation; 3) add the new potentiometer in series with the voltage control trimmer. By adjusting it, the light output is varied between a near-off minimum, and the maximum within the limit set by the trimmer.

Was also able to find online in the same supplier, an extruded aluminium box with the adequate dimensions. In order to correctly place the LED driver board inside the aluminium enclosure, mounted the PCB over a perf-board PCB with the exact dimensions to slide within the rails of the enclosure and exactly fit inside:

The potentiometer was mounted to the side of the enclosure, for better accessibility during the operation:

One of the panels served to fit the LED assembly built based on the flashlight head:

The rear panel would house the DC connector and the power switch:

With everything mounted and soldered, it would be time to put it all together:

And at last, the finished product:

Attached it to the vertical illuminator, and went on testing it with a metallurgical specimen:

The result fell within the expectations, with a reasonably homogenous light obtained. A proper diffuser is still to be added to the light path. The individual LEDs in the chip produce some brighter spots which are less perceivable depending on the position and adjustment of the light house.

The next step in the microscope improvements will be to replace the binocular head with a trinocular one.

I spent some time patiently looking for an adequate deal on ebay for the trinocular head that fits this microscope. The few auctions I found for this head in particular, had quite high asking prices. The only alternative I could find was a nearly complete Olympus CK inverted microscope featuring this head and its eyepieces:

As the seller wasn't interested in getting an offer just for the trinocular head, I ended up proposing a value for the microscope which the seller accepted.

Once it arrives, I will test the trinocular head, and attach to the SLR camera. With this head in place, photomicrography will be much more convenient to perform. Hopefully will post on that matter, once the microscope arrives.