PCB making at home – UV exposure

This is the second post in a series of posts I am planing to write about making printed circuit boards at home. The first post explains all the things you will need to make a PCB at home using the UV exposure method.

The purpose of the UV exposure is to get the PCB layout image onto the Copper board. The pre-sensitized board we are using has a thin layer of photoresist coated on top of the Copper layer. When exposed to light (near the UV region) photoresist becomes soluble by a positive photoresist developer. If unexposed, photoresist becomes insoluble to photoresist developer and forms a strong bond with the Cu layer.

As you will see in the steps below this property of the photoresist  is used to put an etch-resistant image of the PCB layout onto the Cu board.

So let’s begin!

Printing the layout onto a transparency sheet

For a double sided PCB, either the top side or the bottom side needs to be mirrored when printing. When the PCB is exposed the layout will get mirrored again. Since most of my components are on the top side I will mirror that side so when the board is developed the components will go on the top side. Otherwise some components, where orientation matter, will have to go on the bottom side.

Tip: The layout editor has a setting where you can mirror the layout when printing. Use the transparency setting on the printer for better results.

Step 1: Print a mirrored image of the top side layout onto a transparency sheet.

Chances are, if you are using an inkjet printer like I am, when you print your layout on the transparency the traces and component pads won’t be completely opaque. So I usually print two copies and align one on top of the other to increase the opacity.

Step 2: Print another mirrored copy of the top side and align it with the previous copy. Use pieces of clear tape at the edges to hold the two transparencies together

Top side of the layout printed on transparency. Top side is mirrored.

Top side of the layout printed on transparency film. Top side is mirrored.

Step 3: Print two copies (not mirrored) of the bottom layout on transparencies and align them as in Step 2.

Bottom side of the layout printed on transparency film. Bottom side is not mirrored.

Bottom side of the layout printed on transparency film. Bottom side is not mirrored.

Step 4: Carefully align the top side on top of the bottom side (with the printed sides facing each other) by hand such that the component pads on the top side perfectly lines up with the corresponding component pads on the bottom side. This is possible only if one side is mirrored as in Step 1.

Step 5: Secure the aligned top and bottom transparencies with a piece of clear tape on one side such that the board can be slid in between the two transparencies making a sandwich.

Carefully align the top and bottom side transparencies.

Carefully align the top and bottom side transparencies.

Preparing the pre-sensitized board

Now is a good time to remove the pre-sensitized board from the wrapper (but don’t remove the white cover yet). The white cover sheet on the board is there to prevent accidental exposure. Chances are the board you got is not the correct size for the PCB you want to build. The 150 mm x 250 mm board I already had at home is a bit larger for my 100 mm x 160 mm layout. So I want to break a piece off the board to make it close to the size I want. That way I can use the extra piece for another PCB.

The pre-sensitized board has a white cover sheet to prevent accidental exposure.

The pre-sensitized board has a white cover sheet to prevent accidental exposure.

If you don’t need to break a piece off your board then you can skip to Step 9. To break a piece off the board,

Step 6: Draw a line across the board on both sides where you want to break it.

Step 7: Use a knife and a straight edge to make a groove (about half a mm) along the line on both sides of the board.

Step 8: Use a table edge to bend the board along the groove until it snaps clean.

Setting up the exposure table

A couch table with a sheet of glass in the center hacked as an exposure table

A couch table with a sheet of glass in the center hacked as an exposure table

Since I didn’t want to spend money on an expensive exposure kit, I found a way to hack a couch table to do the exposure. The table has a sheet of glass in the center where I can place the transparencies and the board. This allows me to expose both sides of the board at the same time.

The exposure table should be setup on a relatively dark room with no direct sunlight or a light source. It doesn’t have to be pitch black (basement is perfect!). But darker the better. If it is too dark to see anything you can use a red light source. Photoresist is only sensitive to wavelengths near the UV region.

