Arduino Nano NeoPixel Shield With Integrated RTC

by ThirdEarthDesign in Circuits > Arduino

1215 Views, 6 Favorites, 0 Comments

Arduino Nano NeoPixel Shield With Integrated RTC

step0_image0.jpg
step0_image1.jpg
step0_image2.jpg
"Happiness can be found, even in the darkest of times, if one only remembers to turn on the light."
- Albus Dumbledore, from J.K. Rowling's Harry Potter and the Prisoner of Azkaban

Hello folks and welcome to my 25th Instructable, the Arduino NeoPixel Shield. It's my first one for a while so forgive me if I'm a little rusty, but it sure is good to be back!

Here we have a small custom PCB that was designed using Autodesk's EAGLE and professionally manufactured by OSH Park in the USA. It includes an Integrated real-time-clock (or RTC), various I/O headers and support for an external power supply (either connected by a DC jack or via a screw terminal block) and it's designed to work with the Arduino Nano microcontroller.

The main purpose of this board is to allow NeoPixel (WS2812 LED) strips to be easily connected to an Arduino Nano and provide everything that is required to have a reliable, convenient and versatile way of using them in Arduino based projects. NeoPixels are already pretty easy to wire up to an Arduino, but this makes everything that little bit neater and much more practical for 'professional' type permanent installs of your LED strips. The circuit includes the recommended 1000µF capacitor on the LED strip's power supply as well as the 470Ω resistor on the Arduino's signal pin to prevent damaging the LEDs. A header to connect an external sensor to detect motion and trigger events is also provided, this can be switched between a pull-up or pull-down resistor via a jumper on the board.

The full specs of the board are below:

  • Arduino Nano Compatible
  • External power supply supporting higher current for the NeoPixel strips
  • Support for up to 7.5A current with a 2oz weight copper PCB
  • Can be powered by by using a DC jack (2.1mm) or a screw terminal block
  • DS3231 Real-Time-Clock with battery back-up
  • Sensor input header with switchable pull-up / pull-down resistor support
  • 8x Pin digital I/O header breakout (2x pins have optional resistors for use with LEDs)
  • 4x Pin analog I/O header breakout
  • Optional fuse to protect the Arduino from over-current (bypassable by jumper)
  • Arduino can be powered via the VIN pin or the 5v pin (switchable by jumper)
  • NeoPixel strips connect via screw terminal block with high-current support
  • Built-in 1000µF capacitor and 470Ω resistor for the NeoPixel strips
  • Small form factor - 56.0mm (L) x 42.0mm (W) x 26.0mm (H) with Arduino fitted

Everything you need to re-create the board is provided in this Instructable (including the PCB files), just throw in some basic soldering skills and the required components and you're all set...

Bill of Materials (B.O.M.)

step1_image0.jpg
step1_image1.jpg

To complete this project you will need a number of basic components. I've listed the specific components I used and where to find them (in the UK). If you are located in another territory you may need to source them yourself from a local stockist, but most of the items on the list are fairly common and readily available.

Tip: The list below includes the PCB symbols to help you identify where a part it is located on the PCB. This information is also provided in the attached B.O.M. quick-reference image.

U1 - DS3231MZ+ Real Time Clock
https://uk.rs-online.com/web/p/real-time-clocks/18...

C1 - Electrolytic Capacitor 1μF 50v
https://uk.rs-online.com/web/p/aluminium-capacitor...

C2 - Electrolytic Capacitor 1000μF 6.3V dc
https://uk.rs-online.com/web/p/aluminium-capacitor...

C3 - Multilayer Ceramic Capacitor 100nf
https://uk.rs-online.com/web/p/mlccs-multilayer-ce...

R1, R2 - Optional resistors for LED outputs on the digital I/O header
Refer to your LED datasheet to determine the required resistor values (if using)

R3 - Carbon Film Resistor 470Ω 0.5W
https://uk.rs-online.com/web/p/through-hole-fixed-...

R4, R5, R6 - Carbon Film Resistor 10kΩ 0.25W
https://uk.rs-online.com/web/p/through-hole-fixed-...

F1 - Optional Wire Ended Fuse (500mA max)
This fuse protects the Arduino power source only and can be bypassed via a jumper settings

P1 - PCB Mount DC Power Socket 2.1mm (5A max current)
https://uk.rs-online.com/web/p/dc-power-connectors...

P2 - PCB Terminal Block 2-way (16A max current)
https://uk.rs-online.com/web/p/pcb-terminal-blocks...

