So, just to set the scene. I had dimmed the lights, got a cool one out of the fridge and sat down to watch a film. I said "Ok Google, Turn Movie Mode On", the notification came up on my Living Room Kodi, telling me movie mode was on. But no Lights?
My first thought being the power cable had come loose as it was a cheap usb cable with the connector cut off and put into a screw terminal, but it wasn't. I tried the tried and tested method of unplugging and plugging it back in, waited a second and tried turning it on again, and again nothing. At this point I noticed that the on-board LED of the nodeMCU board which I am currently using was glowing very faintly, and i had a horrible thought, that I had bricked the board.
If you don't know what I am talking about, I have written up another blog post on this at Smart Home Movie Lighting
So I unplugged the LEDs and the power and started doing some investigation.
I started by flashing the board with the Example Blink sketch, and it worked; this got me even more confused. So i tried uploading the Movie Light arduino sketch, which still has Serial output for debugging, it uploaded fine. I open the Termite (a Serial Monitor) and start sending commands, it returns the correct information back out. So at this point I assume that the LEDs had blown, which would be understandable as they came from a bargain store and where part of a £3 light.
After leaving the board for a while to work on my Party Ball (Smart Home: Let the Party Begin) I decided to have another look just incase I had done some irreversible damage. I first started by seeing if the LED has blown, as I though it was strange for them both to blow when the system was turned off. I plugged them into a cheap breadboard power supply (I don't have a benchtop power supply yet), at 3.3V the had a faint glow, adn at 5v they light up.
So I now hooked my oscilloscope up to the output pins of my board, and get a noisy signal of a constant voltage at around 4.5V, when the output should be off. I start to worry again that I have blown the digital pin I had connected the output to. So I try taking NodeMCU out of the board and the probe further back, to the pin on the NodeMCU, and I started sending commands to the device, and there is my PWM output. I think, is there a short circuit in my board, which wouldn't have surprised me. But nothing.
Then I have a though, has my transistor blown? I gave a quick test with a breadboard and another transistor just connected to a 5mm led, and it worked. So my transistor output had blown.
The transistor I had originally used was a BC547, and checking the data sheet it has a max collector current of 100mA, I had never checked the current in the circuit; but i know I am using a 500mA supply, so most likely I have blown the Transistor.
The moral of this story, for me anyway, start thinking; and don't get too excited by it working on the breadboard and put it straight into a perf board and inplace. So now I have to wait until i can order some beefier transistors, or design some current limiting for the transistor output stage. REally i should have seen this coming, as the whole time i have been using the device, I have noticed it flickering when on, even at low levels. I will most likely wait until I order the ESP-01 before remaking this circuit, or just through transistors at it until I remake it. And when i Do, some more care will be taken when designing it.