E90Post
 


Extreme Power House
 
BMW 3-Series (E90 E92) Forum > E90 / E92 / E93 3-series Technical Forums > AUDIO/VIDEO + BLUETOOTH + Electronics/Alarm/Software > Finally sewed up my Nexus 7 install!



Reply
 
Thread Tools Search this Thread
      07-19-2013, 12:44 AM   #1
alexwhittemore
Lieutenant Colonel
39
Rep
1,807
Posts

Drives: 2009 Crimson 328i
Join Date: Oct 2012
Location: Los Angeles

iTrader: (0)

Finally sewed up my Nexus 7 install!

I finally got around to tucking all the wires away on my Nexus 7 dash install!

The salient points of the install itself are medium integration, high functionality. I wanted to retain all OEM functionality, so I didn't go to the extreme of relocating the headunit or anything. I made an easily removable mount for my N7 that fits onto the existing mount I modded in for my iPhone, which sits just above the center dash buttons.

The important cable runs are: 1) A USB A extension run from that mounting point, behind the dash trim, around the passenger vent, and down into the fuse box area. 2) a USB A to B cable that runs out of the fuse box, behind the center console trim and up into the armrest. In the armrest is a small USB DAC, mostly to avoid a second cable to the N7 but also it sounds quite a bit better than the built in DAC. 3) a USB A to mini B power cable that runs from a cigarette lighter USB supply in the passenger footwell up into the fuse box behind all that trim. Basically this saves me having to add a cigarette lighter socket in the fuse box, and it's pretty well hidden in the first place so doesn't get in the way. As a bonus, one more USB power outlet for a passenger's phone.

Devices: The nexus 7, obviously. Important part here is software.

Power is provided by a Kensington PowerBolt Duo car charger in the passenger footwell. Uniquely, this little devil has two ports for a combined total of 3.1A output (Huge!) (2.1a on one port, 1 on the other). 2.1A should be more than enough for a generally charged tablet and a few accessories (hub, DAC, 3g stick, USB stick, others). And the leftover 1A port is still a comfortably fast charge even for newer devices.

The DAC is a no-name $15 Shenzen ebay special, but I'm still quite pleased. It's pretty obviously a datasheet-direct sample circuit for the burr-brown part it uses, tough to screw up.

The hub is some belkin thing I got from Fry's for like $7. Which hub you use in this case basically doesn't matter, with the exception that SOME power up quicker than others. When the injector power comes online, this hub is up and ready with the plugged accessories by the time the tablet boots, and everything works great. Another hub I tried (even cheaper) wasn't as quick, and the DAC wasn't recognized on boot - I had to replug the N7 to get USB devices back.

Finally, power injection is provided by a board I designed myself and had fabbed by OSH Park. If you're into electronics, that github link has the Eagle and CAM files, you know what to do. If you're not, but still interested in making the board, it requires minimal effort, $5 for 3 boards, and $10 or so in parts from Sparkfun for 3 boards. I can write up a quick tutorial and put a proper BOM in the github documentation, just ask.

Basically all it does is pass through data AND power, while tapping in power from a mini-USB port as well. The real point is that you can put it in the USB chain anywhere there's an A-male/A-female interface (like at the SLAVE end of a USB extension cable. Most readily available Y cables have the power insertion at the same end as the nexus 7, which is inconvenient.)

Software:
The Nexus 7 is running Cyanogenmod+USB Rom. The special sauce is the USB ROM, which enables two main things. For one, it enables hot-plugged USB DACs, and for two, it enables power-consuming host mode. Basically, in "fixed installation" mode, the N7 will consume power from an attached USB plug despite being in Host mode. Connected accessories REQUIRE a Y cable injecting power to function. As soon as that power goes away, the N7 will pause all music and go into deep sleep, where it consumes only a few mA of power. The internal battery should last a few months in this mode, without draining the car's battery at all.

Next steps: 1) I also made a USB power SWITCHING board, basically a relay that can disconnect power at will. I'm going to install this on the N7 USB line, switched by the Remote line from the headunit, such that when the headunit goes dark, the N7 automatically pauses music and goes dark as well.

2) as it stands, wheel buttons don't work with this setup. I need to get one of these suckers, which directly reads button output and sends programmable keystrokes to the N7 based on those. After programming, any button on the wheel can cause any action on the N7. In particular, the up and down buttons will become skip forward/back.

3) Ideally, there are a couple buttons I'd like to *repurpose* while there are also a couple I'd like to *keep*. Volume should control the headunit, but the voice command button is totally useless to me, if that were play/pause it'd be great. Such functionality would require much more thought to implement.
Attached Images
    
__________________
Appreciate 0
      08-18-2013, 04:47 AM   #2
dreamonn
Private First Class
United Kingdom
1
Rep
101
Posts

Drives: Alpina D3BT
Join Date: Jul 2013
Location: Leeds

iTrader: (4)

Nice job alexwhittemore

This is exactly the base setup I had in mind, & it's good to see that someone else has completed a similar project. I ordered most of the bits for my Nexus 7 install yesterday - my shopping list & initial ponderings are posted here Nexus 7 Car Install.

I'm going to try to integrate a reversing camera (& possibly a forward facing camera too) as part of the install. My goal is for a clutter free installation with maximum flexibility and usability. Do you have any ideas or suggestions for areas to locate the additional components? I have access to a PCB prototyper & a 3D printer so I can knock up boards & custom enclosures to re-package things if required.

Couple of questions:
Is there anything that you would do differently if you did it again?
Do you have any other plans to extend the functionality?
Are there any issues with using a Nexus 7 in a car install that still need ironing out?
Appreciate 0
      08-19-2013, 01:25 AM   #3
alexwhittemore
Lieutenant Colonel
39
Rep
1,807
Posts

