cool stuff man, I just turned 18 myself 2 days ago and I'm about to begin work on my Scion tc. From your thread, it seems like you have a lot more experience in the car/software realm of things. My only real strong suit is computer hardware (I've built three gaming computers and a server). Anyways, I'm hoping maybe I can shoot you a PM if I need any help.
Either way, your build is coming along really nice, I'm looking forward to seeing it all done.
Yeah I really need to put up pictures. It pretty much is "done." In that, the pc works, the screen is in my dash and everything works as intended. Now I'm redoing everything for better style, now that I've made all my mistakes.
Originally Posted by BenKenobi
If you need help, shoot me a PM. The forum is the best place to get help though, since I'm just one guy and the forums are full of people.
When I first started this, I had very little idea about cars and car electronics. Computers and software were my strong points. I knew a bit about electricity, but my knowledge in cars and electricity has come a LONG way since I started this project.
Just don't give up on things and you'll learn a lot.
By the way, weren't you ****ed at your friend when he broke your sunroof? I would have been so mad lol but you were laughing about it
I wasn't that ****ed. At first I was like "WHAT THE F***!" (Picture me in the driver seat and him in my lap with his arms covered in blood and glass everywhere.) Then I scared the crap out of him and told him he was gonna have to pay for it and that the sunroof costs about $600. I let him think that was true for a little while before telling him that insurance covers all glass.
Originally Posted by BenKenobi
I had school vacation last week, so I've been getting a lot done on the car.
I'm now using centrafuse 3. I've made my own plugin for it which controls all my electronics in the car through an interface with the fusion brain. This plugin also has my own HTTP server built into it which allows you to control centrafuse through GET requests.
That will set the volume to 50. Now what's cool is that I already had a python web server running on my sheeva plug, so that recognizes requests that need to go to the real computer and then passes them on. This continues to work up the chain to my AIM bot and therefore to text messaging.
Sending the text message: vs:75 to my AIM bot will set the volume to 75 in under 2 seconds. Nice.
I then needed to get more performance out of my setup because in the car, I programmed the centrafuse plugin single threaded so the requests would block the GUI thread. Real annoying. So what I did was made the web server on the sheeva plug run in 2 threads on 2 different ports. So the car computer accesses it on port 81 and the web accesses it on port 80. I then went a step further and made every command you send execute in its own thread so that web server can respond instantly to requests. Massive performance increase.
This performance increase has allowed me to expand some more... I now made an AJAX web page for controlling the car. Works great delay is less than half a second with good service.
I'm working on an IPOD touch app too so that when I have my IPod touch in range of my car's wifi network, I can control everything.
I finally put in underglow and door handle lights. All LEDs.
I installed a light senor on the fusion brain which determines when it's dark out and then turns on the underglow, door handle LEDs, and the interior blue lights. To prevent it from flicking on/off with street lights it takes samples of the light over the course of 30 seconds before doing anything. Flawless.
I finally ran a power/ground wire from the computer PSU to the touch screen and I now got rid of the ground loop there and also the interference lines in the screen.
Tonight I've been working on building a gas price plugin for centrafuse 3. I'm opening it up a little bit more though and I'm providing a DLL for gas information. This way, my DLL does the heavy lifting and anyone can interface with it to make an interface for it however they like.
So far, it successfully downloads and interprets the gas prices, gas station name, and the address of the gas station. Now I need to make the information sortable and interface with google maps to get the gps coordinates of each gas station. From there I'll be able to get accurate distance measurement from GPS. Maybe I'll even take it a step further and make it interface with iGuidance or garmin.
This weekend I rebuilt my install. I know a lot more now than I did when I originally put the install in so now I did everything perfectly made the wiring job as clean as is possible with 300 feet of wire that is in that car and hid the wires which needed to remain a bit messy (that means you fusion, brain.) Next weekend I will have completed the install. I'll do more explaining then and post pictures.
I've always had a ton of noise in my car. Part of the reason for this rebuild was to eliminate as much of that noise as possible.
My install goes Computer --> Line Driver --> amp1 --> amp2 --> amp3 so I had 4 potential points for a ground loop.
I plugged my Mp3 player into the first amp in the chain and there was no interference so I knew the loop wasn't between two amps.
In an attempt to remove the noise, my line driver pulls less than an amp so I plugged it into the computer. Theoretically there should have been no ground loop between the computer's audio out and the line driver so I just plugged a ground loop isolator in between the line driver and amp1. This combination eliminated virtually all noise, however there was still a tiny bit of it. Also, now when I revved the engine with nothing playing I had an intense alternator whine.
Next I tried putting in a line driver between the computer and the line driver. Hmm. All the noise I used to have was back.
Now I removed the line driver and kept a ground loop isolator in. Still tons of noise. Now I removed the ground loop isolator. Perfect! No noise. Nothing playing, speakers still 100% silent. Not even the slightest hint of alternator whine.
Turns out the line driver was a piece of junk that was just picking up every bit of EMI possible. I guess I don't need 130dB. Without the line driver I can still crank up to 125 dB without distortion.
I don't know what I was thinking for putting that line driver in. My sound system is $1,000 without any subwoofers. I was feeding this from a blitz audio line driver. When I initially put it in, I noticed no difference in sound quality. Now that I've rewired everything with better cables, grounds, etc, the difference is simply unbelievable. You can't even imagine.
Back at it!
Okay it's been a while since my last post. I was busy with school for the past few months and now it's summer. I'm back at it with this project. That said, heres what's going on.
I completed the rebuild mentioned in the last post. Now it's time for rebuild 2.0. This will be awesome.
Before I had messy wires. I was hiding them well enough but it was a pain to do anything or trace any issues. Now that's all changing.
I've purchased two focal 10" subwoofers and a sound ordnance 4 chanel amp stereo bridged at 4 ohms x 2 for the subs.
The subs are going on either side of the trunk in custom trapezoidal boxes angled back and towards the middle. The floor has been rebuilt also. It is two pieces of mdf. One for the front of the trunk and one for the back. The subs sit on the back piece. The front piece has 3 of my 4 amps sitting on it. With a second layer of extremely strong plexiglass on top of them. With fans shooting air across the sides. This amp case is lit up with blue LED strips.
Since the spare tire is underneath, the case for the amps needs to be easily removable. I'm wiring it with 4 awg disconnects, and a remote line disconnect. The remote line is actually triggered by a relay on the fusion brain capable of 25 amps. So to minimize wires, the blue LEDs just tap their positive from the remote line and their negative at one of the amps grounds.
The accessory battery in the well right behind the rear left wheel. It's attached to a fuse then to a 200 amp relay then to a circuit breaker then to the starter battery. The amps tap power at the accessory battery so they don't drain the starter.
I've been struggling with relays not getting powered when the battery runs down. What i've done to cure this is purchased an adjustable 12 volt regulator. I set it to put out 13.20 volts constantly. The input range is pretty wide so this really helps with the relays and smoother power in general.
I've killed 2 optima batteries by now. This is a huge issue. It turns out whats happening is like this:
Before the accessory battery was an optima and the charger was hooked up to it. When charging, I would have the batteries non-isolated so both would charge. The car would still be attached to one of the batteries and the sheeva plug/fusion brain/usb hubs were hooked up to the accessory battery. So the charger never stopped charging the batteries. They would repeatedly get overcharged!
To remedy this, one of my desktops recently died, It had a beastly 800 watt power supply. It had a 30 amp 12 volt rail. I hacked up the atx connector so the power supply would turn on instantly when it gets AC power. Connected to its 12 volt rail I have a 12 volt spdt relay. Connected to the "normally on" terminal of the relay is the accessory battery. Connected to the other terminal is the computer power suppply. So when the computer power supply gets plugged in, it switches the relay and then it powers a 5 volt regulator for the sheeva plug. a 12 volt regulator for the fusion brain and it also powers the pc itself.
Now any of you who know a bit about electronics know that theres some flaws in this design... first, relays switch slowly. So everything hooked up to the relay will just shut off. To counteract this, I had an extra 1 farad monster capacitor lying around. I hooked that up after the relay to make it work. This introduced a new issue. The capacitors power would go to powering the relay until the capacitor died, essentially causing the same issue. Also, if switching from battery to PSU, the PSU would go into protect mode because the capacitor was charged at 13 volts and the computer power supply only put out 12. Solution: 85 amp diode hooked up to the output on the relay. Power only flows one way now and everything works flawlessly.
Huge rewrites of all the sheeva programs now. Efficiency is how effectively something does a task. The software that is currently running the car is efficient in the sense of low cpu/ram use and it's quick when it works. It's buggy as hell though for a number of reasons. I realize i'm only using 2% of the CPU of the sheeva on average. SCREW THAT, I want reliability, speed, and effectiveness. Here comes my set of efficiency.
I love databases. I love SQL. They make amazing things happen. I was running a python based http server that I hand wrote before. That same app was running on multiple threads, reading the fusion brain on the dbus and all the "if this then this" rules were hardcoded. Sql to the rescue... Now there are a bunch of different python scripts running at all times.
1. Read the fusion brain. It reads twice per second and stores the values in a mysql table
2. Read set the relays on the fusion brain. I randomly have two relays not effectively get turned on for various reasons. Now: MySQL table with a row for every relay. Says what power state the relay should be in. The python script repeatedly goes through that table and tells the relays what to do.
3. GPS app reading GPS data and storing it in another mysql table.
4. OBD2 app reading obd2 data and storing it in another mysql table.
5. Bluetooth app storing connected bluetooth devices in another table.
6. Network app going through the wifi network in the car and scanning for connected devices and storing these in yet another mysql table.
OKAY now thats a crap-ton of data to play with, isn't it? What the heck do we do with it...
8. Data compiling app. This is where mysql makes this setup real clever. There is a table in the database which holds views of data that I care about. Basically there are two columns in the table. One column has the name of the object I care about with a readable name, ex: cartemp
which will hold the temperature of the car. The second column actually contains a mysql query. Yes, a mysql query inside of a mysql table. So the query's job is to return just a single cell and the data compiling app takes whatever value that is and stores it in the compiled_data table for faster access.
9. Rules app. Because the relays can be controlled through a mysql table, ANYTHING can be. The rules app processes a rules table. The rules table is similar to the views table. Two columns. If Sql statement in the first column evaluates to true, the sql statement in the second column is executed. So simple.
10. Transaction program. The car's IP address changes quite a bit. I was using a dynamic dns domain name for communication to the the car. This was unreliable as it would change so often and dyndns would take time to catch up. The house's IP address remains much more constant. The home server already has apache/php/mysql on it for other purposes. It also has a C# programming listening to AIM and SMS messages with commands for the car. Currently it turns around and tries sending them to the car, but the moving target issue does exist often enough to **** me off. With all these new apps, much more data will be moving around as well. So to get efficient and reliable... an app on the car will take all the data in the compiled_data table and upload it to the home server using POST data in a web page. In response, php on the home server will fill the page with any new commands that were sent in by SMS/AIM. The home server will log all the car's data. If a SMS/AIM message is requesting data, it never needs to touch the car, it can just read from the local database which is up to date for the past few seconds. Lather, rinse, repeat.
The new design will hopefully be much more stylish, much more effective, much more reliable, and have many, many, many more features. I'll be able to add rules to a mysql table as I think of them through a web interface. I will even be able to add one-time rules.
I like that AFK fest is coming up, because this is forcing me to not procrastinate and get all this stuff done by that day. The physical install will be done tonight, and hopefully software will be done in a week. The split between programs and not worrying about cpu/mem makes it really easy to code. I don't see any of these scripts reaching much more than 30 lines. Mysql truly does all the heavy lifting.
Pictures will come in the next couple of days. I promise this time! Possibly a video real soon showing off some of the features.
Apologies for writing an essay here haha