Author Topic: troubleshooting guidance  (Read 4453 times)

0 Members and 1 Guest are viewing this topic.

Offline lordulrich

  • Contributor
  • Posts: 9
troubleshooting guidance
« on: June 29, 2013, 02:53:51 pm »
I am hoping somebody can give me some guidance on troubleshooting my project. 
What I have : ATmega 328 (running arduino)  connected to a high power relay (coil only), DS1820b temp sensor and 7 segment LED display.  The power supply is mains connected transformer outputting 16 volts, full bridge rectifier, and 7805 regulator. 

When I power everything from a battery everything works fine (except the transformer which is not connected), When I connect the power supply to AC Mains it appears to work until I connect the temp sensor.  When the sensor is connected  the voltage drops and the microcontroller resets and the relay clicks on and off quickly (the relay should turn on at room temp based on the software).  I looked at the 5v power rail with my scope and see a dip in voltage which I assume is causing the reset.

Any ideas where to start?
 

Offline Kremmen

  • Super Contributor
  • ***
  • Posts: 1265
  • Country: fi
Re: troubleshooting guidance
« Reply #1 on: June 29, 2013, 03:17:50 pm »
Yes, by checking the circuit diagram. Please provide it (the actual one, as assembled), preferably in PDF format so everyone can take a look without installing any tools.

Edit: You could also measure the current draw from the battery and see what your power supply does when an equal load is connected. Although a 7805 should push up to 1 amp with no trouble, it would be good to verify that this actually is the case in your circuit also.
« Last Edit: June 29, 2013, 03:21:45 pm by Kremmen »
Nothing sings like a kilovolt.
Dr W. Bishop
 

Offline Stonent

  • Super Contributor
  • ***
  • Posts: 3823
  • Country: us
Re: troubleshooting guidance
« Reply #2 on: June 29, 2013, 03:18:48 pm »


The voltage drops from where?

So

110/220V ---> (Transformer) ---> 16 VAC ---> (Rectifier) ---> 16V DC ---> (7805) ---> 5V DC @ Max 1.5A

Hmm, a dip in voltage could be caused by a load, but an ATMega328 should function down to 3.3 and some variants even go lower.

If for some reason you're not really getting 16V there could be a problem there. If you go too low the 7805 will drop out and you'll lose power. A 7805 should have a dropout voltage of 7 volts.  So you need to be putting in at least 7 volts to get 5 out, if you go below that you'll start falling off.

Also check your amperage at various points, if the amperage shoots up when the voltage drops that could indicate a short or high load.
« Last Edit: June 29, 2013, 03:25:23 pm by Stonent »
The larger the government, the smaller the citizen.
 

duskglow

  • Guest
Re: troubleshooting guidance
« Reply #3 on: June 29, 2013, 03:27:58 pm »
Don't forget the Arduino itself sucks current down.  You only get about 400ma max to play with.  That's a symptom of overcurrent.  I've done this myself when trying to power a keyboard - the voltage drops out and everything dims.

EDIT:  wait, is it a bare chip just running the bootloader, or are you actually using an arduino board?
« Last Edit: June 29, 2013, 03:31:36 pm by duskglow »
 

Offline digsys

  • Supporter
  • ****
  • Posts: 1598
  • Country: au
    • DIGSYS
Re: troubleshooting guidance
« Reply #4 on: June 29, 2013, 08:29:42 pm »
Like others have said, it could be one of a dozen things. Do you have enough decoupling on the regulator? Is the GND correct
with no loops ... etc etc You definitely need to check the current paths ... and again, a circuit would help.
Hello <tap> <tap> .. is this thing on?
 

Offline Stonent

  • Super Contributor
  • ***
  • Posts: 3823
  • Country: us
Re: troubleshooting guidance
« Reply #5 on: June 30, 2013, 03:33:24 am »
I also wanted to be sure that you're not driving the relay directly from the pins on the AVR.  Really you'd need a MOSFET or something in between the arduino and relay with power coming from another source.
The larger the government, the smaller the citizen.
 

Offline lordulrich

  • Contributor
  • Posts: 9
