Posted on Leave a comment

Idiot Christmas Light Controller

There are 3 types of people at Christmas time. People that put up:

  • A reasonable amount of Christmas lights
  • No Christmas Lights at all
  • An ungodly horrendous amount of Christmas lights.

I’m the third type.

I decided the world needed a box with 8 outlets that could be controlled from a master in my house. I wanted the ability to dim the lights, blink the lights, control the lights with DMX down the road ( never did that one ), but ultimately decided all I really needed was to blink them in the most chaotic way possible. Random was good as long as half the lights were on at any given time. Completely random blinking meant that half the lights were off about half the time. About 25% of the time only 25% of the lights were on. I didn’t like that.

Oh, and I made 8 boxes. So that’s 64 outlets total.

Too keep the current consumption reasonable, I decided that not only was 4 outlets the minimum number outlets, it’s the perfect amount of lights that should be on. It’s totally random which 4 outlets are on for each box, but it is only four.

Running power all over the yard was made simpler by allowing 110VAC input and output on every box.

This project consisted of:

  • A TRIAC power board x8
  • A Receiver board x8
  • 3D printed customer enclosure x8
  • A control board

ESP32

My weapon of choice whenever wireless or wi-fi is being used is the ESP32. I have many of the cheapo Ali Express Dev boards, but I spun my own boards for this one. Wireless range was a concern, but the ESP-NOW library allowed me to build up a mesh network so that each ESP32 board could talk to the other one. The library does all the heavy lifting, but range has been no problem at all even though my control board is down in a basement.

TRIAC Board

TRIAC Board

I guess you can call this a mixed signal board. It’s not EXACTLY a digital signal, but there is some 110VAC power here….at least by my standards. Each outlet is rated for 1A (20 strands of lights), but I’ve never came close to that number. The board itself is rated at 4A total, but I need to check my old notes to see how I came up with that.

The bottom pick is missing the slots where the Christmas Lights plug into. It makes much more sense with that correction. I took a chance on this approach. This 3D model does not show the enclosure the outlets must slip through before soldering. Luckily, this approach has been bulletproof for 5 years and allowed me to avoid wires. Life doesn’t get much better than avoiding wires.

Receiver Board

This receiver board is super simple. +5V input. The ESP32 talks to the Sender via ESP-NOW (more or less wi-fi, kinda). It talks to the TRIAC board via the IDC connector. I originally designed this using a press fit connector instead of the IDC connector. Lesson learned. See “Mistake” below.

Mistakes

Press Fit Connectors Without Serious Jig = Bla!

I experimented with a ribbon connector to mate the TRIAC board with the receiver board within each box. I found some new connectors where you just smash the ribbon with these jaws-of-life teeth. These are probably great if you have a jig to correctly smash them. (I later learned all about press fit connectors at work.) My “jig” was completely inadequate and some of the connections were bad. I lost one or two outlets on each box right away and had to redo the press fit process over and over to get it right. Even then, the connection was unrliable.

I could have used standard 2×5 IDC 2.54mm cables. I always have dozens on hand. I guess my need to experiment bit me that time.

The press fit style connector can not be taken off and this made troubleshooting difficult at times. Lesson learned.

If I redesigned this, I’d use a board-to-board connector…probably just standard 2.54mm headers.

Strengths

PETG Works Great For Enclosures!

PETG enclosures have been very durable. I left 2 of these boxes outside. They are covered to keep the rain out, but nothing else. In a bad storm, they’ll get wet. They’ve been outside since October 2021. They still work very well.

Modern LED Christmas Lights Use Little Power

I’m not sure I believe it, but a 25ft strand of the LED Christmas Lights I purchased only consumes 50mA….and they are really too bright. I’ve considered knocking the brightness down in the code by shortening the TRIAC “duty cycle”. I don’t that’s the term when dealing with TRIACS but this project was 5 years ago and it is the term for PWM and the concept is mostly the same.

Enclosure Ventilation Is Good

Everyone says that water and electronics don’t mix. That’s super true if you’ve got an electrolyte in your water. What they don’t tell you is humidity is everywhere ( not a shock ) and no matter how well you seal up your enclosure, water vapor is getting in. In December in Missouri the temperatures will get down to 0F sometimes and as high as 70F with a typical temperature at any given time being around 32F. That’s a recipe for condensation.

So even if you think you completely sealed your enclosure, water vapor is getting in and that moisture is going to experience condensation. Then you have water….not jus t the vapor in your enclosure. If you think you sealed the water out, you’ve now just sealed the water in. OUCH! That part isn’t intuitive.

I took ventilation seriously and it’s paid off tremendously.

Posted on Leave a comment

Big Girl Audio – Audio Power Amplifier

I became intrigued with the 200W+ audio amplifiers on Amazon for $80 or so on Amazon. I did a little digging and found that some were based on a TI TPA3255 chip. I picked up a few MPN: TPA3255DDV and went to town. I basically lifted this schematic directly from the datasheet so it wasn’t like I had to get super creative, but it was fun dealing with power levels that I’m not used to.

This one worked on the first try, so you know something went very wrong. The difference is this time I don’t know what it was. Maybe that’s the definition of success.

Posted on Leave a comment

