Learn   /   Beginner Tutorials

Mädchen Machen Technik

Entdecke die Welt der Technik mit 'Mädchen Machen Technik'. Erlebe spannende Projekte und gestalte die Zukunft der Technologie!

Published
Updated

At a glance

CategoryBeginner Tutorials
IncludesDownload files
Reading time~3 min

The "Mädchen Machen Technik" workshop is designed to give high school students an introduction to microcontrollers. The students will build a flashing light pattern and/or a counter-timer. In the process of building this project, the students will learn about microcontrollers and digital electronics. Here is the parts list for the projects.

Introduction to some circuit elements

  1. The students will learn how to measure DC voltage and resistance using a multi-meter. They will measure the voltage of batteries connected in series and in parallel.
  2. The students are given the task to determine, using a voltmeter and wires, how the holes on a breadboard are connected. The students sketch the hole connections on a picture of the breadboard.
  3. Next, the students will be given several Light Emitting Diodes (LEDs), with an explanation on how they work. They are to connect the LED(s) to the breadboard so that one LED lights up, then two light up, etc. Do not put more than 3 Volts across an LED.

Blinking Lights ProjectAs a first project on the breadboard, we will program the microcontroller to produce a blinking pattern of up to five LED's. We will start with one of the simplest microcontrollers: PIC12F629. First, we build the circuit on the breadboard, then we will program the PIC12F629 chip.

Building the Circuit

  1. A schematic of the circuit is shown below:
  2. The PIC12F629 has only 8 pins. Pin 8 is the ground pin, and Pin 1 is the positive voltage pin. In our applications, we will use two AA batteries in series which will give around 3 volts for Pin 1.
  3. The other six pins (2-7) will be used as digital input/output. Pins 2, 3, 5, 6, and 7 will be output pins connected to LEDs. Pin 4 can only be set as an input pin. We will not connect an LED to pin 4. In the picture below, one can see the 5 LEDs connected to the appropriate pins.

Building the ProgrammerAfter setting up the "blinking lights project" on the breadboard, we program the chip. To program the microcontroller, we will need to constuct a programmer circuit on a bread board. Each group of three students will use the same programmer, a pickit2. The programmer circuit is shown below

PicP1

The programmer has 6 pins in a row. The ground on the programmer, pin 3, is connected to the ground of the chip (pin 8). The voltage (5V) of the programmer, pin 2, is connected to pin 1 of the chip. The other programmer pins are connected to the chip.

The pickit2 is connected to a personal computer through a usb port. In the picture below, one can see where the microcontroller chip is connected in the programmer:

Finally, we program the microcontroller using the MPlab software from microchip.

Programming the Microcontroller

  1. The assembly code we will start with is the code: test12.asm. The only lines of the code the students need to modify for their desired blinking pattern are:loop
    movlw b'00100101'
    movwf GPIO
    call delay1
    movlw b'00010010'
    movwf GPIO
    call delay1
    goto loopFirst, the binary number '00100101' is placed in the working register. Then this number in the working register is transfered into the register GPIO. The GPIO register is directly connected to the pins of the chip. A "1" will put 3 volts on a pin, and a "0" will put zero volts on the pin. The last 6 bits are connected to pins 2, 3, 4, 5, 6, and 7 respecively. The number '00100101' in register GPIO will result in 3 volts for pins 2, 5, and 7, and zero volts for pins 3 and 6. Pin 4 is not affected, it is only an input pin. The subroutine delay1 causes a delay of around 1/4 second.Then, the binary number '00010010' is placed in the working register and then transfered to the GPIO register. The number '00010010' will produce 3 volts on pins 3 and 6, and zero volts for pins 2, 5, and 7. After a delay of 1/4 second, the chip goes back to "loop" and repeats the pattern.
  2. The students can program any pattern of the five LED lights by modifying the lines in the loop.

Read More:   Mädchen Machen Technik

Beginner Tutorials · PIC16F877A

PIC16F877 Driving LCD in 4-Bit Mode using PIC16F877 with Proteus Simulation

Introduction This microcontroller project shows how a PIC16F877 can drive an LCD display using 4-bit mode inside a Proteus simulation.The project demonstrates...

Beginner Tutorials · PIC18F4550

PICDEM FS USB CDC Evaluation Board using PIC18F4550 with Proteus Simulation

Introduction The PICDEM FS USB CDC Evaluation Board is a practical microcontroller project built around the PIC18F4550, designed to demonstrate USB communication...

Beginner Tutorials

PIC12CE518 I2C EEPROM using PIC12CE518 with Proteus Simulation

Introduction This microcontroller project demonstrates how to write and read data using the internal I2C EEPROM of the PIC12CE518 and visualize the...

Beginner Tutorials

Pico Timer Project using Pico with Proteus Simulation

Introduction Timers are one of the most important features in embedded systems because they allow microcontrollers to perform tasks at precise intervals...

Beginner Tutorials · PIC16F84A

PIC Stepper Motor Controller using PIC16F84A with Proteus Simulation

Introduction Stepper motors are widely used in embedded systems and DIY electronics projects where precise position control is required. This PIC Stepper...

Beginner Tutorials

What is a TVS diode? Working principle and parameters of TVS diode

TVS (Transient Voltage Suppressor) diode is a component specially used for protecting circuits. It can absorb excessive voltage pulses in an instant...

Ibrar Ayyub

Ibrar Ayyub

I am an experienced technical writer holding a Master's degree in computer science from BZU Multan, Pakistan University. With a background spanning various industries, particularly in home automation and engineering, I have honed my skills in crafting clear and concise content. Proficient in leveraging infographics and diagrams, I strive to simplify complex concepts for readers. My strength lies in thorough...