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...