Monday, May 16, 2016

PoE Terrestrial TV

Living in a valley doesn't lend itself to very good terrestrial TV or radio reception, and running several hundred feet of RG7 coaxial cable to an unamplified antenna just doesn't do the trick either. To solve this, and get a few other snazzy features in the process I employed a cheap USB ATSC tuner dongle, a Raspberry pi, some passive PoE injectors, and about 350 feet of UV resistant CAT5 cable.
Raspberry Pi with tuner and buck regulator in project box

The ATSC dongle, raspberry pi, and PoE breakout (along with a 5V switch-mode buck regulator) were shoved in a small waterproof project box with a grommet around the hole for the coax and ethernet cables. This was then attached to a tree with a spring to keep it off the ground. The antenna is a magnetic loop antenna for VHF/UHF signals (although it should be an OK receive antenna for almost any RF band where the wavelength is much larger than the antenna diameter). This antenna is omnidirectional when mounted horizontally as it is in the picture. A simple PVC pipe mount and some bailing wire was used to attach it to the tree.
Antenna and Pi with tuner attached to a tree
I discovered that 12V into the end of the CAT5 was not quite enough to end up with 5V at ~2A after the buck regulator at the end of the cable and resulted in the Raspberry Pi boot-looping. Increasing the input to 24V with a boost converter did the trick however and the Pi booted happily. It seems to be drawing about a third of an amp at 24V at the end so the loss is about 30% which isn't too bad given the length of the cable. Below is the 12V fuse panel this is all connected to in a shed which had a few solar panels and a battery for other purposes already. In the long run a grounding rod and some lightning arrestors are in order to prevent damage to electronics inside the house, as well as for safety.
12V fuse panel connected to solar panels and a battery,
boosted to 24V and then put into passive PoE.
After the Pi booted up I discovered that while I was able to talk to it over the Ethernet cable, I was getting about 60% packet loss which wasn't going to cut it for video streams. To solve this I moved the switch that was originally on the end of the CAT5 run halfway up the hill into another waterproof project box with it's own pair of passive PoE breakouts. This solved the packet loss problem completely and I'm now able to saturate the 100mbit/s link with no packet loss. Thus the real world limit for 100mbit Ethernet is about 200 feet, which is shy of the 100 meters claimed in the specification. Longer distances could be achieved with shielded cable and 802.3af PoE instead of passive PoE which claims two of the four twisted pairs for power only.
Ethernet switch with passive PoE hookups
and buck regulator (switch is 5V)
On the software side of things I chose a wonderful application called TVHeadend to allow for an easy IP based interface to the tuner card complete with a named channel list, electronic program guide (EPG), and DVR capabilities. On the Viewer's side I'm using Kodi along with the TVHeadend plugin which makes for a very pretty and responsive 10-foot interface to all of TVHeadend's capabilities. Aside from the occasional glitch in video due to low signal strength, 1080p video streams are viewable flawlessly and reach up to ~12mbit/s. All of the video and audio streams are sent over the air encoded in MPEG-2 and passed without transcoding to the viewer.

TVHeadend does support transcoding to newer, more efficient codecs, however the raspberry pi it's running on isn't capable enough to do this on the fly (hardware encoding/decoding isn't currently implemented in tvheadend), so MPEG-2 it is. A Pi can also be used as a viewer running Kodi, but you'll need to purchase the MPEG-2 decoder license from the Raspberry Pi Foundation to enable smooth playback.

ItemQuantityUnit Price (USD)Total PriceNotesLink
Raspberry Pi1$35.00$35.00I used model B rev1
100mbit ethernet switch1$9.95$9.95passive PoE only supports 100mbit/s
1000ft UV rated CAT51$67.99$67.99Only used ~350ft
CAT5 termination tools1$13.97$13.97If you don't already have these
Passive PoE injector set2$6.99$13.98Includes injector/receiver pair
5V 3A buck regulator2$7.68$15.36Up to ~26V input rated

In the end this project allowed my parents to watch live local TV in HD with full DVR capabilities without the need for a subscription service even though they live in a valley. The total cost shown above doesn't include the enclosures, 24V power supply, TV tuner dongle (your needs will vary by country, they're all about $20-30 USD) and some other odds and ends such as heat shrink, mounting hardware, etc. Overall not a bad price considering a cable subscription can run more than that per month. Supplement this with other online media sources and you've got a zero or low subscription cost entertainment solution.

Thursday, November 14, 2013

Goodbye Battery Powered Sunglasses