Drives: 2009 Crimson 328i
Join Date: Oct 2012
Location: Los Angeles

iTrader: (0)

Thanks!

Quote:
Originally Posted by dreamonn View Post
Couple of questions:
Is there anything that you would do differently if you did it again?
Do you have any other plans to extend the functionality?
Are there any issues with using a Nexus 7 in a car install that still need ironing out?
There ARE a few issues, to the degree that I've temporarily given up on using this (my phone is easier and better still, for now).

The biggest problem is power. It happens to be the case that the USB cable I have supplying the N7 is relatively poor quality and high resistance, and the N7 throttles back how quickly it charges as a result. Unfortunately, the outcome is that the N7 won't charge under heavy use (GPS and screen, which is obviously prime functionality), and it'll charge only slowly with the screen off. That's a dealbreaker, but could be fixed with a new, better cable.

The bigger problem is power TIMING: I've got the cigarette lighter sockets wired to Terminal 30g (rather than T15), so they come on when the car is woken up from sleep (generally, powered from unlock to 30m after lock). Unfortunately, that means the 3G dongle powers off until the car is unlocked. On the one hand, this is good: it consumes a bunch of power, the battery would be drained and unable to start the car in a matter of days. Probably relatively many days, but it'd be a danger if you left on a long trip. Maybe a shorter trip, too. On the other hand, it means the dongle powers on at unlock. It takes a solid 15-20 seconds to get a connection and for the tablet to get online with it. It may not seem like long, but when you want to hop in the car, put on your pandora or find your directions, then get driving, you can do all of those things on your phone much quicker. Pulling it out and plugging it in becomes the much faster option.

Another power problem, the tablet is set to not sleep. That way, when you're using GPS or music or whatnot while driving, you don't have to use up concentration unlocking the tablet. Unfortunately, that also means it'll eat up 30m worth of battery after you lock and leave the car, only to advertise "HEY I'M A DESIRABLE GADGET AND EASY TO STEAL!" I planned to fix that with a relay PCB that would cut power to the tablet (but not the rest of the devices on the USB hub) as soon as you lock the car and leave. I was planning to do that by using the headunit's amplifier remote line as a signal, but it turns out that doesn't closely follow whether the headunit is on or not (for example, the headunit may be 'off', but the remote line still on for a few minutes), so it may or may not be good enough.

Finally, buttons. The steering wheel buttons obviously don't work for the tablet. I could get the device I mentioned to make skip forward and backward work. I could also probably assign the 'talk' button to play/pause. But then that'd require either disabling stock functionality of all other buttons, or coming up with a more clever device myself that plays man-in-the-middle for button presses, forwarding the ones I want and blocking the ones I don't want. More work.


Bottom line, I will probably revisit this, but for the $20 a month the freedompop subscription was costing me, it's easier and more convenient for now to simply use my phone
__________________
Appreciate 0
      11-06-2013, 02:38 AM   #4
alexwhittemore
Lieutenant Colonel
39
Rep
1,807
Posts

Drives: 2009 Crimson 328i
Join Date: Oct 2012
Location: Los Angeles

iTrader: (0)

I'd like to revisit this. My problems are:

Power: The USB cable system I have now isn't bulky enough and has too much resistance, so the Nexus throttles back and won't draw 2 amps like it needs to to stay alive on short trips.

Timing: The nexus doesn't dim as soon as the car's locked. This one is going to be hard, I think.

Internet: The FreedomPop stick is slow to connect when first powered on, especially by my house where there's poor service.

Mounting: That wire mount thing is ugly.

Buttons: Steering wheel buttons don't work.

--------------------------------------------------

Power I think the answer is to simply use bulkier cables. This might require some custom tweaking to get the cable to fit behind the dash trim, but should be doable. There's the possibility that, in USB host mode, the tablet WON'T EVER draw >500mA. That'd be a real issue.
EDIT: I just looked into this with my USB power analyzer. It seems there are two charging modes, "fast charging" and just regular-old. There's a toggle in the USB rom settings to enable fast-charging in USB host, which gives a big bad warning saying you could damage your battery. It seems, "fast charging" simply means "if you can use it, draw up to 10W", which is the normal mode in non-host. Which is to say, turn on that toggle and the nexus will take whatever power you give it, just make sure you're supplying enough for the nexus AND the accessories. So that's good. That means it's just up to me to make sure I've got a low-enough resistance wiring setup to the nexus.

Timing: Somehow I have to come up with a good way to cut external power to the tablet when the car is locked up. I don't know of any one line in the car that's effectively ON when the car is occupied but NOT ON when it's locked. I think the remote cable from the headunit would work, except I think even it stays on a bit after the headunit dims.

Internet: Easy. I was already paying ~$20/mo for FreedomPop because 500mb isn't enough. That $20 gets me an internet plan that includes tethering at AT&T.

Mounting: Easy: quad-lock. I can get one for my phone and bike while I'm at it.

Buttons: I think the only real solution here is to spring for the $50 aftermarket USB device. But that should take care of the problem. Unfortunately, it wouldn't on its own let me, say, INTERCEPT a useless button (voice command) and make it do what I want (voice search). That could be a project for later.
__________________

Last edited by alexwhittemore; 11-06-2013 at 03:01 AM.
Appreciate 0
      11-06-2013, 10:28 AM   #5
cdgatti
Lieutenant Colonel
cdgatti's Avatar
47
Rep
1,956
Posts

Drives: e90 328i
Join Date: May 2011
Location: KY

iTrader: (4)

I am thinking the ipad mini with the tune2air would be a nice setup.
Appreciate 0
      11-06-2013, 12:56 PM   #6
alexwhittemore
Lieutenant Colonel
39
Rep
1,807
Posts

Drives: 2009 Crimson 328i
Join Date: Oct 2012
Location: Los Angeles

iTrader: (0)

