troubleshooting guidance - Page 1
Forum section: electronics / beginners

author: lordulrich
author_rank: Newbie
timestamp: June 29, 2013, 04:53:51 am
content: 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?

author: Kremmen
author_rank: Super Contributor
timestamp: June 29, 2013, 05:17:50 am
content: 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.

author: Stonent
author_rank: Super Contributor
timestamp: June 29, 2013, 05:18:48 am
content: The voltage drops from where?So110/220V ---> (Transformer) ---> 16 VAC ---> (Rectifier) ---> 16V DC ---> (7805) ---> 5V DC @ Max 1.5AHmm, 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.

author: Unknown
author_rank: Unknown
timestamp: June 29, 2013, 05:27:58 am
content: 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?

author: digsys
author_rank: Unknown
timestamp: June 29, 2013, 10:29:42 am
content: Like others have said, it could be one of a dozen things. Do you have enough decoupling on the regulator? Is the GND correctwith no loops ... etc etc You definitely need to check the current paths ... and again, a circuit would help.

author: Stonent
author_rank: Super Contributor
timestamp: June 29, 2013, 05:33:24 pm
content: 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.

author: lordulrich
author_rank: Newbie
timestamp: June 30, 2013, 01:09:39 am
content: 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 impactI 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.

author: Monkeh
author_rank: Super Contributor
timestamp: June 30, 2013, 01:39:18 am
content: And how much heatsinking do you have on the regulator?

author: c4757p
author_rank: Super Contributor
timestamp: June 30, 2013, 01:53:44 am
content: Quote from: Monkeh on June 30, 2013, 01:39:18 amYep, 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-airAmbient temperature: 25 deg.CThermal cutout: 125 deg.Con 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 WVoltage difference: 13-5 = 8Maximum output current before shutdown: 1.53W / 8V = 192 mAThat'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.

author: c4757p
author_rank: Super Contributor
timestamp: June 30, 2013, 02:07:48 am
content: Oh, and check where you have C2 connected.

author: Stonent
author_rank: Super Contributor
timestamp: June 30, 2013, 02:37:18 am
content: 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.

author: lordulrich
author_rank: Newbie
timestamp: June 30, 2013, 03:50:54 am
content: 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...Quote from: c4757p on June 30, 2013, 02:07:48 amI 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

author: c4757p
author_rank: Super Contributor
timestamp: June 30, 2013, 04:33:00 am
content: Quote from: lordulrich on June 30, 2013, 03:50:54 amIf 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 myselfEdit: 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.

author: Thor-Arne
author_rank: Unknown
timestamp: June 30, 2013, 08:10:14 am
content: 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 forthissketch, although it's not a library it can easily be adapted to be used as a library.

author: lordulrich
author_rank: Newbie
timestamp: July 01, 2013, 02:17:09 am
content: 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.

author: Unknown
author_rank: Unknown
timestamp: July 01, 2013, 02:22:00 am
content: 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...

author: Thor-Arne
author_rank: Unknown
timestamp: July 01, 2013, 07:30:02 am
content: 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?

author: Odysseus
author_rank: Regular Contributor
timestamp: July 01, 2013, 07:30:21 am
content: 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.