T1 - PCB Terminal Block 3-way
https://uk.rs-online.com/web/p/pcb-terminal-blocks...

H1 - Female Header 15-way, 1-row
https://www.mouser.co.uk/ProductDetail/Gravitech/1...

H2 - Straight Pin Header 16-way, 2 rows
https://uk.rs-online.com/web/p/pcb-headers/8633213...

H3 - Straight Pin Header 8-way, 2 rows
https://uk.rs-online.com/web/p/pcb-headers/8599747...

JP1, JP2, HP3, H4 - Straight Pin Header 12-way, 1 row (snapped to required lengths)
https://uk.rs-online.com/web/p/pcb-headers/8633015...

B2 - CR1220 Coin Cell Battery Holder
https://www.mouser.co.uk/ProductDetail/Harwin/S841...

As well as the components listed above you will also need an Arduino Nano, a CR1220 cell battery, some circuit board jumpers and of course the manufactured PCB (more on this in Step 3). Next we'll take a quick look at the schematic...

Circuit Schematic

step2_image0.jpg

They say a picture paints a thousand words so I'd suggest giving the schematic a quick once-over to get an idea of what's what, but nevertheless I shall try to explain as best I can. Hopefully I can clear up some of the less obvious decisions and reasonings of the design.

As you'd expect the PCB symbols listed in the B.O.M. match with the symbols noted on the schematic, this will help you later when it comes to assembling the PCB so keep that list handy.