Quote:
Originally Posted by cdgatti View Post
I am thinking the ipad mini with the tune2air would be a nice setup.
In terms of replicating docked iPhone functionality, sure, but there are a few reasons I specifically want android:

Launcher. The android GUI is a bit more flexible, and there are already bunches of good car-mode launchers with nice big buttons, etc to choose from.

USB flexibility. Android allows you (with a custom rom) to enable USB host mode charging and wake on power/deep sleep on loss. I don't know that the iPad can be set up at all similar.

Future expansion: the hope is, in the future, to add some custom CAN bus hardware to allow for some combox-like features such as locate my car from another cell phone, remotely lock/unlock, perhaps even remote start. This is definitely all not possible (well, much harder) in an iOS environment.
Appreciate 0
      11-06-2013, 01:29 PM   #7
cdgatti
Lieutenant Colonel
cdgatti's Avatar
47
Rep
1,956
Posts

Drives: e90 328i
Join Date: May 2011
Location: KY

iTrader: (4)

Making hand over head motion... you are in a different league as far as what I want a 'phone' to do! My car is still first and foremost my device for getting from A to B and with a BMW really enjoying the journey. For me, but obviously not for everyone, all that stuff you talk about would merely give me too much to worry about.

But you go man - we need people like you to pave the way, so us slackers can pick up a morsel here and there!
Appreciate 0
      11-06-2013, 02:05 PM   #8
alexwhittemore
Lieutenant Colonel
39
Rep
1,807
Posts

Drives: 2009 Crimson 328i
Join Date: Oct 2012
Location: Los Angeles

iTrader: (0)

Haha, my friend's dad just bought himself a 5 series now that his kids are out of college, figured hey, wife and I might as well treat ourselves since our finances are suddenly amenable. What's hysterical is that he got a completely loaded 528 - he's not much one for power, but he wanted it as nice as possible. He doesn't understand how half the stuff in the car works, and it freaks him out when he accidentally turns on guidance. The HUD REALLY throws him off.

I'm the opposite though. Electrical engineer, I like doing this stuff just because it's possible.
__________________
Appreciate 0
      11-07-2013, 04:13 AM   #9
alexwhittemore
Lieutenant Colonel
39
Rep
1,807
Posts

Drives: 2009 Crimson 328i
Join Date: Oct 2012
Location: Los Angeles

iTrader: (0)

I worked on this a bunch tonight and found some peculiar things about charging.

Recall the problem I was having before was that the tablet would charge slower than replacement power under full usage and would die during a trip. I pulled out all the wiring, set it up on my bench, and got to testing. Sure enough, the tablet charged at like 250mA, which is nothing. And sure enough, the more wire I removed, the faster it charged. It seems the nexus is good about drawing only so much current the bus won't sag below 4.8ish volts. I had been using a big 6' extension on top of the 3' or so line feeding the power injector from my power source. After 18' of resistance (down and back), that worked out to be not much current at all.

Oddly, though, even CLOSEST to the power as I had cables to get, the tablet would only ever draw 4.5 or 5 watts (the stock charger is rated for double that!). Even with bulky powe-augmented homemade cables, that's not a lot of headroom to work with: 50% of theoretical max before you even start!

So I looked into using the dock port instead. Bingo! Kind of. Not actually at all. Well, I hooked some leads to my bench supply and touched them to the pins as per the internet (top pin with the screen right side up is gnd, bottom is 5v, and the two in the middle are audio). That worked GREAT. The tablet pulled 1.8 amps (!). So I went about figuring out how to interface that mechanically. It's a PITA. I settled on soldering some blobs onto the pins to make them stick out, then putting some copper tape on the inside of a shell-style case I picked up from game stop for $5 on clearance. It all ended up looking very ugly, but worked for prototype.

Unfortunately, while it sometimes worked right and definitely charged fast, getting power from two spots at once (USB plug AND dock pins) proved too confusing for the usbrom software. Sleep on power loss became unreliable, devices wouldn't connect, generally an unacceptable level of wonkiness for use in a car.

So I'm back at ground zero.

Well, actually I've got plans that are coming along. Details to come later.
Appreciate 0
      03-24-2015, 11:21 AM   #10
gbreadman04
White & Nerdy
gbreadman04's Avatar
United_States
0
Rep
21
Posts

Drives: 2007 E93 335i
Join Date: Mar 2015
Location: United States

iTrader: (1)

Looking to do a similar install on my car. I have a 2012 Nexus 7 32gb available for this, and I really like the 1-wire USB OTG feature. I'm confused, though, on how to get both audio (to the 1/8" input in the center armrest) and power (12v usb adapter) out of this? All the USB DAC's I'm finding only seem to output the audio, with no power pass through. Not trying to add any external flash drive storage or 3G connections, so I don't think I need a hub? A quick diagram of how it's all connected would be a big help.

Edit: I are also a engineer, but of the mechanical variety. I dabble in electronics, but more at a functional/end user level than making my own boards...

Edit again: I read up on this some more and think I sorted out what wiring setup I want for my application (no usb hub). Next question: any details on the mount, and any tricks on getting wiring tucked back into the middle of the dash like that?
__________________
2007 E93 335i, Step/Prem/CA/Sport, Burger stuff
2014 MINI Countryman S All4, JB+, Nokian WRG3 tires; 1994 Honda Magna
past: 2012 Sonic, 2005 Saabaru 9-2x

Last edited by gbreadman04; 03-24-2015 at 04:22 PM.
Appreciate 0
      03-31-2015, 01:59 PM   #11
zhen
Enlisted Member
0
Rep
32
Posts

Drives: 328IE90N52
Join Date: Feb 2015
Location: Halifax Canada

iTrader: (0)

