Testing and fixing up wiring in the truck.
Testing and fixing up wiring in the truck.
I wired a 9V in series with two AA batteries (1.5V each) to test out the truck‘s dash panel bulbs.
Turns out the bulb holder I tested first was faulty and 9V would have been enough. In fact, three of the nine bulb holders were corroded and unable to provide juice to the light bulbs. That explains why it was so hard to see the gauges at night!
To get by until new parts arrive, I was able to finesse some small pieces of wire in between the bulbs and the holders to get an electrical connection.
A few months ago I helped my brother rewire some lights for his shop to use LED bulbs instead of flourescent tubes. I decided to do the same thing for my kitchen light, which had been flickering and didn’t always light up every tube.
Years ago, a friend rhetorically asked me, “Are you an electrician?” after I screwed up some wiring, which left us without heat on the coldest night of the winter. I’d say I’m the perfect man for this job. 😉
Jokes aside, it is an extremely easy wiring task. Electrical stuff can be scary for a lot of people, so I figured I’d document my process. Fair warning… I am not a professional and I’m not telling you how to do this. This is just an explanation of what I did. I’m also not a lawyer.
I did this at night, guided by some battery-powered LED lights, so the lighting in the photos isn’t very good.
First I TURN OFF THE BREAKER connected to my light. Absolutely no shortcuts here. Then I took the tubes out and removed the fixture covers.
Those black boxes are the ballasts, which limit the current in a circuit. To use LED bulbs those need to be bypassed. I cut all of the wires and removed them.
Then I stripped the ends of every wire I had cut.
In these particular fixtures, one side used 2 blue and 2 red wires and the other side used 2 yellow wires. The yellow side did use some short white wires to connect one tube to the other, but those white wires were not directly connected to the ballast.
This is the key step. All of the wires on one side of the fixture needed to be connected and then connected to either the black (hot) or white (neutral). It doesn’t matter which side goes to white and which goes to black, but it’s very important that everything on one side of the fixture goes together.
As you can see here I grouped by dark (blue and red to black) and light (yellow to white) colors. I screwed a wire nut on each bundle of wires. When I have 3 or more wires connected like this I gently pull on each wire to make sure nothing will come loose.
Before I closed everything up, I flipped the breaker and made sure the light switch was on. Then I took one LED bulb and tested it in each spot to make sure everything worked. There’s nothing worse than having to take something apart after it’s been closed up. Everything worked great, so I wrapped each wire nut with electrical tape.
For the final step I put the covers back on over the wiring and slipped in the LEDs.
It made a huge difference in my kitchen. Here are some unedited before and after shots.
What happened with that wiring mistake I made years ago? We got drunk and survived a cold night. I woke up early the next morning determined to figure out what I had done wrong. I fixed the mistake and learned not to assume that speaker wire running through a basement ceiling was useless. I’m probably lucky the wires I cut were only used for thermostats instead of something with a higher voltage.
I didn’t let my friend’s joke discourage me from trying. To this day I continue to learn.
I get confused every time I work on a 3-way switch. After I remember to make a diagram to lay out all of the wires I have it makes sense. This was for a Wi-Fi connected switch and “remote” pairing I installed yesterday.
On Saturday I went to help my brother move a thermostat and fix a bit of wiring. You’ll never guess where this cord leads…
The cord (hidden behind the dish washer) takes electricity up to a switch by the kitchen sink, which feeds down to wires under the sink. The wires were laying there with wire nuts. Obviously this was meant for controlling the garbage disposal, so we installed a GFCI outlet and now they can turn it on like you’re supposed to.
I’m come across some weird shit in my old 1979 house, but never anything quite like this. What’s the weirdest wiring configuration you’ve seen?
Kennedy and I made a wire loop game, using some basic cheap electronics.
The initial wiring and cutting of the box took more time than I figured and she started to lose interest until we got around to the top. We did this all on-the-fly, but there are plenty of tutorials (like one on Instructables) you can follow.
I successfully built the second piece to a large project I’m working on. I’ve essentially built my own XL Raspberry Pi HAT (Hardware Attached on Top). Since I’m not following the specs, I shouldn’t really call it a HAT.
I’m not sure how, but once again I correctly connected everything on the first try. Either I’m extremely lucky, my attention to detail is paying off, or a combination of the two. I’m just waiting for some catastrophic failure to happen soon when I solder things the wrong way one of these days. Every one of my solder bridges worked. I did run continuity tests on all of the early bridges, which I’m sure was a big factor to my success.
Any guesses on what this board does? Leave your best guess in the comments. It’ll be at least a month before I share more details because I need to finish the entire project first.
I picked up a 10 pack of these 7 segment red LED displays for less than $5. Since each display requires connecting to a minimum of 8 of the 10 pins (9 if using the decimal point), they aren’t exactly easy to work with. Sure, you can buy these where 2 or 4 displays are already connected in a nice package, controlled with the help of an integrated circuit, but where is the fun in that?
If you need to use more than 1 or 2 displays (at 8-9 pins per display), you’ll quickly run out of pins on your microcontroller or Raspberry Pi. The most common way to work with several of these displays is called multiplexing. It’s a method where you briefly turn on one display, turn it off, turn on the next one, and turn it off. You repeat this through all of your displays and then start over. If you do this fast enough, the human eye thinks all of the displays are on at once. It’s pretty slick!
The advantages of multiplexing are:
Let’s get our hands dirty, shall we?
Seven of the pins on one of these displays match up to the 7 segments (labeled a through g), one pin is for the decimal point (DP), and the two remaining pins can be used for the common cathode (cc), though you only need to connect one or the other. Over to the right you can see how all of the pins and LED segments are arranged. Pretty straight forward.
I’m using 6 of these displays in a project, so I needed a lot of wires. It got complex and tangled in a hurry, but amazingly, I connected all the wires without a single mistake on my first try. 🙂 For the most part, I based my circuit design off of this schematic…
The end result is something like the Fritzing screenshot below. With so many wires overlapping, it’s not easy to see what’s really going on here. I suggest grabbing wiring.fzz from my GitHub repo and playing around with it in the Fritzing app.
When I went to write my proof of concept code, I decided to use the Gpiozero Python library to simplify working with the LEDs. The library allowed me to set up a couple of arrays for the LED segments and the 6 digits (displays)…
segment_leds =  for i in range( len( segment_pins ) ) : segment_leds.append( LED( segment_pins[i] ) ) digits =  for i in range( len( digit_pins ) ) : digits.append( LED( digit_pins[i] ) )
Then I could easily loop through and toggle the LEDs in a display as necessary…
for i in range( len( digits ) ) : for j in range( 7 ) : if ( numbers[ digit_values[i] ][j] ) : segment_leds[j].on() else : segment_leds[j].off()
To make sure things worked I count up from 999000 and then start back at 000000 after hitting 999999. You can see the full code on GitHub.
Now for some visual proof that I actually got it all working! Here it is running when I keep one digit lit for 5/10,000th of a second before turning it off and lighting the next digit.
You’d never know that only one digit is turned on at a time, would you?
If I change from 0.0005 to 0.05 of a second you can start to see that only one display is on at any point in time.
You may also notice it’s counting up a low slower due to the way this code increments the counter. Don’t worry about that.
When I keep each digit turned on for half of a second you can really see how this works.
An issue I’m running into on a Pi Zero is when the processor gets busy doing other tasks, there is a bit of flicker across the displays. You can see this a couple of seconds in to the first video. I’m guessing the code would perform much better on a Raspberry Pi 3B. For my project it’s not a concern, but I want to mention it in case you follow this for your own project. You may also pick up what looks like random flickering of a single digit here and there but that’s due to video timing; the human eye doesn’t see any of that when it’s in front of you.
If necessary, you can take multiplexing a step further and only light up an individual LED on each display at a time, with a method called charlieplexing. It will use even less power, but due to the speed at which you need to switch from one LED to the next, especially across an array of multiple displays, you lose brightness to the human eye.
So when part 3 of this series turned out to be a bit uneventful, I wasn’t expecting a grand finale with fireworks. I was right about it being more difficult though.
Through numerous failed attempts I was running into trouble isolating the signals between the rows and columns. Everything was getting connected in one big circuit. Then I realized it was a perfect place to use diodes! Each button needed 2 though; one for its connection to the row and one to the column. I have a bunch of 1N4148 signal diodes so I wired everything up.
This obviously is a lot more complicated circuit than the examples in part 3 of this series. It was a success at what I set out to do though and it works great with my custom keypad code. I’ve also added the actual Fritzing file for this circuit to the repo.
I’m glad I continued down this path with keypad experimentation. I learned a lot. In the beginning I was wondering why the keypads you can buy these days work the way they do and not how I had wired up the old phone keypad to function. Turns out what ended up being a simple solution for me was due to how the old phone keypad made its connections mechanically inside the device. The keypad solutions I showed in part 3 are much easier to create as I’ve now proven by recreating the circuit above.
I’m still curious if I could wire up the old phone keypad to work with the Arduino Keypad library. I guess if I ever get my hands on another old phone, I’ll have to continue with a part 5 of this series.