I am designing a wireless telemetry and control system for a UAV project at uni, and have prototyped an interface in Processing which connects to an Arduino Nano (that has various sensors attached and servo outputs) I have programmed via an XBee module. The setup is as follows:
Arduino Nano connects to:
-MPU6050 Accelerometer/Gyroscope - I2C
-BMP085 Barometer - I2C
-MAG3110 Magnetometer - I2C
SDA and SCL both connect to Vcc (3.3V) via 2x4k7 Ohm pullup resistors.
-Airspeed sensor through analog pin A0.
-XBee - 3.3V, GND, RX, TX
-Up to 4 servos on different header pins (Arduino Digital PWM outputs 5, 6, 10, 11)
-XBee RSSI out (PWM signal connects to Arduino Digital Pin 9)
-A power supply header for the chips - GND and 6-20V
-A power supply header for the servos
-Software serial header pins (RX/TX) - for the future if I need UART (Digital pins 7 and 8 )
This is my first PCB design, could you please check over it to see if there are any mistakes?
Will I need decoupling capacitors (0.1uF?) and where would I put them?
Also, I don't know what spacing to use for the 2x15 pin headers (between them) I have for the Arduino Nano, I sort of just guessed using a ruler and the on screen dimensions but I'm hoping it snaps to the right coordinates for the Nano. I also don't know where on the board I would put the screw holes so I can secure the 3 sensors I have.
Is the logic level of the Nano at 3.3V? If it's running a 5V you need a level translator to interface with the XBee and your IMUs (post links to your IMUs to verify). Also, from the Arduino Nano docs:
The FTDI FT232RL chip on the Nano is only powered if the board is being powered over USB. As a result, when running on external (non-USB) power, the 3.3V output (which is supplied by the FTDI chip) is not available and the RX and TX LEDs will flicker if digital pins 0 or 1 are high.
Also, the FT232RL is limited to 100ma and the XBee pro needs a lot of power: ~200ma for the 60mW version.
Decoupling capacitors should be place near the various chips as closely to the VCC and GND pins as possible. The XBee and IMUs should already have those caps, but in the long run you'll be a less angry person if you add spaces for caps and leave them empty as compared to finding out you need the caps and have no place to put them.
Yeah the Nano still outputs 3.3V even when running on battery (ie non-USB source). I was worried that would be a problem but it all works fine on my breadboard from a 9V battery.
I will need a separate source for the XBee, thanks for reminding me that it requires 200mA.
So for the decoupling capacitors, should I just put them between the Vcc and GND pins on each of the sensor chips then?
Dblade4:
Yeah the Nano still outputs 3.3V even when running on battery (ie non-USB source). I was worried that would be a problem but it all works fine on my breadboard from a 9V battery.
I will need a separate source for the XBee, thanks for reminding me that it requires 200mA.
In my earlier reply I asked if your Nano was running at 5V. Again, if it is, you're going to be risking your XBee and sensors if you don't have logic level translation.
A 9V battery is only good for about 100ma of current and 600mah. You should avoid them altogether unless you're working on a very low power project.
Dblade4:
So for the decoupling capacitors, should I just put them between the Vcc and GND pins on each of the sensor chips then?
Yes it is running at 5V, but shouldn't the sensors work fine since the nano has an onboard 3.3v regular that does work even on non-usb power? The SDA and SCL lines seem to be sending data to the nano just fine even though they are at 3.3v (which I assume is over the min. threshold).
The data being sent across by the XBee was choppy at times but this could have been because of loose wires and the fact that it was drawing power directly from the arduino which cannot supply enough current. I have incorporated a REG1117 in my PCB for 3.3v that connects to a header pin for power in (this also connects to the Vin for the nano, and would be in the 6-20V range). This should allow it to pull current directly from the main power source and thus over 200mA right (given that the power supply can output that much)?
The power to your sensors/XBee is 3.3V but the signals sent from the Nano on the digital pins (SCL, SDA, TX, RX, etc.) are 5V. This is bad. If your sensors do not contain level shifters you will damage them. Some IMU sensor boards do contain level shifters, but I don't believe there's any XBee that is 5V tolerant and this issue definitely has to be handled.
A 1117 is a good choice for 3.3V power but you must make sure to include capacitors as described by the datasheet. Usually a tantalum capacitor is specified, but two, 10uF, electrolytic capacitors on the output line (between Vout and GND) should work.
Wow, I didn't imagine how complicated my PCB would get. It started off really simple and then just progressively got more and more complicated. I will post an updated screenshot of the PCB in the next few days if I have time.