i have exactly same ride as you do, same here im pretty craved for a navi or media system, this is really amazing...do you find the stereo sucks when you sit at the back? somehow it just sounds different as sitting at front
Appreciate 0
      04-29-2015, 08:13 PM   #12
alexwhittemore
Lieutenant Colonel
39
Rep
1,807
Posts

Drives: 2009 Crimson 328i
Join Date: Oct 2012
Location: Los Angeles

iTrader: (0)

Quote:
Originally Posted by gbreadman04 View Post
Looking to do a similar install on my car. I have a 2012 Nexus 7 32gb available for this, and I really like the 1-wire USB OTG feature. I'm confused, though, on how to get both audio (to the 1/8" input in the center armrest) and power (12v usb adapter) out of this? All the USB DAC's I'm finding only seem to output the audio, with no power pass through. Not trying to add any external flash drive storage or 3G connections, so I don't think I need a hub? A quick diagram of how it's all connected would be a big help.

Edit: I are also a engineer, but of the mechanical variety. I dabble in electronics, but more at a functional/end user level than making my own boards...

Edit again: I read up on this some more and think I sorted out what wiring setup I want for my application (no usb hub). Next question: any details on the mount, and any tricks on getting wiring tucked back into the middle of the dash like that?
I can discuss wiring a bit when I finally get around to reworking my current setup. I need to make a new circuit board that distributes both 12v and 5v with the timing characteristics I like. I'll write it up on my blog and post here when I do finally get to it. Feel free to keep bugging me for motivation

For organization, there are definitely some tricks. The mount I have now is a piece of sheet metal bent into a bracket that jams under the wood veneer trim - it's not very aesthetic and I'm planning to replace it, I mostly whipped together the cheapest fastest thing I could that would mechanically hold up to time and temperature swings. There are some kuda mount-based options I'm probably going to switch to.

Quote:
Originally Posted by zhen View Post
i have exactly same ride as you do, same here im pretty craved for a navi or media system, this is really amazing...do you find the stereo sucks when you sit at the back? somehow it just sounds different as sitting at front
I can't quite say - in my setup, it's MARKEDLY different since the sub is sitting in the armrest firing out, it tends to overpower the back seat. But then I'm basically only ever back there when I'm too drunk to care and someone else is driving us all around
__________________
Appreciate 0
      04-30-2015, 11:15 AM   #13
ajaye
Private First Class
7
Rep
175
Posts

Drives: 07 328xi SGM
Join Date: Dec 2014
Location: Pittsburgh

iTrader: (0)

As for the Timing issues, I was thinking about a setup that relays the action of locking and unlocking the doors with the key fob remote to control the power supply to the tablet, backed up with remote trigger to power down in sleep mode. So basically you push the lock button, tablet powers down immediately but forget to lock it and it still powers down on the longer timeline. Hit unlock and everything gets power again, buys you a few extra seconds at least vs when the car starts.
Appreciate 0
      04-30-2015, 11:23 AM   #14
Wongway
Lieutenant
6
Rep
573
Posts

Drives: 328i xdrive
Join Date: Sep 2013
Location: Pittsburgh, PA

iTrader: (0)

Why not find a Quickcharge 2.0 spec'd USB cable and charger?

I would think those two would already have the required charging capabilities you'd need built right in.
Appreciate 0
      04-30-2015, 02:15 PM   #15
alexwhittemore
Lieutenant Colonel
39
Rep
1,807
Posts

Drives: 2009 Crimson 328i
Join Date: Oct 2012
Location: Los Angeles

iTrader: (0)

Quote:
Originally Posted by ajaye View Post
As for the Timing issues, I was thinking about a setup that relays the action of locking and unlocking the doors with the key fob remote to control the power supply to the tablet, backed up with remote trigger to power down in sleep mode. So basically you push the lock button, tablet powers down immediately but forget to lock it and it still powers down on the longer timeline. Hit unlock and everything gets power again, buys you a few extra seconds at least vs when the car starts.
Not a bad plan, but where do you find the signals corresponding to lock and unlock? You could use a device watching the K-CAN bus, but besides how involved that is, you'd also have to reverse engineer what messages you're looking for.

What I came up with instead is terminal R - it's a "virtual" terminal, and the status of it (on or off) is communicated via CAN messages, but the FRM uses it to control timing for power to the brake position sensor module, so you can tap a physical manifestation of it there. It's on when the key is in the slot, off when it's not (I don't know how this works on cars with comfort access, but one can probably assume it's something like "if the key is inside the vehicle such that it can be started/not").

Quote:
Originally Posted by Wongway View Post
Why not find a Quickcharge 2.0 spec'd USB cable and charger?

I would think those two would already have the required charging capabilities you'd need built right in.
Sure. If you want to leave the tablet on all the time and come out to a dead device after a day of non-use. Power design for one of these car installs is surprisingly hard to do well, in a way where the tablet truly feels like it belongs in the car. User experience is critical, or i'd just use my phone.
__________________
Appreciate 0
      04-30-2015, 02:25 PM   #16
Wongway
Lieutenant
6
Rep
573
Posts

Drives: 328i xdrive
Join Date: Sep 2013
Location: Pittsburgh, PA

iTrader: (0)

Quote:
Originally Posted by alexwhittemore View Post

Sure. If you want to leave the tablet on all the time and come out to a dead device after a day of non-use. Power design for one of these car installs is surprisingly hard to do well, in a way where the tablet truly feels like it belongs in the car. User experience is critical, or i'd just use my phone.
I'm not sure I follow?

I'm assuming you're just wiring whatever charger you're using in to a circuit that shuts off with the car. So wire it into a Quickcharge 2.0 spec'd charger that shuts off with the car isn't that much of a stretch?

