Electronics Design

Navigation
  1. Designing the pcb
  2. Arduino IDE
  3. Downloadfiles

Designing the pcb

Schematic

I am going to build a weather station that shows the temperature and humidity (or other additional things) on a display but also as the color of a lamp that is attached on top of the station.
With buttons I can later choose which detail I want to be shown with the lamp.

For my project I want to use the Satshakit 128.
You can find all of my used libraries in the zip files under Downloadfiles.
At the beginning it looks like this:


pcb

The assignment was to add one led connected to a digital or PWM pin, a button connected to a digital input, multiple VCCs and GND and a voltage regulator.
I started to modify the bottom LED.

pcb

I added a label on the left side to connect the pin labeled 42 with my led. You should get a pop up to connect the labels which are named the same.
You can add labels with the label button on the left side or go to draw > label.

pcb

To change the style active the right button.

pcb

For the resistor I clicked on the ADD button.

pcb

Because I wanted to use the fablab parts I had to add some libraries.
For this click on the library manager.

pcb

Go to "In Use" and click on browse to select your libraries. Afterwards you should see the added libraries.
Close the window.

pcb

Now you can add the fab resistor.

pcb

If you right click on the resistor you can change the preferences and set the value to 499.

pcb

To connect the parts use the net button.

pcb

I used the led from the fab libraries and added GND.

pcb

The button is connected to VCC and the pin 44.
You can find the button named switch in the fab library.
It is also connected to GND with a 10k resistor.

pcb

For the power I added a voltage regulator and two capacitors. The part for the regulator is named m03. These are actually female pins but we should use them as IN, GND and OUT. After soldering I can just plug the regulator in.

pcb

For now the assignment is finished.
However I am using the board for my final project. Thus I had to add a few more things.
The sensor DHT11 Humidity & Temperature Sensor uses 3 pins. VCC, GND and a pin connected to the controller. The last pin was left free which i simply added to the pins.

pcb

Make sure to remove the labels from the other pins and make your own new pin for the leftovers for example like this. You can find pins by typing m0x and the number of pins x. For example 3 pins are m03.

pcb

Same with the light.

pcb

The display Graphic LCD 12864B needs 2 VCCs, 3 GND, 3 digital pins connected to the controller and the pin 37 is to regulate the contrast.
I also added two more VCCs just for the case that I need them.

pcb

I will simply connect additional parts for example buttons later to the left pins.
This is the final schematic:

pcb
Board

We can click on board to generate the board file.

pcb

The new board will have some parts on the left connected with yellow lines.
We have to rearrange the new parts to the existing parts.
You should start to move the parts around and look for the best position.

pcb

With ripup you can delete existing red lines and on the left with route you can draw new red lines.

pcb

My board looks like this now:

pcb

But as you can see there can be a lot optimised.
First we can use a ground layer to get rid of the ground traces.
To add a layer use the polygon tool (draw > polygon) and draw around the board. Type GND in the pop up.
If you connect the border right it will appear dotted.

pcb

Right click on the border and go to properties.
I used a 20 mil isolate to have an offset around my traces.

pcb

Go to tools and recalculate the lines. You will see that the lines have an offset and our whole board is GND now.
Every time you change something on the board you have to recalculate the lines.
You can see that I also rearranged my board to this final state.

pcb

Next step is to generate the files for the milling machine and mill the pcb.
Follow the last assignment Electronics Production to generate the files.
My outside file had actually a too little offset so I changed the tool diameter to 0.5 mm in the fabmodules.

Here is my final result after soldering. You can find a partslist in the zip file under Downloadfiles.
Under export you can export the whole partslist or the added libraries.

pcb

Arduino IDE

To program the controller I followed the tutorial from the Satshakit-128.

  1. Download the zip file in Downloadfiles
  2. Close Arduino IDE before doing anything
  3. Copy the folder named mighty-1284p inside the Arduino IDE hardware folder, arduino-1.6.x/hardware/ in Linux, Documents/Arduino/hardware in MacOS
  4. Open the Arduino IDE again
  5. Select avr-developers.com pinouts 16MHz using Optiboot board

This is the setup you should have for the Arduino to use it as ISP.
Upload the code from: Examples > 11. ArduinoISP > ArdunioISP

pcb


For the Controller use these settings and burn the bootloader.

pcb


After that open the blink example.
I modified the code to this:

                    
    /*
    Blink

    Turns an LED on for one second, then off for one second, repeatedly.

    Most Arduinos have an on-board LED you can control. On the UNO, MEGA and ZERO
    it is attached to digital pin 13, on MKR1000 on pin 6. LED_BUILTIN is set to
    the correct LED pin independent of which board is used.
    If you want to know what pin the on-board LED is connected to on your Arduino
    model, check the Technical Specs of your board at:
    https://www.arduino.cc/en/Main/Products

    modified 8 May 2014
    by Scott Fitzgerald
    modified 2 Sep 2016
    by Arturo Guadalupi
    modified 8 Sep 2016
    by Colby Newman

    This example code is in the public domain.

    http://www.arduino.cc/en/Tutorial/Blink
    */

    // the setup function runs once when you press reset or power the board
    void setup() {
        // initialize digital pin LED_BUILTIN as an output.
        pinMode(11, OUTPUT);
        pinMode(PB2, OUTPUT);
    }

    // the loop function runs over and over again forever
    void loop() {
        digitalWrite(11, HIGH);  
        digitalWrite(PB2, HIGH); // turn the LED on (HIGH is the voltage level)
        delay(1000);                       // wait for a second
        digitalWrite(11, LOW); 
        digitalWrite(PB2, LOW);// turn the LED off by making the voltage LOW
        delay(1000);                       // wait for a second
    }
                    
                

To find your pin number you have to google for an 1284p arduino pinout.
One led is connected to the number 42 which is also named PB2.
The other one cannot be read from the arduino so I had to look into the 1284p arduino pinout.
The number 12 is named 11.

The upload was successful and both LEDs blink.

pcb pcb


Downloadfiles

  1. project6.zip