Vehicle Accessory Computer Interface

 by bigbro_1985
05092010576.jpg
05092010577.jpg
05092010580.jpg
15092010590.jpg
15092010595.jpg
15092010600.jpg
15092010605.jpg
PA160063.JPG
PA210084.JPG
PA210085.JPG
PA210086.JPG
Introduction
The following document will provide information to develop your own VACI. What I have done is rather simple however it took about 3 weeks of planning, programming and Debugging. The wow factor on this interface is awesome; everyone that has seen/used the system wants one in their car. The system can also be modified to automate accessories, and by using a CAN-Buss system you would greatly reduce the amount of wiring.

Specifications
• 2X 8bit Red Green Blue arrays, 100mA sinking capacity per channel. For use with 
  Common Cathode RGB amplifiers (12V).
• 8 General Accessory outputs, 100mA sinking capacity for relays (12V).
• 7 Sinking outputs to connect to digital AV switch.
• Compact fits inside AV switch

Requirements
Hardware
      o 5 or 6 Channel Digital AV switch with pull up resistors on each normally open button.
      o Car PC (Preferably Lilliput PC745)
      o Common Cathode 12V RGB LED Amplifier
      o Standard 12V Automotive relays (coil needs to use less than 100mA)
      o Pic Programmer (Preferred PicAllw)
      o 1X Pic16F877a
      o 3X ULN2803AN
      o 1X SP232 – Can be replaced by MAX232
      o 2X 100nF Capacitors
      o 2X 10uF Capacitors – SP232
      o 2X100uF Capacitors – SP232
      o Some extra 100nF, 10nF, 1uF and 10uF capacitors to help suppress PWM noise.
      o Development board – Optional(http://www.olimex.com/dev/pic-p40.html)
      o DB9 – Connector for RS232 Communication
• Software
      o Visual Basic .Net 2008
      o Proton PicBasic Plus
      o Pic Programmer Software (Preferred PicAllw)


Points of Interest
It all started after I installed Red Green Blue under/interior Glow and I decided I simply don’t like the RGB controller by the manufacturer. I was then given a Lilliput PC745 as a gift for helping a friend with an Interactive Learning software.  So I figured what the heck, I'll control it by Touch Screen.

I’ve been programming PIC16F’s since the age of 13 so guess what, I decided to use a Pic16F877a. I already owned a PicAllw programmer and a copy of Proton PicBasic Plus. The first thing I did was a single channel 256bit software PWM. Which was simple and I achieved it within a day, I then continued to develop code for a single RGB PWM array through software which took a further 3 days.

Developing a system with two RGB PWM arrays through software PWM, was more of a challenge. The main struggle was the refresh rate. At first I used a timer interrupt to execute the software PWM code, however the LED strip was flickering. After a week of tinkering with the code I ultimately placed the code in the main loop without a delay.

The only interrupt in the code is to receive the Serial string which controls the RGB LED’s.
Once I successfully got the two arrays working I started writing code for a color picker. I wanted style and high-tech, so I designed a color picker similar to paint brush. So the color can be selected by a single touch to the screen.

Because of the many I/O pins of the PIC16F877 I decided to place some accessories on the free pins. The first thing I wanted to control from the touch screen is my AV switch, which selects the inputs for my head-unit, GPS, PlayStation, front and back camera. Each AV switch output just needs to cycle to “Push the button” which was done in the main loop when the PWM counter resets.

Then I used the 8 pins on port D to drive general outputs for any other accessories, one of which I used to connect to my garage door opener.

I will only provide code and information for VB.NET 2008, which runs on Windows XP and WindowsCE5.0 specifically for the Lilliput PC745.

PC745 Resources
AV, FM, Volume & Brightness Controls: http://www.codeproject.com/KB/miscctrl/LilliputPC745.aspx
My Application
http://www.cardomain.com/ride/2914719

History
•16 September 2010 - Initial Post
 
Remove these adsRemove these ads by Signing Up

Step 1: Pic16F877A

PA210086.JPG
PA210085.JPG
PA210084.JPG
15092010605.jpg
15092010600.jpg
15092010595.jpg
15092010590.jpg
05092010580.jpg
05092010577.jpg
05092010576.jpg
If you don’t already have a Pic Programmer which can program a PIC16F877A or a development board that can either program or use a serial boot loader, I suggest that you use the Olimex Dip 40 PIC development board and buy a pic16F877A with a serial bootloader preloaded. This means that you would not have to purchase a programmer which is costly.

The reason I suggest the Olimex development is that it has a RS232-TTL converter, 5V Regulator, Reset button and 20 MHz crystal on board. You have access to all pins and you can buy it for under $20.

After you are able to program the PIC Microcontroller, you can either use just use the HEX file and upload that it, or you can open the basic file using Proton PicBasic Pro to edit the code and then upload.

I strongly suggest that you download the Windows XP test project to test communication with your microcontroller to make sure that you are getting all the outputs you desire. Connect a RS232 cable to COM1 on your PC and connect that to your Development board.

The VACI Module has been written to access the COM port on the PC745, which is COM1. It works fine on windows XP providing that you use COM1.

If you can communicate with the Microcontroller proceed to the next step
Pro

Get More Out of Instructables

Already have an Account?

close

PDF Downloads
As a Pro member, you will gain access to download any Instructable in the PDF format. You also have the ability to customize your PDF download.

Upgrade to Pro today!