The only downside I can see is that I don't believe a Nexus 7 can take advantage of the capabilities of a true Quickcharge 2.0 spec (like self regulating the amount it pulls), but it should provide enough power to fool the tablet into thinking it's plugged into a wall charger instead of a regular USB. Most USB cables are capped at (I forget the exact numbers/terminology) .5A current?, I think Quickcharge capable USB cables bump that up to .9A current?
Appreciate 0
      04-30-2015, 03:33 PM   #17
alexwhittemore
Lieutenant Colonel
39
Rep
1,807
Posts

Drives: 2009 Crimson 328i
Join Date: Oct 2012
Location: Los Angeles

iTrader: (0)

Quote:
Originally Posted by Wongway View Post
I'm not sure I follow?

I'm assuming you're just wiring whatever charger you're using in to a circuit that shuts off with the car. So wire it into a Quickcharge 2.0 spec'd charger that shuts off with the car isn't that much of a stretch?
It's the "that shuts off with the car" part that's particularly hard. When you say it, it sounds trivial. When you try to get it right, it's anything but.

Quote:
The only downside I can see is that I don't believe a Nexus 7 can take advantage of the capabilities of a true Quickcharge 2.0 spec (like self regulating the amount it pulls), but it should provide enough power to fool the tablet into thinking it's plugged into a wall charger instead of a regular USB. Most USB cables are capped at (I forget the exact numbers/terminology) .5A current?, I think Quickcharge capable USB cables bump that up to .9A current?
None of that is in any useful sense totally correct. I don't want to sound like a dick, it's just not even really worth correcting any of it because the details are too nuanced - USB charging is an incredibly complicated topic, even if you're an electrical engineer, not because the electronics are fundamentally difficult but because the device compatibility matrix across techniques, standards, devices, and cables-you-happen-to-be-using-that-day is enormous and highly non-uniform. The N7 2012 and 2013 don't support quickcharge 2.0 in any manifestation, and quickcharge 2.0 as a standard encompasses a wide range of possible parameters such that real-world performance is still highly variable.

What I found in my own setup was that it was critical not only to use a high enough spec 5V power supply, but to use a cable with sufficiently large-gauge power wires (not all cables are created equal), and a sufficiently short run of it (the voltage drop across 6' caused the tablet to throttle WAY back on charge rate, where 3' was much less a problem).
__________________
Appreciate 0
      04-30-2015, 08:05 PM   #18
Wongway
Lieutenant
6
Rep
573
Posts

Drives: 328i xdrive
Join Date: Sep 2013
Location: Pittsburgh, PA

iTrader: (0)