It's been a while since my last post mainly due to my lack of time to work on personal projects due to school. I did manage do something noteworthy this weekend though, and now I have a passive 3D projector to show for it. I had the idea a while ago and realized that I had everything I needed to complete it already lying around from a high school 3D projector project. The projector I have now has 120hz DLP link 3D support. Out of the box it works with some $20 3D shutter glasses on I found on Amazon. If you don't know what shutter glasses are or how they work, I think it's easiest just to show you:

As you can see, the projector is actually switching between two images very quickly, the one for your left eye and the one for your right. The shutter glasses "close" and "open" in sync with the projector electronically so each eye only sees the image it's supposed to. This all happens so fast (120 times per second) that you can't see the switching with the naked eye. This is how most consumer 3D TV's and projectors work. These glasses in particular have a relatively small viewing window and they're somewhat bulky because of the contained battery, IR receiver and accompanying circuitry, which is why passive 3D is preferable. That's the kind in movie theaters where you use the disposable plastic glasses and the switching is done on the projector.

As it turns out, there are devices available to convert an active 3D projector into a passive one, but they all had features and price tags geared towards movie theaters that I wasn't interested in. The cheapest I could find started at $1500. But what exactly is this magical filter doing? It actually works just like the screen on your phone or computer and the $20 glasses work in the same way. The lenses are actually two big LCD "pixels". The liquid crystals just polarize the incoming light vertically or horizontally depending on the electric field applied. The glasses are blacked out when the liquid crystals in them polarize the light in one direction, and clear when the polarization is rotated 90 degrees. This means there is a polarizing filter on the front of the lens that polarizes the light initially so that the LCD "pixel" can block out the light, as our eyes can't perceive polarization on their own (OK, well almost can't

My idea was simply to peel off the first polarizing filter and put the glasses in front of the projector lens. This would leave the LCD portion to switch the polarization of the projector in sync with the frames it was showing. Disassembling the glasses showed that there was in fact a plastic layer on top of the glass lenses and with some time, a knife, and some methanol I was able to remove it. The biggest challenge was the adhesive left behind after peeling the filter off, which is where the methanol came in. I used Rain-X which has methanol in it to dissolve the adhesive because it's what I had, but rubbing alcohol may work as well.

After reassembly you can clearly see the one lens is a bit lighter with the polarization filter removed. It's worth noting at this point that there are a few caveats to passive polarized 3D. Because it relies on switching the polarization of the image the light coming out of the projector can't be polarized already or it would be blocked out. Most three LCD projectors have one color polarized oppositely from the rest which wouldn't bode well for this method of 3D. The DLP chip in my projector requires no polarization so it will work great. In order for the polarization to make it from the lens, to the screen, and then back to your glasses requires a special type of screen. Normal white fabric or paint destroys polarization by absorbing light and re-emitting it with random polarization. A reflective material is required, like sanded aluminum, to maintain the polarization yet still diffuse the light for viewing.
I tested the system with an old window shade painted with silver paint that I had from the high school project mentioned earlier. The screen is very wrinkled and uneven so it won't work too well for movies, but it did allow me to test my hacked together filter and it worked far better than I expected. There was almost zero cross-talk, or bleeding between the left and right images, when using leftover movie theater passive glasses (linear IMAX ones, as opposed to the circularly polarized RealD ones) that I had laying around. Soon I hope to build a collapsible frame with silver fabric stretched across it to make this a usable system for 3D movies and games. I'll post more about the whole setup when that happens. Back to school work for now.

Thursday, June 13, 2013

Falling Batteries

Recently, while volunteering for a race event with the Cal Poly Amateur Radio Club, I found myself (with the help of a friend luckily) carrying a 26 amp-hour sealed lead acid battery and mobile radio one mile down a trail. This was much less than ideal and while walking up a somewhat annoyingly tall hill, I came up with the notion that the lead acid battery I was carrying weighed so much (about 20lbs) that it would actually have more gravitational potential energy than chemical energy by the time I reached the top of the hill. In other words, does lead make for such crappy batteries that it's more effective to carry a rock up a hill and use the energy from it falling than from the energy stored in the battery?

This got me thinking, and after a few calculations, it turns out that this definitely isn't true. By a long shot. Even the relatively inefficient SLA would need to be lifted to over 12 kilometers (yes I'm using SI units) before it's gravitational potential energy exceeded the electrical energy it could produce. I tried the same calculation with a number of other batteries to compare them, and with no surprise lithium batteries prove to be about twice as energy dense as SLA's. On top of this, they have a better charge/discharge efficiency. I was, however, a bit surprised to find that high-end lithium 18650 cells as used in laptops and Tesla cars are more than twice as energy dense as the LiFeYPO4 cells in my car.

