Problems with my first shield

Hi,

I am trying to develop what is essentially an Arduino Mega Shield to act as a 'brain' for a project I'm working on. I've had a PCB made (my first), and after thinking I had it sorted have gradually discovered a number of screwups. I'd appreciate some pointers before I attempt revision B..

I have included my schematic with some annotations. It's a complex schematic, but most of it is just breaking the mega out to spring terminals.

I have a very good multimeter (Fluke 87V) but no scope (I plan on getting one), so my diagnosis ability is limited.

Here are the major things I'm concerned about...

The 'DC UPS' function appears to work on the surface. If I connect a 12V battery and the 12V regulated supply the battery charges up to float, and disconnecting the regulated power supply appears to continue delivering power from the battery. Also, if I disconnect the battery power is taken from the power supply.

Note that I am using another PSU to take the output of the DC UPS and convert that to a 9VDC and 5VDC supply. I used a 3A model from Sure Electronics that I should probably replace with a couple of LM317's or similar as my amp requirements are ~1A max on 5V and less on 9V. (Is a series of LM317's a good choice)?

However, when the battery and the supply PSU are connected the real-time clock stops working (inaccessible), and I can see 50Hz at various points in my circuit (including Arduino VIN). If just using the battery the RTC is fine. While I now realise that I should have decoupling capacitors at every IC, I am wondering if I may have a ground loop, or if the charger is producing noise. I understand that all parts of the circuit must have the same DC 'ground' (0V), but I am confused about whether the battery needs any special treatment or whether it and all PSUs will have the same 'ground'.

I have experimented with moving the crystal and RTC off my board, powering it directly from my 5V PSU rail, using a 0.1uF decoupling cap, and using soft I2C in case there's a problem on my SDA/SCL lines. I have also tried a good wallwart (outputs 12.1VDC) and what I thought was a decent DC-DC regulator unit taking power from a 240VAC-24VDC supply. Same result in all cases - will only work with the 12V supply disconnected. The EEPROM works in any case, but only if the RTC is diconnected when the 12V supply is connected.

I am suspicious of the fact that I have pull-ups on my I2C bus connected to a different 5V source than the VCC of my EEPROM chip (which used the Arduino's 5V).

I want to be able to have a SPST switch cut power to both the 9V and 5V supplies for all but the RTC. The reason is that I have an arduino, a display (4D Systems LCD) and a beagleboard hanging of this circuit and would like to be able to cut power to them (after a graceful shutdown), but also have a UPS-style battery backup. I have tried to avoid using a specific 3.3V battery for the RTC.

I tried to do that by switching their ground (and that of the line into the PSU), but that failed miserably with ~8V being output on my 5V line. I then used a jumper to close the ground switch permantently. Obviously I can just switch the positive 5VDC and use a relay controlled by that to actuate the 9V, but there must be a better/simpler way?

Also, if I want to make a direct USB connection without the large cable ends, is there any problem with soldering the cores (and shield) of the USB cable to the pins of the Arduino's connector?

I'd appreciate any other suggestions...

Cheers,

Lee

I'm really keen for some help here - it occurs to me that my post may be too dense or not make sense in places. If you think you can help, please let me know if anything is unclear or if I need to break my issues up into more discrete questions.

Thanks in advance.

I just ordered an oscilloscope so hope I can diagnose more effectively...

There's too much for me to digest at once and I can't comment much on the analogue/PSU stuff, but a couple of things I'm not sure about .

1307 GND connected to VBAT, its that OK. The chip will expect a battery on that to work when power is cut.

The 18B20 temp sensor, doesn't that need a VDD/VCC connection?

Also, if I want to make a direct USB connection without the large cable ends, is there any problem with soldering the cores (and shield) of the USB cable to the pins of the Arduino's connector?

It'll be a bugger to unplug :slight_smile: but I don't see any problem with that.

and I can see 50Hz at various points in my circuit

Silly question, but are you sure the external PSU is DC?


Rob

Thanks for your post

Graynomad:
There's too much for me to digest at once and I can't comment much on the analogue/PSU stuff, but a couple of things I'm not sure about .

Graynomad:
1307 GND connected to VBAT, its that OK. The chip will expect a battery on that to work when power is cut.

Yep, it's OK to ground VBATT if not using it. In my circuit, the UPS function will mean that the 12V battery will supply the RTC (and the rest of the circuit) if power is cut.

Graynomad:
The 18B20 temp sensor, doesn't that need a VDD/VCC connection?

The way I have it hooked up works, and is in 'parasitic mode' per here. Of course the other conventional method of separate VCC works and I may do that with my next revision to play safe.

Graynomad:
Silly question, but are you sure the external PSU is DC?

Definitely. I am using either a wall wart I've used in previous projects, or one of these Adjustable DC-DC regulators downstream from one of these 24VDC supplies. But perhaps my supply also needs better filtering downstream , esp when the charger is running.

As I read up on grounding, I'm beginning to think that I have screwed up by having one monolithic ground plane that the battery and PSUs connect to, with a 'switched' ground track running between different pads on my board that cause a loop(s) and oscillation. I am still a little mystified by the specific frequency of the 50Hz DC signal, and am beginning to wonder if I'm picking it up capacitively (e.g. from the AC/DC regulator) as my meter has long leads. I did think that only happened on AC but will have to check.

R5, 6 and 7 add up to 460.6k. Given that they are in series with a pot couldn't you just use a 470k?

Admittedly the pot is only 2k, do you need that fine adjustment?


Rob

Graynomad:
R5, 6 and 7 add up to 460.6k. Given that they are in series with a pot couldn't you just use a 470k?

Admittedly the pot is only 2k, do you need that fine adjustment?


Rob

Hi Rob,

Good pickup. I should change it to give more range. It's the voltage divider to set the float voltage for the battery on the LT1513 (which is 13.65V in my case). I may go with a larger multi-turn, and a standard resistor to match.

Cheers,

Lee