RyanFX's Blog

Sunday, April 27, 2014

Nexus 7 Poor Wireless (Wi-Fi) Signal

This is not your typical post, but I struggled enough with this that I assumed others could benefit from it as well.

I have a first gen Nexus 7 (N7) and had extremely bad Wi-Fi signal / reception over the past few months.  Not only was the signal bad, the throughput was miserable (5 mbps).  I purchased a TRENDnet TEW-811DRU which I flashed DD-WRT onto and installed it as an additional access point to help alleviate the problem.  It barely helped.  I played around with wireless channels, frequencies (2.4 vs 5.0), and more.  Nothing would make it better despite the router being 8 feet from the tablet.

Eventually I discovered the problem, which seems to be a bit common in these generations.  As with most tablets, the 7 has been dropped a time or two.  It turns out that the Wi-Fi antenna is actually connected from the main unit to the rear case.  On my 7, the upper left corner of the case was actually snapped open about a 1/16th of an inch.  Pressing the case back in (I had to press fairly hard) instantly fixed all of the wireless signal problems.

So there you have it.  If you are having terrible wireless reception or signal issues, check your case and make sure it's fully snapped in.  It may be an easier fix than you thought!

Friday, November 29, 2013

2013 Prius C Factory Rear View Backup Camera Installation

Background and problem

I recently took a new job and had to buy an additional car as my wife had the only one for the family.  My one request for this vehicle was that it had a backup camera, as I parallel park with the finesse of a drunken bull.