All in all, this may have been a somewhat useless exercise, but you have to appreciate the humor in measuring the energy density of batteries in kilometers from the ground.

Saturday, June 1, 2013

...And we're back

After a few emails back and forth with EVolve electrics my charger parameters were finally programmed into a shiny new Elcon PFC4000 charger to replace the old, somewhat blown up Zivan NG5. I expected the new charger to be about a wash with the old one in terms of power output and efficiency, but wow the new one has exceeded my expectations. There's no longer any awful 120hz noise on the power grid while charging, and the Elcon charger seems to have a much better power factor, because there's less AC current and I can no longer hear a 60hz hum near my breaker panel while charging. The whole charger barely gets warm to the touch even in mid-charge, whereas the old one was spewing hot air like a hair dryer. On top of that, it's putting out more power and charging the car quicker!

Here's the charger after having just unpacked it. It arrived in about 9 days even after some back and forth emailing to get the parameters straight. I must say I'm very happy with the new charger and it was well worth the upgrade.

Here you can see the charger in the car next to a mess of wiring
that I unzip-tied during installation. 

On top of the efficiency, it's even capable of charging from a 110V outlet, which the old one wasn't, and it can be adjusted to different finishing voltages using a button on the side. It has a sealed DIN connector with two wires that enable or disable the charger, perfect for connecting to my BMS so that I no longer need a 30A relay to switch off the AC to the charger. The only thing I would change is that the fans stay on all the time while the charger is plugged in, even when it is disabled using the DIN connector. The way it is now the fans will still be needlessly going at full speed, even after the car has been charged for hours. This isn't a huge issue though, so I'm not that concerned about it.
The next two weeks I will undoubtedly be busy with school work and finals, but this summer one of my (many) projects will be to make the 12V system in the car a bit more resilient, as it seems the small DC/DC converter and SLA I have aren't able to keep up in the event I have the headlights, stereo, and brake vacuum pump on all at once... which causes the BMS to shut off and the car to disable, so right now it's at the top of my list.

Sunday, May 12, 2013

Maker Faire and Explosive Semiconductors

The San Luis Obispo Mini Maker Faire went great. The car got a lot of attention from passerby, and there has been a significant upturn of opinions on the car since its conversion to lithium batteries and the improvement in range. On top of that, I only had two semi-crazy people come up to me claiming that all the batteries in my car weren't necessary and that they had developed a device that could "make amps without power". It seems there's always a few. Here's a picture of the car set up at the Maker Faire, donning posters with information and FAQ's.

The car has been performing wonderfully in the past week that I've been driving it. And it is still performing great despite a recent, shall we say, hiccup. The charger in the car, a Zivan NG5, has performed quite well since I first put it in when the car was initially converted. And despite the need to send it in and pay $75 every time the need to change a charge parameter arises, it was a nice enough high powered charger. The use of the past tense was not unintentional, as the charger felt the need to blow up every semiconductor component within it on Friday. I have since ordered an Elcon pfc4000 to replace it in the hopes of having a better experience than dealing with the Zivan USA support, which quoted me at least $500 and several weeks to repair the charger.  So in the meantime, there are about 40 miles left in the battery pack (which luckily got a nearly full charge before the charger went kaput) which should last me until the end of the week when the elcon charger is slated to arrive.

Tuesday, May 7, 2013

It Lives!

After a bit of frustration with the charger, two broken drill bits, and sore fingers from hand tightening bolts, my car is at last on the road again. Just in time for the SLO Mini Maker Faire as well which should provide a nice opportunity to show what I've done. If you're in the area, stop by!

