Wednesday, January 8, 2014

Netbook Touchscreen Car PC

In this project I created a touchscreen car PC from an old Gateway netbook I had (the same one from this teardown post). The specs are about just right for what I need for a in car computer: 1.66ghz Atom N450, 1GB ram, GMA 3150 and a 10in 1024x600 display. All it has to do is run XBMC or some media player for listening to music and deal with a few peripherals such as a touch screen, media keys and possibly an OBD II bluetooth reader.

Running some XBMC, but still needs a bit of cleaning up.


Netbook Modifications

I started off this project by disassembling the netbook as I had done before in my previous post except this time it would go back together a bit differently. I followed what other people have done when making tablets from laptops: remove the lid hinges and flip and rotate the display so that the back is now laying on top of the keyboard. Then, just throw a touchscreen on top. Mine was a bit complicated since there are two wifi antennas (one on each side of the display) and they had different lengths of cable. When I flipped the display the short wire was where the long one needed to be. But with a bit of tinkering i got it all sorted out.

Everything stripped out mostly. Now I can get to those hinges easily.

Flipped screen and reassembled.

Test fitting and trimming as needed. And some Farscape in the background (awesome show by the way!)

Velcro worked great for holding the display on.

.
Better airflow? (and more Farscape haha)

That's the video cable underneath the duct tape. It has to loop around like that because of the flipped screen. Also, as you can see, i'm putting Ubuntu on this. Windows would be slower and less customizable. I started out with a few different Ubuntu distros in mind, but ended up using 10.04 LTS Netbook edition because it was the first distro I tried and I didn't run into any complications.

Mounting To The Dash 

An undoubtedly critical part for safety (for me and the netbook) and usability is mounting the netbook to the dash. No duct tape, no glue, it has to be fairly professional while being detachable with a close to stock look after removal. Im currently thinking about those glass suction cups or maybe velcro. I am thinking about mounting it above the two center vents.  This is what I have to work with:

Close to what my car actually looks like

 Shows a bit more of the dash

Sits perfectly on that ledge.

Added velcro to the back of the netbook

<picture of dash with velcro xD>
and some to the dash....

Additional Electronics

This part of the project was divided into a few different sub projects. Unfortunately, only part of this section is complete because i'm waiting for parts in the mail or still buying them. 
-touchscreen
-power for the laptop while in the car 
-engine diagnostics
-media controls

The Touchscreen

Using a laptop in the car (while driving) is ridiculous and very dangerous, so, I opted for a touchscreen which made this project no more "dangerous" than cars with fancy integrated touchscreen control centers. This netbook of course doesn't have a touchscreen so i had to go buy one of those USB touchscreen overlays. You can get a 10in touch panel for about 40$ on ebay.

What you see in the image above is exactly what I got in a very nicely padded package. I must say I was quite surprised with the level of packaging they put around that screen. It comes with peel off plastic sheets on both sides of the display to protect it also.

Installing it was quite easy, actually. I checked the orientation of the screen (there are a few numbers on the bottom) and then just put some double sided tape on the metal bezel of the LCD and trimmed the excess. After a thorough clean with a microfiber cloth, I carefully aligned the touch panel to the LCD.

Next, I noted the layout of the wires going into the driver board and removed the connectors so that the board would fit behind the LCD (where the keyboard was). I then removed the usb connector from an old flash drive and soldered some wire to the drive board. Unfortunately, I don't have any internal usb ports like the a lot of the Asus netbooks do. So, i'm left with two usb ports which really is plenty for a car pc.

Now comes the hard part: getting it to work within Ubuntu. I was quite surprised that the touchscreen worked at all in Ubuntu, because I didn't really know much about Ubuntu's support span: it does seem now that most touchscreens will work out of the box with Ubuntu, just maybe not in the desired way. My screen for example, had the axis swapped and the x axis inverted. I spent days researching and trying out different versions of Ubuntu (none was better than the other in terms of touchscreen support) and other software.

...Eventually I found the answer.... In order to flip the axes and get my screen working properly I had to modify my 05-evdev.conf file. Evdev is a driver that handles all the keyboard, mouse and similar inputs. This file can be found at /usr/lib/X11/xorg.conf.d/05-evdev.conf. Since this is a system file you'll need root privileges to modify it: the easiest way to do this is to open terminal and run:
sudo gedit /usr/lib/X11/xorg.conf.d/05-evdev.conf

Towards the bottom you'll see something like this:
Section "InputClass"
   Identifier "eGalax"
   MatchProduct "eGalax"
   MatchDevicePath "/dev/input/event*"
   Driver "evdev"
   Option "SwapAxes" "off"
EndSection

It needed to be like this for me:
Section "InputClass"
   Identifier "eGalax"
   MatchProduct "eGalax"
   MatchDevicePath "/dev/input/event*"
   Driver "evdev"
   Option "SwapAxes" "on"     #this swaps the x and y axes when set to "on"
   Option "InvertX" "on"
   Option "InvertY" "off"         #for inverting y, if needed
   Option "Calibration" "89 12854 120 32767"  #calibrates the touchscreen