Step 9: Place two desk lamps (with fluorescent light bulbs) on either side of the glass sheet facing each other as in the image above. The light bulbs should be 5″ to 6″ away from the glass surface.

Tip: To turn on both lamps at the same time, connect them to a power bar with the switches turned on and then plug the power bar to the wall.

Step 10: Place the transparency stack assembled in Step 5 on the glass sheet centered between the lamps, and secure with clear tape on one side such that you can slide the board in between the top and bottom transparencies.

Place the transparency stack in between the lamps

Place the transparency stack in between the lamps

Exposing the board

Steps in this section are time sensitive, and they must be done in one sitting. The exposure time depends on the power of your lamps and how far away they are from the board during exposure. I am using 13 W bulbs 6″ away from the board and a 8 minute exposure time is enough. I have found previously that a 10 minute exposure is a bit too much for my setup.

You may also want to gather the following items beforehand and keep them in a easy to find location,

  • A second sheet of glass (I took mine from a photoframe)
  • Positive photoresist developer
  • Plastic container large enough to place your board
  • Water
  • Tissue paper or soft cloth
  • Safety gloves and safety glasses

Before you begin, ensure both lamps are off and the room is relatively dark. You can use a red light source.

Step 11: Carefully remove the white protective covering from both sides of the pre-sensitized board taking care not to touch the board surface (hold from the edges).

Step 12: Slide the board in between the top and bottom transparencies and ensure the complete layout falls within the board edges.

Step 13: Place the second sheet of glass on top of the transparency-board sandwich and apply weight to press it down as in the image below.

Exposing the pre-sensitized board

Exposing the pre-sensitized board

Step 14: Turn both lamps on at the same time and set the timer for 8 minutes.

Meanwhile, prepare the developer solution.

Warning: Positive developer is corrosive. Wear safety gloves and safety glasses when handling chemicals.

Step 15: Add 10 parts water to 1 part positive developer solution to the plastic container. Ensure you have enough depth so when you put the board inside, the solution will completely cover it.

Mix one part positive developer to ten parts water in a plastic container.

Mix one part positive developer to ten parts water in a plastic container.

Step 16: When 8 minute exposure is done, turn off both lamps. Carefully remove board from the setup and place in the plastic container with the developer solution.

Step 17: Tilt the container back and forth to move the solution around the board. After a few seconds you will start to see the image of the layout appear (like magic!). Keep agitating the solution until all the excess photoresist is removed from the board and only the image of the layout remains. The board should be in the solution no more than 30-40 seconds. If you keep the board in the solution for too long it will start eating away at the layout image as well.

Step 18: Once all the excess photoresist is dissolved, remove the board and rinse with plenty of cold running tap water.

Step 19: Dry the board with tissue paper or a piece of soft cloth.

Image of the top layout on Cu board after UV exposure and development

Image of the top layout on Cu board after UV exposure and development

 

The image of the bottom side layout after UV exposure and development

The image of the bottom side layout after UV exposure and development

So the UV exposure and development of Music and Lights board turned out not too bad. However, if you notice closely, the left side of the top layout got a bit over exposed. This happens because the glass sheet on top of the board wasn’t pressing hard on this side of the board. When the transparency is not pressing tightly on to the board during exposure, light could seep through.

This is bad because the faint traces on the left side will not be able to completely protect the Cu during the etching process. Fortunately, it can be fixed by going over the traces and pads with a ultra fine tip sharpie (or permanent marker).

The over-exposed traces and pads can be fixed by an ultra fine tip sharpie before the etching process

The over-exposed traces and pads can be fixed by an ultra fine tip sharpie before the etching process

Finally, the board is ready for etching! Etching is easier than the UV exposure part but it takes a bit longer. So I will leave that to the next post. Stay tuned and Thanks for reading!

PCB making at home – getting started

After making a few of my circuits on perfboards I decided it was time to move on to printed circuit boards. Perfboards are probably the best choice for smaller circuits, but as my circuits got bigger and more complex it was difficult to wire everything and make it look neat. Also I really wanted to learn how to design printed circuit boards since PCBs are used in almost all electronic devices these days.