Here you can see one of the battery packs under the car bolted in (that's what the drilling was for). There's a lot more ground clearance than with the lead batteries; almost 6 inches at the lowest point. This made for a pleasant surprise when I pulled into a parking lot and saw a speed bump. I inched towards it expecting to hear the familiar scrape of the steel case of the lead battery pack, but instead just went right over top with a grin. While this may not seem that exciting, it's been a long time coming, and I'm sure my local stores will appreciate the lack of further chunks missing from their speed bumps. I'll update with more pictures once I get the chance to clean up the car and the wiring under the hood.
The BMS performed quite well on its maiden voyage and showed a 90% charge remaining after the slightly more than 5 miles of driving I did today, which is great news considering how excited I was to see how the car would perform with so much less weight. All the cells seem to be well balanced with the exception of one that seems to be dipping a little bit more under load. This may be due to a loose connection so I'll need to take a look at that. Overall I'm very happy with the system.
Until next time.

Friday, April 26, 2013

Install 2 AA batteries as shown

After finishing up this week at school I started installing the shiny new batteries in my car. The BMS boards went on without too much issue and the bus bars fit nicely with one exception: when the batteries are positioned end to end, the bus bars are a little bit too long. Luckily they are fairly easy to bend and I was able to avoid having to make new ones. Here's the first pack of batteries (35 of the 85 cells) in the back of the car with the BMS boards installed.

I briefly hooked up the 35 batteries in this box to my laptop and all of the BMS boards worked and reported that the batteries are within +/- 1mV of each other. This is great news as the pack won't need to spend very long balancing after the initial charge. I was just able to get started fitting BMS boards to the second pack before sunset, which I should be able to finish tomorrow.

Next step is to fit the second box under the car, connect all the cat5e cables for the BMS, connect the (comically) large power pole connectors between battery packs, and finish the 12V wiring to the BMS controller. Ideally I'll be finished by the end of the weekend, given the wrath of Murphy doesn't come into play to a huge degreee.
That's it until tomorrow, when hopefully I should be able to charge the batteries for the first time.

Tuesday, April 23, 2013

They're here!

The lithium batteries are here at last! Or more precisely the Lithium Yttrium Iron Phosphate batteries are here at last. After 500 miles and ten hours of driving (thanks Sean!) I am now in possession of 85 of the cells shown below, each one has a nominal voltage of 3.2 volts and a capacity of 60 amp hours. All three crates weigh a total of 527 pounds and the batteries themselves make up about 460 of that, with the rest being packaging, copper bus bars, nuts and bolts that are included.


Over the next week or so I'll be inventorying and checking all of the batteries, installing them in their boxes for the car, connecting the BMS to each cell, and wiring everything to the charger and controller in the car. I estimate there is about 10-12 hours worth of work to get the car moving and charging, assuming there's no serious snags. You can be sure I'll be spending every waking moment I can spare working on this though!

one of the three boxes opened

That's all for now. Oh and on a side note, I got a new vanity callsign! It's N6LAN, or Nolan with a 6. Nolan with a zero was taken. and Nolan with a 1 just sounded weird to me. Until next time, which should be soon, N6LAN clear.

Monday, March 25, 2013

Battery Delays, and Sparks.

Seeing as it's been a while since my last post, I thought I would provide an update as to why. In addition to the staggering lack of free time that taking 18 units of major courses produces, my order of lithium batteries has been delayed several weeks by Chinese New Year. The expected arrival date is now approximately three weeks from today, so that should leave me time to finish up the preparations to the car and charger. In the meantime, here is a video of a friend and I discharging a 1 Farad electrolytic capacitor with various metal objects. At 240 FPS. Enjoy.
This was filmed with a GoPro Hero 3 Black Edition at 480p in high frame rate, and then played back at 24 fps. This made for some quite interesting results. I'll definitely be experimenting with various other things in slow motion to see if I can find something really cool. Until next time, this is KK6ADS, clear.

Sunday, January 13, 2013

The BMS is in the building.

I received my Lithiumate Lite BMS kit today from Elithion. It's smaller than I expected, which is a good thing, and it seems very well thought out and built. I put a lot of research into choosing a BMS, and eventually chose a digital one because of the increased flexibility and possibility of integrating with the computer I already have in the car. With 85 cells, the digital BMS was comparable in cost to an analog system of the same size, so it was really a no brainer.
The BMS master unit connected to AC power and my laptop
Here you can see the the main unit that all the BMS daughter boards connect to using cat5 cable. It has a number of handy features for integrating into a vehicle such as 12V outpus for interfacing with the motor controller and charger. It can drive 5V gauges for battery current, voltage, and state of charge with any scale you want. It can even produce a pulsed output for a factory dashboard fuel gauge. Aside from those features the highlight of this system has to be the software.

In addition to collecting data from every single cell once per second and graphing it, the software allows configuration of soft and hard battery limits such as when to turn on warning lights or disable the pack. It also provides graphical gauges for current, voltage, and state of charge. Although the provided application only works on Windows, documentation of the communication protocol is provided which makes me very happy. I plan on using this to allow integration with the touchscreen interface in the car as well as allowing access to the data from my smartphone. More to come once I start taking apart the charger.