Learning outcomes:


  1. Demonstrate workflows used in controlling an output device(s) with MCU board you have designed

Stages:


  1. Decide the output device i gonna use
  2. Program it
  3. Test it





Output device i've used:

Speaker jack: It's was my best option to make a voices output where it's make me capable to use any type of speaker, Handfree or any other wired sound output device (but handfree was the best in quality)


In the first the SMD speaker jack was the best option(it was available in the academy inventory components and it's SMD component) but unfortunately it's not suitable for most of speakers plugs (its open was very small to the plug get in).


But I've used an ulternative Audio jack 3.5mm

Data sheet review




MCU design

In the early beginning of this assignment I memorized the experience from the last assignment of EAGLE software. I used it as it was helpful, suitable, time-saving, and easy to use software.


In this phase I designed the microcontroller board in the flow of:

  1. Search and build a background
  2. Collect needed data to assure good design
  3. Select appropriate design among different ones
  4. Put the components in the schematic mode in EAGLE software
  5. Connect them in a rough outline in the same schematic view
  6. Check overall connection and design
  7. Go to board view to check the paths and PCB design
  8. Adjust and develop the full board design with the traces and connecting nodes
  9. Test the wellness of connections using error tool(DRC/ERC)

  10. Firstly, I was learning some basics and advanced concepts in eagle to be able to design the needed circuit on it before implementation





    I chose to made my final project circuit in this assignment, So that what you gonna find here in the end,

    The output is a voice

    .



From "Add part" open the list of components(little arrow beside the botton opens the recent components opened), Also you can search for a specific component(But make sure iy's the exact name in the list if not won't appear in search results.


Select "Net" to start connect the components togather"


Add more, Connect more and make sure from pollarity for each part (resistor dosen't has polarity but other components have, So stay focus on this)


After finishing your circuit connections, check by looking for all connection, Polarity (as we said before) and make sure nothing forgotten, Then let's move to another view from this up left botton from Schematic view to Board view.


Usually you will find a very messay order for the components, So organize them as much you can based on the connections between components and your general vission for the final result.


For example here in organizing i've put the resistor and capasitor which connected to microcontroller besid the pins will connect, the jack plug and poer plug in the edge of the circuit.


Then select the width of paths i will connect the components with, from 6mill to more than 100 mill( based on the size of the whole circuit, Components size and the cutting tool you can use in the fabrication


"route airwirw" botton use it to draw the connections as you want, or use Auto routing(but from my humble experience in this and some recommendations from my colleages, Auto routing isn't good enogh to get you the best result you need)


I can tell you a small tips for routing but i see it's very important:Start with connecting everything connected except VCC and ground, Leave then to the end beacuse they made alot of confusion in connections if you started with


Now lets test the paths if it will work will or we need to adjust anything of route or the width.


Set the width you use, Tool width you will use, Then let's test.


Be careful from overlapped paths


Open layers management list, Hide and appear layers to get the result of only traces and nodes appear, Then press OK.
Emporting the circuit picture to implement


Make monochromatic(black&white), 500dpi and window to capture only the window view you open


Final result, Now the impletation software can see the traces and nodes to fabricate.

  • PNG image

  • Schematics eagle file

  • Board eagle file


  • You can find the Fabrication, soldering and programming processes here to get the design alive here
    Fabricated board, With components to solder


    After soldering, Let's test


    Get an Arduino and connect it with the board, VCC connected to 5V and GND connected to GND.

    Slave reset: 10
    MOSI: 11
    MISO: 12
    SCK: 13



    Connect 10uf capacitor to reset and GND to prevent the arduino from resetting after burnining the code(find the full details in the tutorial above)

    Prepare my own board by burn on it the bootloader to be ready for programming




    Importatnt:Make this step when you open a new and empty window of Arduino

    Uploaded Arduino ISP code on the Arduino board to make it a programmer.





    Then I've uploaded my code on board


    #include 
    #include 
    #include 
    
    #include "SD.h"
    #define SD_ChipSelectPin 4
    #include "TMRpcm.h"
    #include "SPI.h"
    #define trigpin 7
    #define trigopin 8
    
    TMRpcm tmrpcm;
    
    void setup(){
      pinMode (trigpin,INPUT_PULLUP);
      pinMode (trigopin,INPUT_PULLUP);
    tmrpcm.speakerPin = 9;
    Serial.begin(9600);
    if (!SD.begin(SD_ChipSelectPin)) {
    Serial.println("SD fail");
    return;
    }
    
    
    }
    int flag=0;
    int flag1=0;
    
    void loop(){ 
      int sp;
      int sp1;
      sp=digitalRead(trigpin);
        sp1=digitalRead(trigopin);
          if (sp==LOW&&flag==0) {
         tmrpcm.setVolume(5);
    tmrpcm.play("diags.wav");    
    delay (5000);
    flag=1;
      }
      else if (sp1==LOW&&flag1==0) {
         tmrpcm.setVolume(5);
    tmrpcm.play("Africa.wav");
    delay (5000);
    flag1=1;
      }
      else if (sp==HIGH&&sp1==HIGH){
        flag=0;
        flag1=0;
        delay (500);
        }
      
      }


    Now lets test and listen to the output



    Arduino code source






    Done

    1. Make the G-code for modella.
    2. Implement and operate on MDX40 and SRM20.
    3. Soldering.

    New Learned

    1. What's electronics components.
    2. How to export a G-code for PCB milling.
    3. Difference between SRM-20 and MDX40 in the operation.
    4. Soldering methods for SMD components.

    Enjoyed with

    1. Trials on machines.
    2. Soldering SMD components.
    3. Finishing my first SMD complex PCB.