Due to one other requirement (it needed to be super short in length as I have a tandem garage) I wound up with a Prius C.  Of course the Prius did not come with a backup camera, nor was it even offered, at least in the great US of A (In Australia it's an option!).  Due to this, I opted to purchase the "three" trim, which comes with a 6-7 inch color display in which I hoped to mod to facilitate my original requirement.

I did some Googling and found posts on the PriusChat forums regarding some success in getting aftermarket cameras hooked up to the factory head unit.  One user I'd like to particularly thank, Mik1, gave a write up on his installation.  I used this as a guide for most of my install, including the pins on the wiring harness, how to remove the body panels, etc.

What I did change, however, was how the camera was getting power.  Some users on PriusChat were successful in powering their cameras from the powered output on the head unit marked 5.5-6.5v in his write up (I measured this as 6.33V).  It's important to note that this output gets activated whenever the car is in reverse, or when the car is searching for the camera.  Many were unsuccessful in getting this low voltage to work and it seemed to be heavily dependent on what camera was selected as almost all cameras are rated for 12v.  In addition to the hit or miss nature of the cameras, I didn't want to run any sort of substantial power draw from the head unit anyways.  With little documentation from Toyota (at least that I have access to) about how much current can be safely drawn from the head unit, I wanted to find a safer approach.

A common technique of hooking up rear view cameras in vehicles is to tap the reverse light power.  It's an extremely simple solution that works extremely well... almost always.  It outputs 12v, and only does so when the car is actually in reverse, so the camera won't be powered on all the time.  So what's the catch?  This head unit in particular outputs voltage for 60 seconds after the car starts up to "search" for an installed camera.  If it does not detect video signal during that time frame, it will not attempt to display the camera feed when you eventually do shift into reverse.  This means that you can hook into the reverse lights to power your camera, but in order to use it, you would have to shift into reverse every time you start your car within the first 60 seconds... just in case you want to use your camera later that trip.  This would lower the WAF of the project well below acceptable thresholds.  At least in my household.

Some users were having success in tapping into a blue wire in the rear of the car attached to the wiper motor but this is problematic because it is a switched power source, which means that your camera is now powered on for the duration of each and every trip.  A 5-6 hour trip would put the wear and tear of a normal year on the camera, assuming you would be using it for about a minute every day.

Solution



It probably goes without saying, but please do not work on anything you do not feel comfortable doing.  I can't guarantee how this will affect your warranty, so please use this as a reference rather than a how-to or tutorial.  There is no shame in paying a professional ;)

I decided to power the camera from the 12v supply going to the cigarette lighter, or "12v auxiliary power outlet" if your conscience tells you that's a better name.  This circuit has more than enough capacity to power a little camera.  In addition, I purchased a solid state relay that has an opto-isolator built in, which means you can safely connect the 12v supply and 6.33v supply from the head unit to the same device without fear of blowing anything out.  The only other parts you'll need is a resistor, some wiring, connectors, and the camera itself.

Parts:
  • Eagleeyes EC-TH103 - Great lux rating (think night vision), IP67 waterproofing, and resolution, all for under 30 dollars
  • SSR-25DD - Solid state relay meant for DC signal and DC switching (careful, as many are made for AC switching).  The signal current required is extremely low ( less than 15ma) and can handle up to 25 amps.  We'll be using a fraction of an amp.
  • Male connectors - Make sure you have a wire crimper - cheap ones are available everywhere.
  • Female connectors
  • 3M T-taps - These are really nice.  You can tap on a wire and connect / disconnect to it at will by inserting a male connector (the ones listed above work great for this)
  • JR Connector pack - Used to connect the your wiring into the factory Toyota harness.
  • Resistor pack - You really don't need all of these resistors, but it's a great assortment if you do projects, and you almost certainly won't need to order more next time you need a resistor!
  • Molding remover - Makes your life infinitely easier when trying to remove trim / fasteners in the car.
  • Wire

Follow Mik1's guide to taking apart the car and running wiring.  I ran four cables from the head unit to the back of the car, two will transport video, two will be 12v+ and 12v-.

The only thing I did substantially different was at the very end of his guide he recommends using wire to pull off the fasteners on the hatch.  You can use one of the handy dandy molding removers instead.





Relay




  • Solder or crimp a wire together with a 470 ohm resistor and connect it to the 6.33v+ from the head unit, to terminal 3 on the relay.
  • Connect a plain old wire from the 6.33v- on the head unit to terminal 4.  This, with terminal 3, will serve as your relay signal, allowing power through the switched side when the car enters reverse, or when the car searches for the camera's presence.  The resistor limits the amount of current output by the head unit to help ensure that you don't overload it (we'll be drawing 13mA).
  • Connect a T-tap on each of the two wires connecting to the cigarette outlet while you're behind the dash (you can't miss them, just peel back the black tape).  Connect the positive wire to terminal 2, then connect terminal 1 to your camera's 12v+ supply.  Connect your camera's ground to the other T-tap and you're done with the power!




Connect your camera's video signal wires (two of the four wires you ran to the back of the car) to the appropriate pins on the head unit harness marked as video in and video ground in Mik1's write up.  Alternatively you can make use of the video cable provided with the camera and snip off the RCA connector.

At this point you should be able to start your car, put it in reverse, and see a camera image on your display!  Here's mine while the camera was in my front seat.



You'll need to mount the camera in the plastic piece of trim that's attached to the hatch opening button.  It's attached with a few bolts accessible from the inside of the car and is really the easiest part of the install!  Drill a small hole through the hatch itself underneath this trim to run the wiring inside and then smear some silicone caulk in the hole the prevent any water form leaking in.



Mount the relay wherever you'd like and tape everything up so it's nice and secure - you're done!

Monday, July 1, 2013

How to stop a thread in Java

Stopping threads in Java are one of those things in life that are extremely easy in practice yet conceptually unintuitive.  There are also several ways of doing so which adds to the confusion.  This article outlines the three major patterns.

Friday, June 28, 2013

Lists, Sets, And Maps, Oh My!

Choosing the correct data structure can be a challenge, even for experienced developers.  If you're here, you may be wondering:

  • What kind of data structure should I use for my current task?
  • When should I use a List?
  • What about a Set?
  • What is a Map and why should I care?

Wednesday, June 19, 2013

Raspberry Pi Powered, Android Controlled, Tomcat Serviced, Remote Garage Door Opener (Whew!)

A few months ago I had left for a business trip and couldn't remember if I had closed the garage door.  Nearly all of us have done this at one point in our lives.  I promised myself this would never happen again, and a new project was spawned!

Sunday, June 9, 2013

Personal Gadgetry

If you're an engineer, you frequently want to do many things just a little bit differently than others... just because you can.  Your side projects are generally overly complex and accomplish what others perceive as minuscule, but that doesn't stop you!  This blog will contain those types of completed projects.