1. We'll start with the power source. You can supply power to the circuit board either by using a 2.1mm DC jack (note the socket I specified is rated at 5A max current) or you can hook up the power via the screw terminal blocks. The advantage of the terminal block is that it's rated at a much higher current (16A for the ones I spec'd), but remember that your current limiting factor will be the copper tracks on the PCB (more on that in the next step).

2. The jumper JP1 allows you to bypass the optional fuse via the use of a circuit board jumper. Note that this fuse will only protect the Arduino as it is independent from the NeoPixel power output, so if you do intend on fitting a fuse I'd recommend one up to a maximum of 500mA.

3. The JP2 jumper allows you to choose whether to supply power to the Arduino via the VIN/RAW pin or the 5v pin. Use the 5v option if you are powering the board using a regulated 5v supply and use the VIN/RAW option if you are powering the board using a 6.2 - 12v power supply, the Arduino's built-in regulator will regulate it to 5v.

Note: If using a supply higher than 5v you must regulate the power from the NeoPixel's terminal block output separately as NeoPixels are only intended for 5v. The sensor header H4 is also powered directly from the main power source. But the integrated RTC (shown on the schematic as U1) is powered from the Arduino's 5v supply, so it is independent from the external power source.

4. H2 is a breakout of digital pins D2 to D5 and D7 to D10, please note that D2 and D5 have optional resistors to operate LEDs. H3 is a breakout of analog pins A0 to A3.

5. JP3 is a jumper that allows you to select whether the D11 input pin is tied to a pull-up or a pull-down resistor. This relates to H4, which is a header intended for use with an external sensor such as a PIR.

Hopefully that helps clear up any questions over the schematic, now it's time to take a look at the PCB itself...

The PCB

step3_image0.jpg
step3_image2.jpg
step3_image3.jpg
step3_image1.jpg

So we've reached the PCB, the meat on the bone, this is where the project really begins.

Included are the files you'll need to get the PCB manufactured. I used OSH Park because they provide "Perfect Purple PCBs" as standard, and I like purple things. Of course there are plenty of other PCB manufacturers available and there are some great value services out there, typically in China. PCBWay seems to be quite popular but do shop around to get the best value and manufacturing lead times.

Note: One thing you will have to consider when getting your PCB manufactured is the copper weight of the board. The heavier the copper the higher the current the board can support. Use this trace width tool to calculate what currents your board can support with your chosen copper weight. The relevant trace widths on this PCB are 40mil.

To get your manufacturing process started you'll need to download the attached RAR file that includes all the necessary gerber files. Follow the instructions provided by your chosen PCB provider to upload the design and get it made.

Tip: When getting quotes on the manufacturing costs of the board you may find it helpful to know the PCB dimensions, it is approximately 56.0mm (L) x 42.0mm (W).

Now get your board ordered (wait a while) and get ready, because next up is the assembly...

Components and Board Assembly

step4_image1.jpg
step4_image0.jpg

Get your soldering irons at the ready because it's time for assembly. If you've got your board manufactured and you've got everything you need from the B.O.M. you are good to go!

Tip: Remember to follow the PCB symbols listed on the B.O.M. as they will correspond to the symbols on the board. Most parts will only fit in the holes that they are intended to, but the resistors can easily be muddled up so take care.

1. The first thing to decide is what order to assemble in, but I recommend that you fit the SMD devices first. These are located on the bottom of the board and are much easier to solder while the PCB can still lay completely flat. Start with the RTC chip, being sure to take note of the white dot on the board and the symbol on the corner of the chip too. These are there to help you fit it in the correct orientation. Now go ahead and fit the coin cell battery holder. If you are new to soldering SMD components I'd recommend taking a look at this Instructable: How to Solder SMD ICs the Easy Way by SparkysWidgets. The RTC and battery holder are fairly straight forward to solder though,I didn't use anything other than a standard soldering iron, some 0.71mm solder and a damp sponge. Just pay close attention when sodlering the RTC chip. A soldering station with a fine tipped iron and a flux pen would certainly help make things easier, but the key thing is to have a clean iron with a nicely tinned tip.

Note: You'll notice that once the battery holder is fitted the soldering of the H1 female headers gets a little tight around the outside of the battery holder. It's a little awkward but there is enough room to get a good solder joint to the pad. Just try not to touch the battery holder with the tip of the iron.

Tip: I wouldn't be tempted to fit the H1 header before the battery holder as the solder joints will prevent the battery holder from sitting flush to the PCB.

2. Now you can proceed to solder the rest of the components in whatever order suits you, I prefer to start with the smallest components and work my way up to the largest. Take note of the polarity of the two electrolytic capacitors C1 and C2. The polarity is usually indicated by the -- symbol on the negative side of the capacitor body, the longer leg typically indicates the positive side.

3. Once assembled you should perform a visual inspection. Check for possible shorts from bridged solder joints and generally just look for any potential issues such as poor solder joints.

Tip: Adafruit recommend that the 1000μF capacitor and the 470Ω resistor on the data pin are as close to the first LED on the strip as possible. As they are integrated into the board, if your first LED is a significant distance from the board or if you have any issues with the LEDs you may want to consider adding another capacitor and resistor at the strip end. Doubling up on these components is fine.

Once satisfied move on to the next step...

Jumpers, Headers, Testing.. and Done!

step5_image1.jpg
step5_image2_v2.jpg

If you've made it this far, congratulations. Hopefully you've got your board assembled, you've double checked your work and you're ready to test everything.

1. First off you'll want to place the jumpers in the appropriate positions, depending on what options you require. All of the various jumper options were explained in 'Step 2: Circuit Schematic', but an illustrated jumper guide is also provided here in the attached image of the board layout.

2. Next you'll want to connect your LED strip to the screw terminal block. There are three wires to connect, voltage, ground and data. Each of these pins is identified by the labels on the underside of the board but they are also shown in the attached board layout image.

3. If you are using the optional sensor header you can connect that now if convenient, or simply do it later. The ground, voltage and signal pins are indicated by the labels on the underside of the board. These pins and the pull-up/pull-down resistor options are also shown on the board layout image.

4. Now it's time to hook up the power supply, either use the DC socket or connect a power supply to the power input screw terminals. Set the jumper in the appropriate position to use either the Arduino's 5v pin or the VIN pin as illustrated in the board layout image.

5. Next you'll want to program your Arduino (if you haven't already). I'd recommend using the strand test at first to make sure all of your LEDs illuminate as expected. If you are new to Arduino or the NeoPixel library I recommend you start with this Adafruit NeoPixel Library guide.

6. Attach the Arduino Nano to the NeoPixel Shield board, to make sure you fit it the right-way round a 'Arduino Nano USB Port here' label is printed on the PCB directly below where the Arduino's micro-USB port should be located.

Note: Make sure the external power supply is connected before you power up the Arduino with the NeoPixel strips connected, the Arduino won't be able to power a long strip with USB power only and you risk damaging the Arduino.

Congratulations, your NeoPixel Nano Shield is complete, hopefully it was a roaring success and you found the Instructable useful. I'll be following it up with some projects that utilise the board, so look out for those!

Tip: This was my first attempt at using Autodesk's EAGLE and it was also my first time getting a PCB professionally manufactured. So if like me you're also a beginner I'd recommend Randofo's Circuit Board Design Class. It has all the information and step-by-step instructions you need to design your own PCB and get it manufactured succesfully.