Hardware Debugging Recommendations?

I’m asking here because if you aren’t a member of these forums, I don’t trust your opinion (not entirely true, I do trust my wife).

I have a couple of “touchless” trash cans that use a motion sensor to detect a hand motion or whatever and then opens the trash can lid. They worked great for a while, but eventually took on a life of their own and opened whenever the heck the felt like it. Whether someone was in the room or not, it would sporadically open every few seconds or every few hours. Just random. Since both trash cans sit within inches of an outlet, I figured I could put a Spark Core in each one powered by USB to replace the brains. I had to make a better use case for it, so I decided I wanted to stick some DHT22 sensors in them to get environmentals (outside, not inside) and count the times they trash cans have been opened.

The hardware guts seem relatively simple, but I’d like to be able to debug the voltages, timings, etc on some of the circuits to know how the thing operates before I try to make too many assumptions. What equipment would I need? I have a cheap multimeter, but it’s really slow, so it’s no good for timing, and I can’t be sure the voltage it reads is the max voltage applied to the motor or servo. Would I need an oscilloscope? A logic analyzer? How cheap can I reliably get away with? Are there any USB/software ones?

1 Like

I also only have a cheap multimeter and it indeed doesn’t allow for timing. I believe you would need an oscilloscope for accurate analoge readings. Where-ever possible I try to use the Spark Core itself, so the serial connection is my best debugging friend. Additionally I added a modified micro-SD-adapter which allows me to log the debug statements, readable through a webserver. For timing specific debugging I added a buzzer on a digital out port and along with a LED, the different beeps and blinks can be quite informational.
I can imagine you could also use the analog in ports to use the Spark for measuring voltages at specific times, but I havent tried that yet…

1 Like

@wgbartley I have a super cheap answer for you, maybe you will like it. I bought a Saleae Logic analyzer a few years ago and it has saved me a ton of needless hours of trying to figure out what is going on. When I am ever questioning what is going on in a circuit I can attach a few wires and see the UART or I2C communication directly (it even translates it). They are a great device but NOT cheap ($150). The cheap option is to buy a fake one like one of these ($8):

and use the Saleae software (free). It works exactly the same as my real one and its an $8 solution to a $150 problem. I bought a few on Aliexpress to help some friends who had issues that needed this kind of logic analyzers and they work great. Takes a little time to get them but they are a great option when you really need to know what is going on.

This is an example of how I used my real Saleae Logic in the past:

Hope that helps, good luck with your issue.