Of course, after you design your PCB you can get it manufactured by a PCB manufacturer, but making your PCB at home is fun and has many challenges to work through. There are many ways to make your own PCB at home. The method I am using is commonly called the UV-exposure method. And I will show you the process I use and how I solved certain hurdles along the way.

Before you decide to make your PCBs at home, there are a few things to consider.

  • You will be working with chemicals and will need to take the necessary safety precautions.
  • After you are done with the chemicals you need to find a proper way to dispose them. No you can’t flush them down the toilet! (This will cost more down the road)
  • You may have to purchase additional equipment (see the list of things needed below)

When I was making my first PCB at home, I had to find alternative ways of doing certain steps since I didn’t want to spend a lot of money on expensive equipment like UV exposure kits. My first step is to look around the house and find a way to hack something to get what I want.

Equipment and materials needed

  1. A PCB layout – I am going to make my Music and Lights PCB.
  2. Transparency film – The type of transparency film will depend on whether you have a laser printer or a inkjet printer. Transparencies made for laser printers won’t work with inkjet printers and vice versa. I have an inkjet printer, and I found inkjet transparencies at Staples.
  3. Printer – A laser printer or an inkjet printer will do.
  4. Pre-sensitized Copper clad board – These boards have a photosensitive coating on top of the Cu layers. And they are either positive or negative acting. You will need a board that is positive acting. You can get them double-sided or single-sided. I will be using a double-sided board for my Music and Lights PCB. The boards come wrapped and you should keep it that way until ready to use.
  5. Two desk lamps with fluorescent light bulbs – For a double-sided PCB you need two lamps, one for each side. Regular light bulbs won’t work well (or take a really long time) since the photosensitive coating needs shorter wavelength light (near UV) to change its chemical properties.
  6. Photoresist Developer – These come in two flavors (but don’t even think about drinking them!) positive or negative. Since I am using a positive acting pre-sensitized board I need a positive developer. You can find these at your local electronics store.
  7.  Etching solution – There are a few etchants you can use, but the one I am using is Ferric Chloride.
  8.  Nail polish remover – This is used to remove the photoresist after etching is completed. If you don’t already  have this your mom or sister will.
  9.  Drill and drill bits – A hand drill won’t work unless it is a small one designed for PCBs. I use a small drill kit I found at Jameco (Part no. 2113252), which came with two drill bits and a stand. The size of drill bit you need will depend on the components on your circuit. But I find that a 1 mm drill bit works for most components.
  10. Plastic containers – large enough to put your board inside flat with the solutions. Metal containers will react with the solutions and should not be used.
  11. Sheet of glass – From a picture frame. To put over the pre-sensitized board during exposure. I will explain why this is necessary when I get to that step. Also since I have to expose both sides of the board at the same time I am using a couch table that has a glass plane in the middle. This is a hack I will explain later.

Since you are gonna be working with chemicals you also need the following safety equipment and a well ventilated area to work with

Safety Equipment

  1.  Safety gloves – The photoresist developer (NaOH) and the etchant (FeCl3) are corrosive.
  2.  Eye protection
  3.  Respiratory mask – The photoresist developer produces a white powder when dried up, and the fumes of Ferric  Chloride is toxic and can cause burns.

Once all the equipment is gathered, it is time to develop the PCB. This is where the fun begins, and it deserves its own post. Stay tuned!

Music and Lights – the layout

I have finally finished designing the layout of the PCB, and I am very happy with the way it turned out. Everything fitted nicely on a 100 x 150 mm double-sided board. Here are some of my design guidelines before I started:

  • Keep the AC signals separate from the DC signals. Specially the speaker amplifiers.
  • Have a large ground plane and connect GND pins directly to it.
  • Place decoupling capacitors close to the respective device pins of the speaker amplifier and MCU.
  • Place the speaker amps symmetrically on the board to evenly distribute the heat.

