Customised In-Dash LCD for RX8s

Languages: Embedded C (C30), ASM | DevTime: 2 weeks | Status: Completed

startexpress indashlcd Prototype indashlcd Prototype indashlcd Prototype indashlcd Prototype
It works! Hardware installed and ready The hacked up controller itself Controller wired for testing OpAmp / O.C limit board
startexpress
Initial attempt

Action video(s) - Courtesy of YouTube



Shot by PodeCoet during development


Shot by Kunz of Thrillex Multimedia

Project overview

This is a small sub-project I acquired on while taking a break from GPSBiTS. Once again, it was thought of by Kunz of Thrillex Multimedia and engineered by myself to his requirements.

Initially this was meant to be a straight-forward LCD transplant, however Kunz made me aware of another similar transplant project using the same LCD module, pop-up dash and vehicle. The key difference between both projects is the ability to preserve the electromechanical open/close/tilt functions.

As you may have guessed (or seen even), the unit is highly integrated - that is to say, the circuits and logic behind the control of the motor and LCD (as well as power supply and backlighting) are integrated into a single controller board, and cannot be seperated. A direct consequence of the LCD transplant is the complete loss of control of the open/close/tilt features (which is what happenned with the aforementioned project)

This was highly unacceptable, so new controller hardware was engineered along with the transplant - as you can see in the videos above, it works flawlessly ;)

Hardware details

The controlling hardware is based around two key components. The PIC18F4520 microcontroller (TQFP44) and the BA6286 H-BRIDGE IC. BDxxx transistors and MOSFETs were used to little success, mainly because I don't have much experience in fudging H-Bridges. The BA6286 was thus chosen for the task, as forward / reverse / open / short are controlled using two IO pins and a handful of support components, leaving plenty of room for additional features.

In addition to the microcontroller and HBRIDGE, there are a handful of support components (regulators, crystals, caps, diodes), an ICL3232 level translator (for PC control later on), and a triColor LED thrown in to take up some space.

How it works

I don't usually mention details of my projects inner-workings due to potential copyrighting issues (and my business partners having a spat) - but this project is an exception. Kunz has given his consent, it's generated no revenue to date, and I have no intention of building or marketting it - so here goes!

The pan/tilt functionality is controlled by single DC motor connected to the output of our HBRIDGE. That's right, a DC MOTOR and NOT A STEPPER MOTOR! - While I'm not sure about the reasonning behind this, I'm not terribly unhappy about it. Along with the motor is a trimpot attached to a cog to provide ratiometric feedback on the LCDs current position - Simply put, when used as a voltage divider, the voltage output is roughly proportional to the LCDs position in "space".

Since we only really need to know if the LCD is either fully open or fully closed, there's really no need to go through the headache of analog voltage measurement. The output of the potentiometer was wired directly to a comparator/OP-AMP to give us a simple logic high or logic low depending on the voltage level. The output of the OP-AMP was then wired to the microcontroller, and voila! We have open/close feedback.

Now that we know how to tell when the LCD is fully open or fully closed, we don't have to worry about over-driving the motor (and hence damaging it and possibly the hbridge / micro) - The next step was to wire the two controlling bits from the H-BRIDGE to the outputs of the microcontroller itself. The same thing was done for the OPEN and TILT buttons, with the exception of the addition of two pull-up resistors for reliability.

For a working unit, that's pretty much all you need! The firware was simply a bunch of nested IF statements written in C. It checks for button presses, and sends outputs to the HBRIDGE accordingly (00 for complete stop, 01 for forward, 10 for back, 11 for open circuit, if I recall) - Once the input from the op-amp goes HIGH (ie: the pop-up LCD is fully open), it's a signal to turn the motor off by issuing 00 to the hbridge. The situation is handled the same way via a second OP-AMP which senses the closing of pop-up LCD.

Tilt is handled almost exactly the same way, only to achieve slow controlled movement, a stop command (00) is issued to the HBRIDGE directly after a forward (01) command, roughly a 60% duty cycle. The more time you spend on a STOP condition, the slower the LCD will move in space. The hbridge actually short-circuits the motor during a stop condition, so the kickback currents can be quite high. Therefore it's a good idea to heatsink your hbridge when dealing with larger motors.

Additional features implemented

Along with the basic open/close/tilt functionaility above, one problem remains. There is no room for the LCD's power button, and adding another button would be ugly! The IR remote control is still usable to power the unit on and off, but in the event it's lost there will be no watching of questionable material until it's found. So what do we do?

There are still plenty of IO pins available on the microcontroller itself, so the obvious solution would be to "sense" when the LCD is switched off, then switch it on (and vice versa). To accomplish this, you need a multimeter, some coffee, time and patience - the idea is to probe around while the LCD module is switched on, and look for a voltage within the input tolerance of your microcontroller. Once you find a suitable voltage (three to five volts), switch off the LCD. If the voltage Zeroes out, that's your new sense output! If not, keep going

I found two decent outputs during my search, one was the VCC input to the touchscreen controller itself, and the other was the input voltage to one of the LCD multiplexers. The Touchscreen controller was easier to interface, so that was routed directly to an input pin on the microcontroller.

Now that we can sense when the LCD is switched on or off, we need a way to control that from the microcontroller. Upon checking the functionality of the LCD's former power button (now hidden beneath the plastic casing), I found it pulls an input LOW once pressed. To simulate this button press, I simply used an NPN transistor attached to an IO pin of the microcontroller.

That pretty much covers that! We have power sensing, and the ability to control power off/on from the microcontroller. Simple pre-checks were implemented in the microcontrollers firmware, under the routines that check for button presses. When "Open" is pressed, open the LCD, check for voltage on the POWER_SENSE pin, if 0, turn on the LCD. Same with tilt, and similar for closing the LCD (close the LCD and check for voltage. If present, turn the LCD off)

Additional ADDITIONAL feature requested

That's pretty much all aspects of control implemented, but it's still not enough it seems. Apparently getting out of your car, openning the boot, and hitting the RESET button on your PC when it crashes is considered an inconvenience - so we need a way of discretely performing this act without leaving the comfort of the drivers seat.

Without adding additional buttons, we sacrificed yet another IO pin of the microcontroller and a tiny amount of codespace. When both the OPEN and TILT buttons are held down together, an IO pin on the microcontroller goes HIGH, triggerring an attached NPN transistor, which in turn triggers the RESET input on the carputers motherboard. Simple yet elegant!



Go stand in the corner.