POWER INVERTER IN DQ REFERENCE FRAME

The task: Take a DC boost converter controlled with with a PID loop. Input a 60Hz sine wave as the setpoint. This creates a 60Hz sine wave with a DC offset. Make another identical DC boost converter and slam them together across a resistive load. (See schematic). The end result is the DC voltage is cancelled out and the AC voltage is multiplied by 2.

I don’t like talking about this one. I was sprinting full speed for months. The goal: Get my electronics project in a peer-reviewed journal before I graduated from engineering school. I was on a mission and it was going to work. I had managed to take a 5V DC signal and crank it up to 41VAC RMS. The goal was 120VAC.

I had problems with a massive inductive spike on startup that confused the heck out of the PID loop to the point that I could never get the thing to start correctly. Damn causal systems! I created a massive capacitor bank to counter the massive inductive spike.

Then that stupid pandemic thing happened in 2020. I lost access to the university’s high end power supply needed to get this bird off the ground. In addition to a full load of senior engineering classes I was now spending 6 hours a day trying to convince a GRUMPY GRUMPY GRUMPY first grader to do his homework with me. (At-home learning works well….WHEN DONE CORRECTLY…but not for the little ones.)

I bought a 48V DC Meanwell PSU like you see for servers and such. I tried getting this to work at home. Working 18 hours a day pre-Pandemic was possible. My role as a father (and now first grade teacher) was not compatible. I chose to be a good dad. It stung. While comedians all over the world were endlessly ranting about their Netflix binges and ping pong table purchases, I was working myself beyond the absolute maximum and it wasn’t enough.


Posted on Leave a comment

Reading Light Bar

Requirements:

  • Diffused RGBW light that is great for reading that can be mounted to the wall
  • Requires different modes of operation. a) Crazy light show b) Adjustable R G B and W light via faders
    • Reading mode should start out at the set brightness and then fade incrementally for an hour until eventually shutting off. You shouldn’t notice the light is getting dimmer.

This was a basic project. The ESP32 is overkill for this, but I had it on hand. For linear faders that are normally used on a mixing console create voltage dividers that are read by the ADC on the ESP32. The light is dimmed with standard PWM and MOSFETs. Fun artifact. My son wanted to know why his ceiling fan was spinning backwards. He learned all about aliasing! Fun stuff. The PWM frequency I chose is just a hair faster than the rotation of the fan. Persistence of vision says humans can see light when it blinks fast enough, but tell that to the fan. It knows!

Lessons Learned

I don’t know what I was thinking! I used a linear regulator to step down from 12V to 3.3V. That’ll never happen again. Dissipating 8V+ when an ESP32 is pulling hefty power for a modern microcontroller is a bad, bad idea. I should have used a switching regulator. People worry about the noise. Fair enough. I worry about melting!

Those hefty VM3.96mm connectors at ref des: J5 and J3 are strong. They are also a bit too snug. They are meant to be plugged in and stayed plugged in. That’s good. The problem is if you ever want to take the connector off. They are kinda terrible. Granted, I’m sure I got these from Ali Express for $0.00001. Maybe you get what you pay for sometimes.

This was a fun little project. The greatest challenge was getting the clearance right on the 3D printed “tracks” for the LEDs.

As always I always struggle with wiring and connectors. The NAME OF CONNECTOR GOES HER wasn’t nearly as handy for plugging and unplugging as I had hoped. I used an RJ45 connector for the ESP32 to talk to the fader. That worked well. The lesson is a consumer-approved connector should always be used for “consumer approved tasks” whatever that means.

Posted on Leave a comment

Low Power Audio Amplifier

I needed a low power audio amplifier for my home audio setup. Nothing crazy. I basically wanted to match what a car stereo head unit could do. I didn’t want to fiddle with large power and I wanted something cheap. I had done plenty of PCBs for manipulating audio signals, but I had never tried an audio power amplifier before. Granted, this one is a baby, but it was a great way to get my feet wet cheaply.

I’ve used this audio amplifier every day for maybe 4 years. Great little gadget! No issues. Much like a car stereo, it surprises people how loud it is until it runs out of power when you need it and distorts all to hell.

No Markings?

Notice the input on the silkscreen has no instructions. Ahhhh! I would never do that now. I’d list the exact voltage and maybe current requirements right on the silkscreen for a board like this. I’d probably list the min speaker impedance on the outputs as well.

Old Kicad – No Ground Plane?

I’m 99% sure I used a ground plane on this thing. I can’t imagine a world where I wouldn’t have. However, and this is one of the problems with Kicad, when you open a project 4 years later with a different Kicad version, strange things can happen. I opened the .kicad_pcb file in Notepad++ and now I see I used Kicad 5.1.9 to design this board. (Human-editable files is a HUGE benefit to Kicad, btw.) Do I still have it on my computer? Maybe. I don’t plan on producing any more so it doesn’t matter.

Main Audio Chip. MPN: IS31AP2112 (Discontinued).

EDA Tool: Kicad

If you are interesting in the files, contact me. These files aren’t up to my modern standards, but I’ll share them to anyone who asks. I mostly just followed the datasheet examples, but there may be some clues in here that worked in the supporting circuitry.