September 2019 Update

New! We're moving to the new forum!

ALL new Blog posts will be on the forum.

Please join us there.

This Blog will no longer be updated...

Friday, August 23, 2019

2 steps forward, one step back...

It never fails, when things are going well, strange things happen.  

The prototype "Mega Shield" I've been running here for days now without problem, suddenly doesn't work.   

I decided to take a break from building the new sensor module shield, and hooked up the prototype, planning to start some testing, and every sensor on every port was failing the initial power test. Eventually I grabbed the multi-meter and started measuring voltages...  

  • At the Port connector pins where the sensor plugs in, nothing, no fluctuation of the voltage when it is supposed to go high.
  • Next I measured at the transistor when it was switched on, nothing
  • Then I measured at the pin that switches the transistor, 5v
  • Then I measured at the BASE terminal of the transistor, 5v
  • If the transistor BASE is getting 5v, then the transistor should close the circuit from the 5v power supply to ground yet I couldn't measure any voltage through the transistor.
  • I measure the voltage from the 5v power module, it was 5v
  • Interesting, the digital pin to control the transistor is supposed to only go high when measuring or testing the transistor so that it doesn't promote corrosion of the sensor, yet is was reading 5v the whole time.
  • I pulled the shield off, and measured the voltage on the digital pin again, on the bare arduino, and it did switch on and off as it should....

So, something is causing the pin to stay high when the shield is attached.

Question: Why now? This was working yesterday, exact same software/hardware, no changes whatsoever.

Suspect: I feed 12v into the shield from a walwart, the shield routes that 12v to the VIN pin on the Mega.  That is within the 7-16v rating.  

Is it possible that my shield is either tying pins together, or causing a short, or sending power somewhere it shouldn't?  What else could cause the pin to stay at 5v even when set to LOW in code?

I thought maybe I had blown up all the transistors, so I pulled the shield off the arduino, applied 5v to the pin which connects to the digital pin on the arduino, in effect, mimicking the pin going HIGH, rather than the arduino turning on the transistor, I did it manually. To test the transistor, I simply measured the resistance between the collector and emitter as I applied power, and it went from a complete open circuit, to a short circuit, so I know the transistor is working, So, I hooked the shield back up on the arduino, and did not power the dc-dc converter, so there was no other power on the entire module except for the power on the USB connector...  The digital pin still measured 5v all the time, but the transistor never closed the circuit...   This is very weird...

The ONE thing that seems to make a difference is whether or not the shield is plugged in...

So, I just typed all this in, mainly for my own use, it helps me gather my thoughts and also acts as a reference I can come back to to see what I did, and what happened...  It also lets you see how I tackle these kinds of problems...   not overly efficient, but it has served me well over the years :)  

I'm confident I'll solve all these issues, and get to take 2 more steps forward!

Update: 5 minutes later

I plugged the sensor into the arduino without the shield, and it reads it ok...  The shield is really starting to look like the culprit...

Update: 10 minutes after last update...

Ok, I'm having another one of those days...

It's working now...  I was right, there were NO changes to the software or the hardware...  I DID change the configuration of the module and ports though because the new shield I'm working on routes different pins to control the transistors, so naturally, the configuration needed to change so it knew which pins to toggle... I knew that, but I changed it back before I even started, however, I entered even numbered pins rather than odd numbered pins as I should have...

Perhaps this isn't the best day to try debugging?  Oh well, I've got nothing better to do :)

No comments:

Post a Comment

Any comments deemed off topic or offensive will be removed