Re: troubleshooting guidance
« Reply #6 on: June 30, 2013, 11:09:39 am »
Ok, I posted a schematic, it is not pretty but it is what I have. 

I tried adding an additional 100uf cap across the power rail - no impact

I have my own board - just running arduino bootloader, with what should be plenty of current capacity, I have fused the transformer with a 1.5 amp fast acting fuse which has not blown (did blow with a lower power fuse when I miss calculated current consumption)

With my fluke I get average current of 0.094 amps and max current of 0.194 amps.

I checked the DC voltage input to the 7805 and read ~13v when connected to mains.   When using the battery,I simply hooked up a 9volt to the terminals for the transformer connection to the board I get about 7 volts at the input to the regulator. 

Sorry for not getting together a response sooner, and thanks for the input. 
 

Offline Monkeh

  • Super Contributor
  • ***
  • Posts: 5337
  • Country: gb
Re: troubleshooting guidance
« Reply #7 on: June 30, 2013, 11:39:18 am »
And how much heatsinking do you have on the regulator?
 

Offline c4757p

  • Super Contributor
  • ***
  • Posts: 7805
  • Country: us
  • adieu
Re: troubleshooting guidance
« Reply #8 on: June 30, 2013, 11:53:44 am »
And how much heatsinking do you have on the regulator?

Yep, I'd bet money that's the problem, and I'd bet a just slightly smaller amount of money that the answer is "none".

Quick calculation with a few assumptions:
TO-220 without heatsink (from Fairchild datasheet): 65 deg.C/W junction-air
Ambient temperature: 25 deg.C
Thermal cutout: 125 deg.C on the die (if the temperature is rising quickly the exterior very well may not be too hot)
Maximum dissipation before shutdown: (125-25)/65 = 1.53 W
Voltage difference: 13-5 = 8
Maximum output current before shutdown: 1.53W / 8V = 192 mA

That's assuming it cuts out at exactly the abs. maximum operating temperature of 125 deg.C. I'm not 100% sure, but I suspect it actually cuts out earlier. Throw in a few more error terms and there's your problem.
No longer active here - try the IRC channel if you just can't be without me :)
 

Offline c4757p

  • Super Contributor
  • ***
  • Posts: 7805
  • Country: us
  • adieu
Re: troubleshooting guidance
« Reply #9 on: June 30, 2013, 12:07:48 pm »
Oh, and check where you have C2 connected.
No longer active here - try the IRC channel if you just can't be without me :)
 

Offline Stonent

  • Super Contributor
  • ***
  • Posts: 3823
  • Country: us
Re: troubleshooting guidance
« Reply #10 on: June 30, 2013, 12:37:18 pm »
The bigger the voltage variance between input and output the more heat that will need to be dumped.  A 7805 will typically shut down before it damages itself from too much heat.
The larger the government, the smaller the citizen.
 

Offline lordulrich

  • Contributor
  • Posts: 9
Re: troubleshooting guidance
« Reply #11 on: June 30, 2013, 01:50:54 pm »
Ok so I tried to drop the input voltage using a different transformer, this time supplying 8 volts AC to the board.  Same problem. I did narrow it down to the relay causing problems.  When the relay is disconnected the rest of the board works fine at either 16 or 8 volts AC. 

I did not have any heat sinking on the regulator, however there was no noticeable heat on the tab either, even after running on the battery (where everything worked). 
I will check the current in and out of the regulator tomorrow. 

I wanted to check my understanding of 2 things...

Oh, and check where you have C2 connected.
I borrowed that part of the circuit from sparkfun (one of the arduino pro boards).  I currently do not have anything connected to the FTDI header, it was intended as a programming header.  Would having the FTDI side of C2 floating cause problems (and why, I am trying to learn)? I will probably just remove the FTDI header in the next spin of the board. 

As for the current through the regulator...I had planned to have the relays powered directly from the unregulated power, I figured it is just a relay so why not, plus then I would reduce the current through the regulator.  Is there a way to make that work, do I need to use something else (MOSFET?) where I have the BJT to make it work. 

