Close

Testing On-Board Light Control (how to find dumb mistakes pt. 3)

A project log for Kerbal Spaceship Potato

This is an input focused control panel for Kerbal Space Program.

matthew-peverillMatthew Peverill 10/05/2019 at 19:450 Comments

So a few logs ago I posted about developing an LED light circuit. It was fairly complicated, because we want a central dimmer control as well as a hardware light test button. I've been having some trouble getting the circuit (as built in to the action panel) working. As always, we are just going to have to isolate everything that can go wrong and break down the testing to isolated tests. So here is my troubleshooting process:

1. Is the action panel hooked up right? I hooked up the action panel to my breadboard and repeated the i2c input test. AND we have a winner: we got an i2c timeout.

When I first tried out the i2c, I realized that the power plane on my action button panel wasn't hooked up. When I tested, i sometimes needed to adjust it before I could get a good test. I tried out this connection with the multimeter and it looks to me like it's still not hooked up right. Probably this is because I tried to solder it on to the microswitch leads, which are a bit shaky because I had to bore out the holes to get them on the board. Instead I bridged the power across the +5V pins of the LED hookups and now it works fine:

2. Is the LED working? First I hook it up to voltage with a resistor, then to PWM straight off the arduino with the default 'fade' sketch: works fine.

3. OK now can I hook up my led to the action panel? No. But, if I ground the 'light test' pin then the light turns on. So the light test portion of the circuit appears to be working ok. Possibly the circuit is fine and this is a software issue?

4. What if I connect the corresonding pin on the ULN to high? That works fine! Ok this is almost certainly a software problem then - because the issue may be that the MCP pin isn't being set correctly.

4. Look at some example code. Ah-ha - I am writing to the wrong registers on the MCP23017 switch. I need to write to 0x12 and 0x13 just as if I were reading. Now it works!

Discussions