And here is the result,

Front side of the Music and Lights PCB layout.

Front side of the Music and Lights PCB layout.

The smallest traces are 0.7 mm wide. The power rails are 1.5 mm wide. All the components are on the front side of the PCB except the speaker amps. The speaker amps will be heat sunk to the ground plane, so I placed them on the bottom side of the PCB.

I tried to line up similar components the best I could. It gives an aesthetic look to the board and actually makes it easier to mount the components and solder them.

Bottom side of the Music and Lights PCB layout

Bottom side of the Music and Lights PCB layout

The bottom side mostly consists of the GND plane. I had to put a few traces on the bottom side because they didn’t fit on the top side. Also this is the first time I am incorporating a filled zone into my PCB, and I am curious what challenges this will bring when I am going to etch the actual PCB.

One advantage of having filled zones, as far as etching is concerned, is that it reduces the amount of Cu needed to etch away. Also it reduces the amount of time needed for etching. But, because there are no filled zones on the front side I don’t think it will save me significant etching time.

One potential problem with having to etch filled zone is that it increases the chance of having unintended connections due to inadequate etching, since all the pads and traces are very close to the filled zone edges. I might increase the clearance a little bit more to reduce the chance of this happening.

Also here’s a 3D view of what the board will look like once its made and populated,

3D rendition of populated Music and Lights PCB. Note that some of the custom footprints do not show up in the 3D view

3D rendition of populated Music and Lights PCB. Note that some of the custom footprints do not show up in the 3D view

So I am onto the next step, making the PCB! I will keep you posted on that as well. Stay tuned and Thanks for reading!

The first Music and Lights system

Currently I am in the process of designing the PCB layout for the Music and Lights system. I am using KiCAD for designing the layout. I want to do a really good job on the layout because as observed on the bread board prototype, this circuit is very susceptible to interference.

In the meantime, I thought I should write a blog post about the first Music and Lights system I built. Yup, that’s the one on the image at the top of this page. I called it the MSYNC.

It has two 32ohm speakers driven by classic LM386  audio amplifiers. Each speaker has 20 LEDs around them; 10 green and 10 red leds. These LEDs are driven by LM3914 led drivers. The red lights show the bass level and the green lights show the treble level of the input audio.

On the front side, there are 10 RGB LEDs showing the bass and treble levels. At maximum bass (when all 10 red LEDs are lit) a blue lights goes across the front LED bar. I will explain how it works in detail in just a bit, but first lets see it in action!

Unlike the Music and Lights system I am building right now, MSYNC is completely analog. It has no microcontrollers. Also MSYNC uses passive filters made from resistors and capacitors unlike the new system, which has active filters made from op-amps.

It is made with two double sided PCBs stacked together separated by an insulated layer (I used a sheet of plexiglass). The top PCB has the speakers, speaker amplifiers, filters and the LEDs around the speaker (see schematic below). In order to conserve space I decided to place the speakers on top of the LM3914 LED driver chips with a bit of insulation.

Schematic of the top PCB with the speakers, speaker amplifiers, filters and the LEDs around the speakers (click image for a larger view).

Schematic of the top PCB with the speakers, speaker amplifiers, filters and the LEDs around the speakers (click image for a larger view).

 

The second PCB controls the 10 RGB LEDs on the front. With the help of a LM555 timer IC, a set of shift registers poll the state of the LM3914 output pin that corresponds to maximum bass level at regular intervals. When the maximum bass is registered, the blue LED connected to the first output pin of the shift register is turned on. This value then gets shifted out of the shift register on subsequent readings, which results in a blue light moving across all ten RGBs.

The schematic below shows how the components in the second PCB are connected.

Schematic for the second PCB showing how the RGB leds are driven by the LED drivers and the shift registers (click image to see a larger view).

Schematic for the second PCB showing how the RGB leds are driven by the LED drivers and the shift registers (click image to see a larger view).