Thanks
 

Offline c4757p

  • Super Contributor
  • ***
  • Posts: 7805
  • Country: us
  • adieu
Re: troubleshooting guidance
« Reply #12 on: June 30, 2013, 02:33:00 pm »
Oh, and check where you have C2 connected.
I borrowed that part of the circuit from sparkfun (one of the arduino pro boards).  I currently do not have anything connected to the FTDI header, it was intended as a programming header.  Would having the FTDI side of C2 floating cause problems (and why, I am trying to learn)? I will probably just remove the FTDI header in the next spin of the board. 

If having that capacitor there is intentional, it's certainly a weird way to go about it. It might work, actually, depending on how long of a reset pulse is needed. When you yank down on one side of the capacitor, the other side will pull down as well, but then it'll charge back up. Not really a very "proper" way to do it, whatever "it" is.

I suspect they meant to put it between RESET and ground, to prevent noise from causing resets, not in line with the reset signal. The reset signal should go straight out from the reset pin to the header, maybe in series with a small (10-100 ohms or so) resistor to help with static protection, but not in series with a cap.

I am now too tired to properly analyze the real question here, so I'll leave the power supply stuff for people in other time zones so I don't make an ass of myself  :)

Edit: The cap in series indeed appears to be common on Arduino boards. Looks like a hardware correction for people leaving the reset line low instead of just twiddling it down and back up again. Go ahead and leave it like that, but make sure you use the right resistor and capacitor - the time of the reset pulse will be determined by them. Not really how I'd choose to do it, but clearly if it's been done that way since the first Arduino, it's stood the test of time and works just fine.
« Last Edit: June 30, 2013, 02:39:00 pm by c4757p »
No longer active here - try the IRC channel if you just can't be without me :)
 

Offline Thor-Arne

  • Supporter
  • ****
  • Posts: 503
  • Country: no
  • tinker - tinker, little noob.....
Re: troubleshooting guidance
« Reply #13 on: June 30, 2013, 06:10:14 pm »
Hi.

Have you tried a different library for the DS18B20 ?

I have tested a few of the libraries and some of them have some strange side effects to them, like not being able to blink the led on D13.
After discovering these problems I went for this sketch, although it's not a library it can easily be adapted to be used as a library.
 

Offline lordulrich

  • Contributor
  • Posts: 9
Re: troubleshooting guidance
« Reply #14 on: July 01, 2013, 12:17:09 pm »
Ok, so to eliminate a problem with the D18B20, I put in a TMP36 probe instead, and changed my code.  I see the same problem.

I tried swapping out the relay with a resistor (of similar resistance) and saw the same behavior.  SO....why would it behave like this only when powered with AC and not with a battery? and how do I make it stop. 

P.S. c4757p, Thank you so much for taking the time to respond.  Your detailed responses have really helped me to understand and learn. 
 

duskglow

  • Guest
Re: troubleshooting guidance
« Reply #15 on: July 01, 2013, 12:22:00 pm »
Have you checked that you're not somehow shorting Vcc to ground when you put the temperature sensor in?

I know it's a stupid, basic question, but sometimes...
 

Offline Thor-Arne

  • Supporter
  • ****
  • Posts: 503
  • Country: no
  • tinker - tinker, little noob.....
Re: troubleshooting guidance
« Reply #16 on: July 01, 2013, 05:30:02 pm »
Ok, so it's not the DS18B20. That device should draw max 1.5 mA, so that itself should not be a problem.

Perhaps try a little larger electrolytic caps around the regulator to eliminate any problems there?
 

Offline Odysseus

  • Regular Contributor
  • *
  • Posts: 108
  • Country: us
Re: troubleshooting guidance
« Reply #17 on: July 01, 2013, 05:30:21 pm »
Try increasing the filter capacitance after the rectifier.

I = C*dV/dt -> dV = I*dt/C = 100mA*8.3ms/100uF = 8.3 V.

Thus, The voltage input to the regulator is dropping by 8.3 Volts every half line cycle, assuming you've got 60Hz mains.  Make it 10V for 50Hz.
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf