Week 6: ELECTRONICS DESIGN

Card image cap

Group Assignment

  • Use the test equipment in your lab to observe the operation of a microcontroller circuit board

Individual Assignment

  • Design a development board to interact and communicate with an embedded microcontroller
  • Extra-credit:Try another design workflow
  • Extra-credit:Make a case for it
  • Extra-credit:Simulate its operation

The group Assignment about use of testing equipments into our labs can found to fablab rwanda website . i personaly was familiar with test equipments from multimeter , oscilloscope ,function generator and many more. but this was good for my classmates who are not familliar with those equipment and i helped a lot with the testing

Make a development board and make it communicate

To design my circuit as indicated in the image bellow, i have used kicad which is free pcd tool that anyone can use. it is available for windows,mac and linux users . download it and install it

image_missing
This my final circuit after drawing

The following ar stpes to undergo while creating schematic and pcb in kicad

Step Description
Step 1 Open KiCad and create a new project
Step 2 Create a new schematic file within the project
Step 3 Add components to the schematic by selecting them from the library and placing them on the schematic
Step 4 Connect the components by drawing wires between them
Step 5 Add any necessary labels or annotations to the schematic
Step 6 Generate a netlist from the schematic
Step 7 Create a new PCB file within the project
Step 8 Import the netlist into the PCB file
Step 9 Assign footprints to the components in the PCB file
Step 10 Arrange the components on the PCB, ensuring that there is enough space for the traces to connect them
Step 11 Route the traces between the components, using the autorouting tool or manually routing them
Step 12 Add any necessary labels or annotations to the PCB
Step 13 Check for errors and correct them as needed
Step 14 Generate manufacturing files, including gerber files and drill files
Step 15 Send the manufacturing files to a PCB manufacturer to produce the physical PCB
image_missing
This is kicad opening interface. Open kicad and select new Project and select the folder where you want to be your workplace. the folder you create holds all your kicad files including backups. Create a project file . in my case the file is called power_supply
image_missing
After creating file , open kickad schematic where you start to sketch your circuit
image_missing
The area named 1 is schematic area where you put your schematic. you have to click on op-amp symbol named 2 to load schematic libraries
image_missing
This is schematic libraries where you select every schematic symbol that is needed in your circuit
image_missing
This my final circuit after drawing
image_missing
My scheamtic has 4 distict parts . The part named 1 is Attiny45V MCU. The part number 2 is the connector for AVR programmer to because used while flashing the MCU. .The part number 3 is the output LED and the part number 4 is input push button
image_missing
My final pcb after arranging components and making copper traces to join all components as the circuit indicates
image_missing
Filling all zones to Ground (GND)
image_missing
PCB 3D MODEL LAYOUTS
image_missing
Saving image as SVG format to be processed for milling machine
image_missing
Here we export front layer and we set it in black and white including board edges
image_missing
This is the exported SVG image opened in web browser
image_missing
For the svg image processing in order to trace milling traces with roland milling machine, we use the tool provided by MIT which is a web based serivice where we import svg and do further processing. we just go https://mods.cba.mit.edu/. Right click as shown above
image_missing
Select programs
image_missing
Select server programs
image_missing
Locate where ther is SRM-20 ROLAND MILLING MACHINES if it is the ones you have in your lab . click on PCB SVG
image_missing
This is the interface you get where you set all parameters needed for having final file to be used by the roland cnc machine to mke traces on your PCB
image_missing
Right click in the area under the node called ROLAND SRM-20 miiling AND Select modules>server_modules> and click on save under file Menu
image_missing
Join output file node named 1 and file input node named 2 and remember to set the origin of the milling machines to zero on all axes(x,y,z)
image_missing
Click on select SVG button and locate where your svg image is saved and import it
image_missing
set DPI to 1000 (1) in order to get maximum image resolution and invert the image (2) as indicated . Select mill traces on (3). set the tool diameter (4) according to what you have and set offeset number (5) to any number that you want your CNC To repeat tracing
image_missing
Inverted image. i want cnc machine to trace on back area not white area
image_missing
Tracing path generated to be followed by milling machine
image_missing
This is the rml file to be used by rolland srm-20 while tracing paths

Circuit Simulation

to simulate the working case of my circuit made with attiny45 with a push button and an LED , i have used an online tool called wokwi.com

Wokwi is an online platform that provides a virtual environment for designing, testing, and sharing electronics projects.

On Wokwi, users can design and simulate electronic circuits using a web-based schematic editor and a simulation tool that can simulate the behavior of the circuit in real-time. The platform supports a wide range of popular components and microcontrollers, such as Arduino, Raspberry Pi, ESP32, and more.

In addition to designing and simulating circuits, Wokwi also provides tools for sharing and collaborating on projects. Users can share their circuits with others by generating a unique link, embedding the circuit in a website, or exporting the design files for use in other software.

Wokwi only have attiny85 and it works the same as attiny45 that i have used in my circuit.

The following video illustrates the circuit simulation in wokwi

PCB Milling with Roland SRM-20 Milling machine

image_missing
roland srm-20 miiling machine

The Roland SRM-20 is a milling machine that is commonly used in Fablabs for PCB (printed circuit board) fabrication. It is a 3-axis milling machine that is capable of milling a variety of materials, including plastics, wood, and metals. The SRM-20 is known for its accuracy and precision, making it a popular choice for prototyping and small-scale production runs.

The SRM-20 is known for its ease of use and reliability, making it a popular choice for Fablabs and other makerspaces. It is also relatively affordable compared to other milling machines on the market, making it accessible to a wider range of users.

To use the SRM-20 for PCB fabrication, the following steps are typically followed:

  1. Design the PCB layout using a software program such as Eagle, KiCAD, or Altium.
  2. Export the design file as a Gerber file, which contains the necessary information for the milling machine to create the PCB.
  3. Open the Roland SRM-20 milling machine and turn it on.
  4. Insert the material to be milled into the machine and secure it in place.
  5. Load the Gerber file into the milling software that comes with the machine.
  6. Set the milling parameters, such as milling depth and speed.
  7. Start the milling process.
  8. Once the milling is complete, remove the PCB from the machine and inspect it for any defects.
image_missing
Placing PCB in Roland SRM-20
image_missing
Control software for SRM-20. Setting axis and uploading G-codes
image_missing
Printed PCB before cleaning with sand paper
image_missing
Printed PCB After Cleaning with sand paper
image_missing
Soldering components on pcb
image_missing
final soldered board

Burning a bootloader and program the Attiny45

After soldering, the next step was to make sure that the attiny45 runs correctly. we must load a biitloader first before running the first sketch

A bootloader is a small program that is used to load or initialize the main program or firmware of a microcontroller unit (MCU) or other electronic devices. The bootloader program is typically stored in a non-volatile memory, such as flash memory, of the MCU and it is executed when the device is powered on or reset. The main function of the bootloader is to prepare the MCU for the execution of the main program by initializing the required hardware resources and loading the main program into the appropriate memory locations.

strongHere are the steps to burn bootloader in Attiny45 MCU using Arduino as ISP:

  1. Prepare the Arduino as ISP:
    • Connect your Arduino to your computer using a USB cable.
    • Open the Arduino IDE and go to File > Examples > 11.ArduinoISP > ArduinoISP.
    • Upload the sketch to your Arduino.
    • image_missing
  2. Wire the Attiny45 to the Arduino:
    • Connect the Attiny45 to the Arduino as follows:
    • Attiny45 pin 1 to Arduino pin 10
    • Attiny45 pin 4 to Arduino GND
    • Attiny45 pin 5 to Arduino pin 11
    • Attiny45 pin 6 to Arduino pin 12
    • Attiny45 pin 7 to Arduino pin 13
    • image_missing
      image credit to Intructables
  3. Set up the Arduino IDE for Attiny45:
    • Open the Arduino IDE and go to File > Preferences.
    • In the Additional Boards Manager URLs field, enter the following URL:
      • https://raw.githubusercontent.com/damellis/attiny/ide-1.6.x-boards-manager/package_damellis_attiny_index.json
    • Click OK.
    • Go to Tools > Board > Boards Manager.
    • Search for "attiny" and install "ATTinyCore by SpenceKonde".
    • Go to Tools > Board and select "ATtiny25/45/85".
    • Go to Tools > Clock and select "Internal 8 MHz".
    • Go to Tools > Programmer and select "Arduino as ISP".
  4. Burn the bootloader:
    • Go to Tools > Burn Bootloader
    • The IDE will start uploading the bootloader to the Attiny45 using the Arduino as ISP. This may take a few minutes.
    • Once the bootloader has been uploaded, you will see a message in the IDE confirming the success of the process.
  5. Test the Attiny45:
    • Disconnect the Attiny45 from the Arduino.
    • Wire up the Attiny45 to your circuit as needed.
    • Upload your sketch to the Attiny45 as you would with any other Arduino board.
    • Your Attiny45 is now ready to use!
    • image_missing
      blink sketch. edit the sketch to use digital pin number 3 as output instead of LED_BUILTIN
            
    int ledPin =3; //Pin 3
    //int ledpin =0; //Pin 5
    
    void setup() {
    pinMode(ledPin, OUTPUT);
    }
    
    void loop() {
    digitalWrite(ledPin, HIGH);
    delay(500);
    digitalWrite(ledPin, LOW);
    delay(500);
    }
            
           
image_missing
Blinkinkg an LED

This video shows LED blinking