Alright, so after way too much time spent understanding the power supply, I'm running the pi and the LEDs at the same time. To do this, you need to use as little power as possible, which means:
- Use a Raspberry Pi Zero W. Older Pis use significantly more power and even a Pi Zero (non-W) with a wifi dongle is going to use more power.
- Reduce pi's power use by installing Raspian Stretch Lite. Leave desktop mode disabled and access only via SSH and SCP.
- Follow this guide to disable HDMI port and status LED.
To run TWCManager.pl on each boot, place
TWCManager.pl in
~/TWC then install 'screen':
Code:
sudo apt-get update
sudo apt-get install screen
Then
At the end of rc.local, add:
Code:
su - pi -c "screen -dm -S TWCManager ~/TWC/TWCManager.pl"
Reboot, and if you need to see what TWCManager is doing, make an SSH connection and run
You can find guides online for how to use screen but the most important command is
Ctrl-a then
d to 'detach'. This gets you back to a command prompt but leaves TWCManager running in the background.
If any of the above confuses you, I'll create a more detailed guide at some point.
Git repository has been updated with a simple web interface for changing charging amps and monitoring the amount of amps being sent to each slave TWC. Here's how it looks on my phone:
I recommend placing the index.php file in
/ var / www / html (without spaces) and installing
lighttpd with these commands:
Code:
sudo apt-get update
sudo apt-get install lighttpd
sudo apt-get install php7.0-cgi
sudo lighty-enable-mod fastcgi-php
sudo service lighttpd force-reload
lighttpd is the lowest CPU (which means lowest power) web server available when serving one or two users at a time.
Now, about the pi's power use:
Details are in the
other thread but basically the pi consistently uses
0.911W of power which makes the TWC power supply about 5.7% more current than the TWC would use under normal operation. The TWC uses the most power when the car is charging and the TWC's LED lights are streaming.
The parts of the power supply that get hottest are a series of resistors, a transformer labeled TA1, and a MOSFET labeled QA1 (or HA1 on its other side). Running the pi adds about 15F to the temperature of all three of those components with the case closed, leaving them about 150F (65.5C) when it's 65F (18.3C) outside.
Resistors top left, MOSFET middle, transformer bottom:
The MOSFET spec sheet says that's fine because at 149F (65C) it can drain about 2.3A. It needs to drain around 1.35A when max power is called for. The problem is I have no information on the temperature limits of the TA1 transformer. Also, I don't know what will happen on a 100F day in the summer which may drive internal components up to 184F (84C). I'm not sure if +35F outside temp would actually mean +35F in the hottest internal components but I think it's likely based on what I've seen monitoring the temp of an overheating security camera. Even at that temperature, the MOSFET could still drain 2.0A so it's probably fine and we'll have to hope the transformer and resistors have similar performance.
Most likely there is some form of overheating protection that will shut things down before anything is damaged, but I lack the knowledge to identify what sort of protection there is. Worst case, I think one of the hottest components would burn out and need to be replaced. There is definitely overvolt protection which means it will shut down if something gets so hot it melts insulation and shorts. Unfortunately, if it's the TA1 transformer that burns, the only replacement is likely to come from another TWC because transformers tend to be made custom and have no markings that indicate their properties in any standardized way. Someone smart enough in electronics might be able to source something equivalent or better that works, but that someone's not me.
I've got to create a PDF guide or something with more details to put with the git project, but I wanted to let people know the bare bones of how to get this done.
I created a short extension cable to get 14VDC power from the LED board cable without modifying it:
The yellow wire is the 14VDC line and I made it long so I could fit the clamps of my clampmeter over it to measure power use of the LED board. Most people building this cable will just want to use ribbon cable for all the wires instead of adding this extra longer wire. You'll still need to leave the ends of ribbon cables 1 and 6 longer to solder the thicker wires of the
UBEC buck converter onto like you see at the right of the picture.
Connectors need to be pressed onto the ribbon cables with cable wires carefully aligned into the barbs of the connectors. Connectors must be squeezed with equal pressure at all four corners using something like a vise. If not, you may miss getting the barb around the tiny wires inside. When done, check carefully that each pin at one end connects to the same pin on the other end and that no pin connects to more than one other pin. Make sure to align connectors the same way you see in the picture. I recommend making the cable itself and the dangling ends that solder to UBEC maybe 50% longer than I made them because it allows more room for things to wiggle into an open space. Mine almost doesn't fit right.
10-pin IDC (Insulation Displacement Connector) cable parts are from Digikey:
- Male connector
- Female connector
- The black connector in the cable I made is not this grey connector - I bought mine at a local store.
- 10-wire ribbon cable
- Minimum order is 5 feet. If you have old IDE hard drive cables you can tear off 10 of their wires and use that. Make sure wires are labeled 28AWG or 26AWG and are 0.1" apart. I've seen IDE cables in thick and thin styles and if your IDE cables look thinner than what's in the picture I don't think they'll work.
- The existing ribbon cable in the TWC is labeled as 28AWG which matches this cable.
Note that it's possible to run a MAX3485 chip at 3.3v to avoid some power wasted running a USB RS485 dongle and you should also be able to omit the UBEC buck converter to save more power (but you'd need to watch the temperature of the UA1 component that converts 14VDC to 3.3VDC on the back of the TWC board). I don't have time to pursue it but if anyone wants to try it I can post details.