Now I could get into how I made the PCBs at home and how I assembled everything in a plexiglass box, but it would take many more blog posts to explain everything. There will surely be a post about how I make PCBs at home in the future.

Thanks for reading! If you have any questions please comment.

Music and Lights – Reducing noise

In my last post I talked about two interference noises in the speaker output. In this post I will explain my understanding of where the interference is occurring, and what I did to reduce them.

1. The low frequency interference (~25 Hz)

This noise is there whenever I have the Arduino board connected to the system. The amplitude of this noise increases significantly when the Arduino is sending data to the RGB strip or sending data over to the computer. When the Arduino board is taken out from the system the noise disappears.

The Arduino board is powered by a computer USB port. Any variation in power levels of the USB port will also affect the speaker amplifier system. To test this I removed the USB port connection and powered the Arduino board with a linear voltage regulator outputting +5V. This reduced the noise notably, but not completely.

In the Arduino board, in addition to the microcontroller there are other systems that use power even when the microcontroller is not doing anything. For example, the on board regulator and the FTDI chip that facilitates USB communication. These devices could affect how much current is flowing in the power rails leading to variations in the power rail voltages. The amplifier is very sensitive to changes in the power rail voltages.

So I decided it is better to have a stand-alone Arduino microcontroller (ATmega328p) on the breadboard. Moving the microcontroller from the Arduino board to a breadboard involves a few additional components. I found this tutorial that explains how it is done very well. Schematic below shows how I implemented the ATmega328p on my breadboard.

BreadboardArduino

How to integrate a stand-alone Arduino microcontroller in a circuit

The stand-alone breadboard microcontroller reduced the noise even further. However not completely. Then I ran into another problem; The microcontroller kept crashing at random times. Then I realized that I haven’t put any decoupling capacitors on the microcontroller power pins. Adding 10uF decoupling capacitors to the power pins stopped the microcontroller from crashing. A good lesson of the importance of decoupling capacitors in stabilizing the power to a device.

2. The high frequency interference 

This high frequency noise is present whenever the LEDs on the RGB strip are lit. The noise is proportional to the number of LEDs lit.

If this noise is entering the speaker amplifier through the input signal, then its intensity should increase when the volume of the input signal is increased. However, increasing the volume of the input signal had no noticeable effect on the noise.

After doing a bit more research into amplifier noise sources on the web, I noticed a problem with the way I have wired the components on my breadboard. On the breadboard I have the amplifier ground, signal input ground, the speaker ground, the microcontroller ground and the RGB strip ground all wired to different locations within the breadboard. They have long leads that connect them to the terminal of the power supply ground as in the diagram below. This way of wiring leads to an unstable ground rail as the voltage in different sections of this rail will be different due to different amounts of current flowing through them.

One solution to this is to use a ‘star’ grounding system as shown in the diagram below. In a ‘star’ grounding system all the ground leads from different devices in the circuit connects directly to a single point (hence the name ‘star’) close to the power supply ground connection.

StarGrounding

Improper grounding of the devices can lead to interference. A ‘star’ grounding system minimizes interference by having a single reference point to measure signals for all devices.

 

After rewiring the amplifiers, speaker and the RGB strip in a ‘star’  grounding method, the high frequency noise was greatly reduced. This method also helped to reduce the low frequency noise even further.

I am now satisfied with the Music and Lights system on the breadboard to move it to the next step, which is to design the PCB layout! Proper layout (including a large ground plane) and solid connections on a PCB should take care of the remaining interference. That will be another blog post.

Music and Lights – RGB strip driver

First of all, I made some changes to my project objectives. The music and lights system I am building will not be attached to my bicycle. This is because I don’t think it will be used that often if it is just on my bicycle. So instead I am gonna set it up on my room, so that I can make the most out of it.

So far I have build an amplifier for the speakers and a triple channel audio filter for the lights (see previous posts). The next step is to read the output values of the triple channel audio filter and drive the TM1809 RGB strip to represent those values. For this I am using an Arduino. I have several Arduino boards hanging around and they are great for when you need to write a simple program to read sensor data and do something with it. Also there is a fantastic library for Arduino called FastLED that makes driving LED strips a breeze.

