Skip to content

MANE 3351

Lecture 3

Classroom Management

Agenda

  • GitHub Classroom Setup
  • GitHub Account Creation
  • Raspberry Pi Programming
  • Circuits
  • Laboratory Session will meet today

Resources

Handouts


Assignments

  • Link personal GitHub account with GitHub Classroom

Linking GitHub Account

  • Must be done once per semester
  • Click on the Lab Links Content Area


Homework 0

  • Click on the Homework 0 web link


GitHub Classroom

  • A GitHub Classroom screen will appear allowing you to join the classroom
  • Your GitHub classroom identifier is your UTRGV email account name
  • Select your email address from the list
  • Dr. Timmer created mane3351f24@gmail.com as his user account


Accept the Assignment

  • A screen will appear asking you to accept the assignment
  • Click on Accept this assignment


Acceptance Confirmation

  • After accepting the assignment, the following screen will appear
  • Eventually, a link will be provided to the repository created using GitHub Classroom
  • For Homework 0, this completes the assignment
    • In future assignments, you will have to clone the repository to your local computer and complete the assignment
    • The purpose of Homework 0 is to link your GitHub account to GitHub classroom and your UTRGV email address


GitHub Authorization

  • Once the link is clicked, you will be asked to sign up for GitHub or verify your GitHub account if you have already logged into email on your computer (my case)

    • If you have not created a GitHub account, do so before proceeding. Notes are provided below.
    • It is recommended to use your UTRGV email but not required
    • Additional notes for creating GitHub account is provided after GitHub Classroom notes


Email Confirmation

  • You will receive an email confirmation that contains a link to the repository to be downloaded


GitHub Account Creation

  • Click on Sign up to create a new account


Email Entry

  • Enter your email address (preferably UTRGV) and click continue
  • For this example, I am using a Gmail account I created for the course


GitHub Account Password

  • You will be asked to create a strong password
  • Click Continue when done


GitHub Username

  • Create a username that is available
  • Your username will be incorporated into the repository name along with the assignment name


GitHub Email Preferences

  • you will be provided an opportunity to sign-up to receive occasional product updates and announcement.
  • Signing up for email updates is optional
  • No screen capture is provided of this step

GitHub Verify Account

  • You will be prompted to verify your account by solving a puzzle
  • After verifying, a code will be sent to your email account that is needed


What is a Circuit?

  • A circuit is a loop through which current can flow
  • A power source, such as a battery, provides the energy for the circuit to work
  • Electrons flow from the negative side of the power source, through the circuit and back to the positive slide of the power source
  • Once the electrons return to the power source, the circuit is complete
  • View example at web site

Source


Components of a Circuit

Circuits consist of three parts:

  • Voltage Source: this provides the electrons that flow through the circuit in order to power it. Common voltage sources are batteries and electrical connections such as outlets,
  • Load: this consumes the power created by the voltage source. Loads are what make a circuit light up, make noise, run a program and more. In simple circuits, the load may be a single light bulb, but in more complex circuits, the load may be made up of a combination of resistors, capacitors, light bulbs, buzzers and more,
  • Conductive Path: this is the route the current follows through the circuit. It must be made of conductive materials in order to allow electricity to flow. The path starts at the voltage source, travels through the load and returns to the voltage source. In order to create a closed circuit, this path must form a loop

An open circuit is one in which there is an interruption in the loop. The term "open circuit" is an oxymoron since the very definition of a circuit requires a closed loop.

Source


Short Circuits

  • When the conductive path of a circuit connects directly from one end of the voltage source to the other without first powering a load, the result is a short circuit
  • Current flows everywhere it can, and if it can find a shorter path, it will take it. This is why conductive wires are coated in an insulator - to prevent accidental short-circuiting through wires touching.
  • Short circuits can be very dangerous and cause wires to burn up, damage the power supply, drain the battery, start a fire and more. Most of the time your power supply will have some sort of safety mechanism built into it to limit the maximum current in the event of a short circuit, but not always. This is the reason all homes and buildings have circuit breakers, to prevent fires from starting in the event of a short circuit somewhere in the wiring. If you notice a part of your circuit suddenly becoming hot or a part suddenly burns out, immediately turn off the power and look for possible short circuits
  • It is important to note that current does not limit itself to choosing just one path, it will take every available path it can find. Which means that even if a short circuit is present, a small amount of power may still be supplied to your load

Source


Breadboard

  • A breadboard is a rectangular plastic board with a bunch of tiny holes in it
  • These holes let you easily insert electronic components to prototype
  • See illustration below

Breadboard

Source


Breadboard Columns

Columns

Source


Breadboard Rows

Rows Source


Breadboard Demonstration

  • Simple circuit: LED

Ohm's Law

Defines the relationship between three quantities: voltage (V), current (I) and resistance (R)

\[ V=IR \]
\[ I=\frac{V}{R} \]
\[ R=\frac{V}{I} \]

Units

  • Voltage measured in volts
  • Resistance is measured in ohms
  • Current is measured in amperage

Resistor Color Codes

Resistor Color Codes

Source


Breadboard Demonstration 2

  • What happens when we change resistors in the circuit?
  • Does your observation agree with Ohm's Law?

Raspberry Pi GPIO Pins

  • GPIO pins are digital: on or off
  • GPIO pins can receive (input) current or send (output) current
  • Operating voltage of the GPIO pins is 3.3 V
  • Used for low current applications, not powering motor
  • GPIO pins are programmable using Python, JavaScript, non-RED, etc.
  • Other types of pins will not be considered

Source


Raspberry Pi Pin Assignments

GPIO2


Blinking an LED Demonstration

Blink


Blinking an LED Code

import RPi.GPIO as GPIO
import time

GPIO.setwarnings(False)
GPIO.setmode(GPIO.BCM)
GPIO.setup(18, GPIO.OUT)

while True:
  GPIO.output(18,True)
  time.sleep(1)
  GPIO.output(18,False)
  time.sleep(1)

Raspberry Pi Demonstration

  1. Circuit construction
  2. Connecting circuit to Raspberry Pi
  3. Python programming
  4. Blinking an LED demonstration
  5. Can anyone identify the unused connector in the circuit?

Raspberry Pi demonstrations will be recorded using a HD Video Capture box typically used for recording computer games.