EndSection

Once I rebooted the axes were finally correct and I just had to calibrate the screen. To do this I used xinput_calibrator (not found in the repos, use this link). Once installed, it can be found in the system menus or by running xinput_calibrator in terminal. After pressing all the cross-hairs (use a stylus to get that precision) it will give you a string of numbers similar to 89 12854 120 32767 that you see above. Simply paste these into the 05-evdev.conf file and reboot. For some reason my calibration wouldn't "stick" so I copied the command it also gives you after the calibration and created a startup program (also found in system menus).

Charging The Computer While Driving


The easiest, but also most expensive (and least fun haha) way to accomplish this would be to get a 12v DC to 120v AC adapter and just use the power brick that comes with the computer. I instead choose to simply convert the 12v DC to 19v DC (the voltage the computer needs) with a boost converter. 19v is not a standard voltage regulator voltage so I had to use an adjustable boost converter. My other laptop also uses a 19v power brick so I can now charge either of my laptops while in the car!


Before I learned that my other laptop was also 19v, I found exactly what I needed: the LM2577, a 3A general purpose boost converter. The netbook claims it needs about 2.2A @ 19v to charge so 3A should provide a good safety net and reduce heat because its not maxing out the converter all the time. My other laptop however, needs 4.4A @ 19v to charge. So then I had to find another similar, but higher rated boost converter. This time it was a LM2587 5A converter, although, the data sheet said the max current was 9A, the typical was 6.6A, and the min was 5A so im not sure why its a 5A regulator. Either way it should be just fine.

Originally, I wasn't so sure about using a boost converter. They use flyback transformers and inductors to "step up" the voltage and I haven't had any experience with these components. But with a bit of reading around and looking at the datasheet I realized they're not that all complicated to use. It tells you the specifications it needs to have to work in the provided circuit diagram and electronics are a bit lenient. 

Then I obtained all the necessary parts for the converter. I got a free sample of the TI LM2587 and I ordered the passive components from Mouser. Here is a link to the shopping cart for all the passive components. Note: you only need one of each item per LM2587 converter. In the circuit diagram R1 and R2 determine the output voltage of the LM2587 and to calculate it, the following equation is provided: Vout = Vref (1 + R1/R2). Vout is the voltage you want, Vref is internally set to 1.23v, and R1 and R2 are the values you have to find. Obviously you cant find two unknown values in an equation, so you have to guess and check. For example:

Vout = Vref (1 + R1/R2)
Vout/Vref = 1 + R1/R2
(Vout/Vref) - 1 = R1/R2
R2 = R1/((Vout/Vref) - 1)    <--simplified equation (yes, your teachers were right, math is useful o.O haha)
R2 = R1/((19v/1.23v) - 1)
R2 = R1/14.447

Now all we have to do is put any resistor value in for R1 and the equation will find the proper value for R2 that will make the converter produce 19v. The hard part is getting two values that are close to a standard resistor value. I saw in the datasheet that R1 was always bigger than R2, for example 50K vs 2K for R2. So, i tried 82K which gave me 5.67K for R2, but there is no resistor with that resistance. However, when R1 = 68K, R2 = 4.706K and there is a standard value 4.7K resistor. I have found the perfect set of resistors!

And finally the info. Here is the TI product page and here is the datasheet. Below you will find the circuit diagram for the adjustable LM2587 that is found in the datasheet:



ELM327 OBD II Bluetooth Adapter


At some point I hope to add a engine status screen to the laptop so i can see more advance engine data while driving. These bluetooth adapters are a great way to do it. You can find them for 10 to 20 dollars on ebay and amazon (or pretty much anywhere) by searching for ELM327 OBD II. If you have an Android tablet the best option is to use an app called Torque with these adapters. Im guessing there's already a program for reading these things and if not it probably just a serial data stream which i can easily manipulate.

Media Controls 


Even if it is a touch screen it'd still be nice to have some sort of physical media controller to use. I was thinking of using one of those encoder style knobs found in fancy cars that they use to control the user interface. It sorta reminds me of those Griffin PowerMates that you see Mac people (more) commonly use.



3 comments:

  1. Hi
    I would like to know if The input is 6 volt Can I get the output of 40 volts from LM2587. I would hardly require 500 mamp of current. Plz email me on akshadeep27@gmail.com

    ReplyDelete
  2. What a tremendous job you have done and seen us here about touch screen PC (notebook).It's really best in use,not much expensive and having awesome graphics.

    ReplyDelete
  3. Effective SCADA systems can result in significant savings of time and money. Numerous case studies have been published highlighting the benefits and savings of using a modern SCADA software solution such as Ignition.

    ReplyDelete