So I wrote a simple program to read the output values of the triple channel filter and drive the RGB strip with the red, green and blue values representing bass, mid and treble levels.

/**
   RGBdriver.ino
   Purpose: Read three analog values and drive a TM1809 RGB strip with the red,
   green and blue levels representing the analog values. 

   @author Kasun Somaratne
   @version 1 06/07/14
 */

#include <stdio.h>
#include <FastLED.h>

#define NUM_LEDS      30
#define DATA_PIN       7
#define BASS_PIN      A0
#define MID_PIN       A1
#define TREBLE_PIN    A2

//create an array of RGB values for the number of leds on the strip.
CRGB leds[NUM_LEDS];

void setup()
{
  //Specify the led strip type and the data pin used to send data to the led strip
  FastLED.addLeds<TM1809, DATA_PIN>(leds, NUM_LEDS);

  //Initially turn all leds off
  for(int i = 0; i < sizeof(CRGB); i++)
  {
     leds[i] = CRGB(0,0,0);
  }
  FastLED.show();
}

void loop()
{
  // read the bass, mid and treble values. These values will be between 0-1023.
  int bass = analogRead(BASS_PIN);
  int mid = analogRead(MID_PIN);
  int treble = analogRead(TREBLE_PIN);

  //calculate the number of LEDs to be lit using the bass value
  int litLEDCount = map(bass, 0, 1023, 0, NUM_LEDS);

  //map the bass, mid and treble values to red, green and blue values. The rgb values can only be from 0-255
  int rVal = map(bass, 0, 1023, 0, 255);
  int gVal = map(mid, 0, 1023, 0, 255);
  int bVal = map(treble, 0, 1023, 0, 255);

  //turn off all the LEDs on the array
  FastLED.clear();
  //update the LED strip with calculated red, green and blue values
  for(int i = 0; i < litLEDCount; i++)
  {
    leds[i] = CRGB(bVal,rVal,gVal);
  }
  //display the LEDs
  FastLED.show();

  delay(50);
}

Finally, It is time to test the entire setup. Here’s a short video showing how it looks at the moment:

Not bad for the first try, right? However, it has several issues:

  1. There is a high frequency noise that seems to be proportional to how many LEDs are lit on the strip.
  2. There is a low frequency noise (~25Hz) whenever the Arduino board is connected to the system.

Next step is to identify the sources of these noises and eliminate them. But so far I am satisfied with the progress.

 

Music and Lights on a Bicycle II – The lights!

So in the previous post I explained how I set up the audio amplifier for the speakers. Next thing to take care of is the lights. I want the lights to pulse to the music with different color LEDs showing the bass and treble levels. For this purpose, I bought an RGB LED strip so I can easily control a large number of leds and have all the colors in the world! Also this is my first time working with led strips, so I am very excited to try them out.

There are many types of LED strips you can buy, and I went with the TM1809 because it was the cheapest I could find at the time ($30/meter). Also with this strip you can address the LEDs individually with just one data pin, which is really handy.

In a previous project I made a light organ, which had three frequency channels, one for the bass (~ 224 Hz), one for the treble (~ 3 kHz) and one for mid range frequencies (~ 1 kHz). It uses Multiple Feedback Active Band-pass Filters (MFAB) to select the frequencies. Unlike passive filters made from resistors, capacitors and inductors, MFAB filters have a very narrow bandwidth.

So my idea is to send the audio signal through three MFAB  filters, read the output values of the three channels from a microcontroller, and drive the LED strip with red, green and blue levels representing the frequency channel values. So the first step is to create the filters (see schematic below).

Schematic of the triple channel audio spectrum analyzer. The three filters separate the bass, treble and mid range frequencies.

After building the three filters on my breadboard, it is time to program a microcontroller to read the output voltages. I will explain this in my next post.