Quote:
Originally Posted by alexwhittemore View Post
It's the "that shuts off with the car" part that's particularly hard. When you say it, it sounds trivial. When you try to get it right, it's anything but.
Why not simply tap into the available fuses? The fuse panel would be a slightly shorter run I would think? There's plenty of us here who've found that most of the fuses excepting a select few actually power down and sleep when the vehicles sleep (plenty of random folk wondering why their head units won't save settings overnight)


Quote:
Originally Posted by alexwhittemore View Post
None of that is in any useful sense totally correct. I don't want to sound like a dick, it's just not even really worth correcting any of it because the details are too nuanced - USB charging is an incredibly complicated topic, even if you're an electrical engineer, not because the electronics are fundamentally difficult but because the device compatibility matrix across techniques, standards, devices, and cables-you-happen-to-be-using-that-day is enormous and highly non-uniform. The N7 2012 and 2013 don't support quickcharge 2.0 in any manifestation, and quickcharge 2.0 as a standard encompasses a wide range of possible parameters such that real-world performance is still highly variable.

What I found in my own setup was that it was critical not only to use a high enough spec 5V power supply, but to use a cable with sufficiently large-gauge power wires (not all cables are created equal), and a sufficiently short run of it (the voltage drop across 6' caused the tablet to throttle WAY back on charge rate, where 3' was much less a problem).
I won't take you sounding like a dick I'm actually quite fascinated by
all this, so naturally, I'm trying to learn from it.

The other thought I had was, yes, I realize that the USB standards aren't quite uniform, what I was trying to get at was that since the Quickcharge2.0 standard has higher requirements for it's "standard" I would expect that you'd get better/more consistent results in the power delivery with a charger that supported that standard(?)

If I'm not mistaken, aren't typical USB cables usually wired for data and power? What if you were to solder and close the connection for the data, would that trick the charger and device into thinking it's plugged direct into power?
Appreciate 0
      05-01-2015, 03:08 PM   #19
alexwhittemore
Lieutenant Colonel
39
Rep
1,807
Posts

Drives: 2009 Crimson 328i
Join Date: Oct 2012
Location: Los Angeles

iTrader: (0)

Quote:
Originally Posted by Wongway View Post
Why not simply tap into the available fuses? The fuse panel would be a slightly shorter run I would think? There's plenty of us here who've found that most of the fuses excepting a select few actually power down and sleep when the vehicles sleep (plenty of random folk wondering why their head units won't save settings overnight)
The fuse panel is, of course, much closer than the armrest, but I found that to stretch a 3' run of USB cable from the tablet to the fuse box required removing all the dash trim and radio, removing the glove box, and really digging to route it the most directly possible. Otherwise you have to bump up to a 5' or 6' cable, both of which are bad. The ideal way to do it is to use a custom short cable to route to a 12V to 5V converter RIGHT behind the tablet under the dash trim. Shortness of run really is critical, as you don't have much voltage drop overhead. A slightly over-spec USB adapter does help (one that puts out 5.2 or 5.3 V instead of 5, so you have more overhead to drop voltage across the cable at high current).

All of the fuses are high-side (one side is a power terminal, one side is the positive supply going to the circuit in quesiton). That's convenient because you can tap power from any present terminal, and you can inject power from elsewhere for any circuit you like using a fuse tap. I've actually done this to alter timing for the cigarette lighter sockets, I have them powered from Terminal 30g now instead of Terminal 15.

So here are the terminals available and their timing: (I believe this is all totally correct, but I did only skim to refresh my memory. Details here http://www.shrani.si/f/3d/3J/BP0gtSu...pply--bus-.pdf)
Terminal 30: effectively, the raw battery voltage with no switching. This is always on.
Terminal 30G: switched. Turns on when door status changes (open/close, lock/unlock, etc), terminal 15 or R changes (ignition activated, key in), etc. Effectively, any time you poke the car, this turns on. It turns off after 30m of dormancy, or 60m in some conditions.
Terminal 30G_f: termainal 30, switched with a latching relay on fault condition. This is basically terminal 30, but it can switch off and remain that way if an overcurrent condition is detected that would critically drain the battery. I believe, for example, the comfort access module is on this terminal. If the car sits too long, CA turns off to prevent draining the battery to the point of can't-start-anymore, and you have to manually unlock the car.
Terminal 15: this terminal is on with ignition. If the engine is on (or at least, if you've pressed start without the brake pedal to turn the car on without engine turnover), this terminal is on.

You can see why I'd want the cigarette lighters on 30G instead of 15 - my way, your radar detector, accessories, etc etc turn on as soon as you unlock the car, and phones can continue to charge for 30m after you leave the car like while you're in a store or waiting at the airport. But you can also see why none of those is totally ideal for a tablet - you could use T15, but then you couldn't use your nav or audio without turning on the ignition. That's not great. You could use Termainal 30G, but then the tablet would remain powered and screen lit up for 30m after you lock the car in the parking lot. Also definitely not great.

BONUS: I didn't mention Terminal R, which is included in the document above. It's actually just about ideal for our tablet purpose - it turns on when your key is in the slot, and turns off when you pull it out. If you've got a key, you've got nav, which I think is basically the same power timing a factory iDrive system has. The only problem is it's a "virtual" power terminal. Any modules activated by it are TRULY powered from 30G, and listen to CAN bus messages communicating the state of R.

So what I did was dig through all the car's technical documentation looking for any physical signal I could tap off that was activated by Terminal R. It turns out there are a couple: the power seat module has a physical signal activated by Terminal R. I don't have power seats. The MRS module receives a physical copy of Terminal R from CAS. I wasn't about to go fucking with signals into or out of a safety module, since I couldn't possibly know if I'd broken functionality in any way until getting in an accident and finding out the hard way airbags or seatbelt pre-tensioners didn't work right. That leaves the clutch pedal position sensor (I don't have a manual) and the brake pedal position sensor (bingo). So I tapped off the power supply line for the brake pedal position sensor, which is perfect.

Of course, that's a very low current power supply, and I have no idea how strongly I can safely load it, so I had to make some custom hardware to instead use that signal to switch a relay that switches terminal 30G to my loads (in my case, tablet and soon to be Valentine 1, when I get around to the rewire).

So that's really the full story, which I should write up in a blog post some time. Now that I have, I guess copy-paste into a blog post sometime :P.

Quote:
I won't take you sounding like a dick I'm actually quite fascinated by
all this, so naturally, I'm trying to learn from it.

The other thought I had was, yes, I realize that the USB standards aren't quite uniform, what I was trying to get at was that since the Quickcharge2.0 standard has higher requirements for it's "standard" I would expect that you'd get better/more consistent results in the power delivery with a charger that supported that standard(?)

If I'm not mistaken, aren't typical USB cables usually wired for data and power? What if you were to solder and close the connection for the data, would that trick the charger and device into thinking it's plugged direct into power?
A quickcharge 2.0 enabled charger is objectively better in all ways than an older charger that isn't, that's true. But it doesn't mean you're likely to notice it unless every piece of the puzzle is correct.

If I hook a USB cable into the tablet with D+ and D- pins floating, it will not draw >100mA, because that's USB spec. It needs to either negotiate for more power, or be confident by some other means that it's plugged into a dumb charger.

One of those other means, but definitely not the only, is to short D+ and D- together, since you'd never see that in a USB-certified host. Most devices will then draw 500 mA. But it's not relevant in our case, because A) 500mA isn't enough by any stretch, and B) at least in my case, I want to use D+ and D-, the tablet should be a USB on-the-go host. Oh and having the tablet, in host mode, sink power instead of sourcing it is another bag of worms, thank you Timur's kernel .

So timur's kernel actually solves most of the how-much-power-can-i-draw problems. Since it's an OTG host, there's no way to signal in hardware using D+ and D- how much current it's allowed to use. Instead, there's a manual 'fast charge' setting in Timur's that says 'yes, I know what I'm doing, and you can pull up to 1.8 amps when plugged in.

So now you're only up against physical limitations. The tablet will only draw as much current as causes the supply voltage to sag to something like 4.7V. If your charger is supplying 5V on the nose, that means you can drop .3 Volts at 1.8 amps. V=IR, so .3=1.8R. Rearranging, .3/1.8 means your USB cable has to be .17 ohms MAX end-to-end, or else the tablet will throttle to less than 1.8 amps. On a shitty 6 foot cable, I've measured 6 ohms, which means the tablet won't charge for shit. In fact, with such high a resistance, it'll get upset and just not charge at all. But it'll indicate it's charging, which is basically the worst.

All of that is experimentally measured by me, so it's mostly ballpark from my own memory. But suffice it to say, the struggle is real. The ways to get around the problems are 1) short runs of USB cable when it's carrying power from charger to device, 2) overcompensating USB power adapters (but there's a limit to how high you can go), 3) sufficiently beefy adapters, since you'll be supplying up to 1.8A to the tablet in ADDITION to any downstream USB accessories like flash drives and whatnot.
__________________
Appreciate 0
      05-01-2015, 07:16 PM   #20
Wongway
Lieutenant
6
Rep
573
Posts

Drives: 328i xdrive
Join Date: Sep 2013
Location: Pittsburgh, PA

iTrader: (0)

Fascinating! Really appreciate that reply, as now I have a much better picture of the pain and thought process... Thank You!

So many things became an "ah-HA!" moment after digesting that!
Appreciate 0
      05-04-2015, 11:37 AM   #21
jdamore
First Lieutenant
jdamore's Avatar
28
Rep
350
Posts

Drives: 2008 e92 M3
Join Date: May 2013
Location: New Jersey

iTrader: (4)

Quote:
Originally Posted by alexwhittemore View Post
The fuse panel is, of course, much closer than the armrest, but I found that to stretch a 3' run of USB cable from the tablet to the fuse box required removing all the dash trim and radio, removing the glove box, and really digging to route it the most directly possible. Otherwise you have to bump up to a 5' or 6' cable, both of which are bad. The ideal way to do it is to use a custom short cable to route to a 12V to 5V converter RIGHT behind the tablet under the dash trim. Shortness of run really is critical, as you don't have much voltage drop overhead. A slightly over-spec USB adapter does help (one that puts out 5.2 or 5.3 V instead of 5, so you have more overhead to drop voltage across the cable at high current).

All of the fuses are high-side (one side is a power terminal, one side is the positive supply going to the circuit in quesiton). That's convenient because you can tap power from any present terminal, and you can inject power from elsewhere for any circuit you like using a fuse tap. I've actually done this to alter timing for the cigarette lighter sockets, I have them powered from Terminal 30g now instead of Terminal 15.

So here are the terminals available and their timing: (I believe this is all totally correct, but I did only skim to refresh my memory. Details here http://www.shrani.si/f/3d/3J/BP0gtSu...pply--bus-.pdf)
Terminal 30: effectively, the raw battery voltage with no switching. This is always on.
Terminal 30G: switched. Turns on when door status changes (open/close, lock/unlock, etc), terminal 15 or R changes (ignition activated, key in), etc. Effectively, any time you poke the car, this turns on. It turns off after 30m of dormancy, or 60m in some conditions.
Terminal 30G_f: termainal 30, switched with a latching relay on fault condition. This is basically terminal 30, but it can switch off and remain that way if an overcurrent condition is detected that would critically drain the battery. I believe, for example, the comfort access module is on this terminal. If the car sits too long, CA turns off to prevent draining the battery to the point of can't-start-anymore, and you have to manually unlock the car.
Terminal 15: this terminal is on with ignition. If the engine is on (or at least, if you've pressed start without the brake pedal to turn the car on without engine turnover), this terminal is on.

You can see why I'd want the cigarette lighters on 30G instead of 15 - my way, your radar detector, accessories, etc etc turn on as soon as you unlock the car, and phones can continue to charge for 30m after you leave the car like while you're in a store or waiting at the airport. But you can also see why none of those is totally ideal for a tablet - you could use T15, but then you couldn't use your nav or audio without turning on the ignition. That's not great. You could use Termainal 30G, but then the tablet would remain powered and screen lit up for 30m after you lock the car in the parking lot. Also definitely not great.

BONUS: I didn't mention Terminal R, which is included in the document above. It's actually just about ideal for our tablet purpose - it turns on when your key is in the slot, and turns off when you pull it out. If you've got a key, you've got nav, which I think is basically the same power timing a factory iDrive system has. The only problem is it's a "virtual" power terminal. Any modules activated by it are TRULY powered from 30G, and listen to CAN bus messages communicating the state of R.

So what I did was dig through all the car's technical documentation looking for any physical signal I could tap off that was activated by Terminal R. It turns out there are a couple: the power seat module has a physical signal activated by Terminal R. I don't have power seats. The MRS module receives a physical copy of Terminal R from CAS. I wasn't about to go fucking with signals into or out of a safety module, since I couldn't possibly know if I'd broken functionality in any way until getting in an accident and finding out the hard way airbags or seatbelt pre-tensioners didn't work right. That leaves the clutch pedal position sensor (I don't have a manual) and the brake pedal position sensor (bingo). So I tapped off the power supply line for the brake pedal position sensor, which is perfect.

Of course, that's a very low current power supply, and I have no idea how strongly I can safely load it, so I had to make some custom hardware to instead use that signal to switch a relay that switches terminal 30G to my loads (in my case, tablet and soon to be Valentine 1, when I get around to the rewire).

So that's really the full story, which I should write up in a blog post some time. Now that I have, I guess copy-paste into a blog post sometime :P.



A quickcharge 2.0 enabled charger is objectively better in all ways than an older charger that isn't, that's true. But it doesn't mean you're likely to notice it unless every piece of the puzzle is correct.

If I hook a USB cable into the tablet with D+ and D- pins floating, it will not draw >100mA, because that's USB spec. It needs to either negotiate for more power, or be confident by some other means that it's plugged into a dumb charger.

One of those other means, but definitely not the only, is to short D+ and D- together, since you'd never see that in a USB-certified host. Most devices will then draw 500 mA. But it's not relevant in our case, because A) 500mA isn't enough by any stretch, and B) at least in my case, I want to use D+ and D-, the tablet should be a USB on-the-go host. Oh and having the tablet, in host mode, sink power instead of sourcing it is another bag of worms, thank you Timur's kernel .

So timur's kernel actually solves most of the how-much-power-can-i-draw problems. Since it's an OTG host, there's no way to signal in hardware using D+ and D- how much current it's allowed to use. Instead, there's a manual 'fast charge' setting in Timur's that says 'yes, I know what I'm doing, and you can pull up to 1.8 amps when plugged in.

So now you're only up against physical limitations. The tablet will only draw as much current as causes the supply voltage to sag to something like 4.7V. If your charger is supplying 5V on the nose, that means you can drop .3 Volts at 1.8 amps. V=IR, so .3=1.8R. Rearranging, .3/1.8 means your USB cable has to be .17 ohms MAX end-to-end, or else the tablet will throttle to less than 1.8 amps. On a shitty 6 foot cable, I've measured 6 ohms, which means the tablet won't charge for shit. In fact, with such high a resistance, it'll get upset and just not charge at all. But it'll indicate it's charging, which is basically the worst.

All of that is experimentally measured by me, so it's mostly ballpark from my own memory. But suffice it to say, the struggle is real. The ways to get around the problems are 1) short runs of USB cable when it's carrying power from charger to device, 2) overcompensating USB power adapters (but there's a limit to how high you can go), 3) sufficiently beefy adapters, since you'll be supplying up to 1.8A to the tablet in ADDITION to any downstream USB accessories like flash drives and whatnot.
Alex- sorry in advance that I fast tracked your post but I would like to help. I believe you said you were using 2.1 amps to power/charge the tablet? That is not enough! Length/quality of the usb cable will only make a small difference unless the gauge of the wires are just to small. You need a stronger 12vto5v transformer and I wouldn't use anything less than 3A.

To address your power/triggers:
Are you using Tasker? The 30 minutes of power the 30g relay is great to work with but your problem is that you need a trigger for when the car is on/off, correct? The 30g relay is great because, coupled with Tasker, can put the tablet into airplane mode and shut off screen with power loss (opposite when power is detected). Your install is different than mine because I use a BT audio receiver. My BT audio receiver is connected to ignition power and only comes on when the key is in the on position. I use the BT audio receiver connection status, in Tasker, as a trigger for the ignition. Essentially, this trigger can be used to dim the screen. maybe just buy and hide a BT device in the car for a trigger. cumbersome but it will work.

For internet:
What phone do you have? Does it have hotspot? For me, again, I am using Tasker to enable hotspot on my phone. I have tasker programed that, when it detects bluetooth from my car, enable the hotspot. My androidPC automatically connects to the hotspot.

Subscribed! Need more people geeking out with this stuff!
I've been struggling for a system on my iDrive screen for a long time now and it finally came together. http://www.m3post.com/forums/showthread.php?t=1030774
__________________
-- 08 JB e92 6MT M3 // ESS VT2-625 // AA catless mid // Forgestar CF5V // JBSPEED splitters // Forcewerkz skirts // MMI w/AndroidPC // lci tails --
Appreciate 0
      05-04-2015, 02:06 PM   #22
alexwhittemore
Lieutenant Colonel
39
Rep
1,807
Posts

Drives: 2009 Crimson 328i
Join Date: Oct 2012
Location: Los Angeles

iTrader: (0)

Quote:
Originally Posted by jdamore View Post
Alex- sorry in advance that I fast tracked your post but I would like to help. I believe you said you were using 2.1 amps to power/charge the tablet? That is not enough! Length/quality of the usb cable will only make a small difference unless the gauge of the wires are just to small. You need a stronger 12vto5v transformer and I wouldn't use anything less than 3A.
The 2013 N7 will only draw 1.8 amps max, period. If I plugged it into a source capable of 50 amps, it would still only draw 1.8. And I promise you, after MUCH detailed measurement, cable impedance is the single biggest factor.

Quote:
To address your power/triggers:
Are you using Tasker? The 30 minutes of power the 30g relay is great to work with but your problem is that you need a trigger for when the car is on/off, correct? The 30g relay is great because, coupled with Tasker, can put the tablet into airplane mode and shut off screen with power loss (opposite when power is detected). Your install is different than mine because I use a BT audio receiver. My BT audio receiver is connected to ignition power and only comes on when the key is in the on position. I use the BT audio receiver connection status, in Tasker, as a trigger for the ignition. Essentially, this trigger can be used to dim the screen. maybe just buy and hide a BT device in the car for a trigger. cumbersome but it will work.
Tasker would be an interesting solution, but there are two problems as-is - the one bluetooth device that appears and disappears is my WMA Tune2Air 1000, which is plugged into the 6FL usb port in the armrest. That's powered by the MULF, and I believe stays on with 30G, so the tablet will only lose that bluetooth device at the same time it'd lose power anyway. Then you have the problem of reconnecting with a tablet in airplane mode - you'd have to leave bluetooth on, draining power, or else you wouldn't have a power on trigger.

As it is now, I'm using Timur's kernel (https://timur.mobi/timurs-kernel-n7-2013/), which has a deep sleep mode that consumes far less power even still than just screen off and airplane mode. Firm sleep is triggered by external power loss, so using the derived Terminal R works perfectly.

Quote:
For internet:
What phone do you have? Does it have hotspot? For me, again, I am using Tasker to enable hotspot on my phone. I have tasker programed that, when it detects bluetooth from my car, enable the hotspot. My androidPC automatically connects to the hotspot.
For connectivity, I ended up getting rid of my old wifi-only 2012 N7 and upgraded to the 2013 with LTE. I've found that waiting for tethering to connect takes too long and is too big a hassle, especially since I have an iPhone and would have to leave hotspot enabled all the time.

Quote:
Subscribed! Need more people geeking out with this stuff!
I've been struggling for a system on my iDrive screen for a long time now and it finally came together. http://www.m3post.com/forums/showthread.php?t=1030774
I love the android PC+MMI solution! Really clean
__________________
Appreciate 0
Reply

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT -4. The time now is 05:52 AM.




e90post
e90post
Powered by vBulletin® Version 3.7.0
Copyright ©2000 - 2015, Jelsoft Enterprises Ltd.
1Addicts.com, BIMMERPOST.com, E90Post.com, F30Post.com, M3Post.com, ZPost.com, 5Post.com, 6Post.com, 7Post.com, XBimmers.com logo and trademark are properties of BIMMERPOST