Electronics & programming

Introduction to electronics

Crash Course!

Voltage (potential difference) is the electrical potential between 2 points, measured in Volts.

  • When measuring voltage in a electrical component, a multimeter must be connected parallel to it.
  • Voltage is related to Kirchhoff’s second law, which states that the sum of all voltages around any closed loop in a circuit must equal zero.

Current is the rate of flow of electrical charge at a point, measured in Ampere.

  • When measuring current in a circuit, the multimeter must be connected in series to the circuit.
  • Current is related to Kirchhoff’s first law, which states that at a junction in an electrical circuit, the sum of currents flowing into the junction is equal to the sum of currents flowing out of the junction.

Resistance is the measure of the opposition to current flow in an electrical circuit, measured in Ohms.

  • Calculate resistance in a circuit:
    Series connection: RT = R1 + R2 + Rn
    Parallel connection: 1/RT = 1/R1 + 1/R2 + 1/Rn

Ohm's law.

Voltage(V) = Current(I) * Resistance (R)

Ohm's law equation is useful in determining the appropriate resistor value to use to prevent damage to electrical components.




Alligator clip wires.

We made double ended alligator clip wires in order to provide a power source to our test board. It also serves as soldering practice.

We are provided with a meter of multicore 2 way cable. We split the ends and use a wire stripper to expose a bit of the wires.

Red wire stripped, black not stripped yet.

Next is wire tinning. This will hold the thin strands together and make it easier to connect the wire to other connectors. We prepare the wire for soldering by dipping it in flux, then using a soldering iron, melt a blob of solder onto the iron tip and spread it along the exposed wire.

First tinned the red wire, after which I cut a bit of the end off before repeating on the black wire.

Next is connecting the alligator clips. I first remove the rubber cover and slip it through the cable, making sure the colours match with the cables. I also sand the hole on the clip with sandpaper to prepare for soldering.

I then slip the bare wire into the hole of the alligator clip, and using pliers bend the back onto the cable to secure it to the clips. I then bend the cable flat and added some flux and solder the holes.

I also noticed the black clip is smaller than the red clip, So I double checked the rubber cover can fit the clip before soldering.

After this is just simply placing the cover over. I did this by using another clip to keep the mouth open so the cover can be slid in.

I then solder the other end with another pair of clips.



555 Timer

In this project we design a Astable 555 timer circuit, which will cause an LED to blink.

For this we will follow this circuit design.

We can design our circuit virtually with ThinkerCAD, to ensure everything works before creating it physically.

After designing on ThinkerCAD I redid the circuit, this time on a physical breadboard.

Once tested on the breadboard I can now transfer and solder the circuit to a stripboard.

Arduino Programming

Arduino is an open-source electronics platform based on easy-to-use hardware and software. Its affordability and easy to use system makes it ideal when implementing embedded systems into projects.

For the embedded programming assignments, we use an Arduino Uno to interface several I/O (Input and output) devices.

Output devices

Output devices, also known as actuators are components that move, control or display information. The behavior of output devices are determined by input devices.

Actuators can create movement with Stepper motors, servo motors and DC motors. Actuators that requires to display information can be LED displays, LCD displays and other light output devices. Actuators requiring control can be Relays and transistor drivers to drive high power circuits.

Servo motor control knob

I interface a potentiometer to control the rotation of a positional servo motor.

The connection is simple: Potentiometer is connected to pin A0 and Servo motor connected to analog pin 9.

Program:

#include <Servo.h>

Servo servo1;  

int potpin = 0;  
int val;    

void setup() {
  servo1.attach(9);  
}

void loop() {
  val = analogRead(potpin);            // reads the value of the potentiometer (value between 0 and 1023)
  val = map(val, 0, 1023, 0, 180);     // scale it to use it with the servo (value between 0 and 180)
  servo1.write(val);                  // sets the servo position according to the scaled value
  delay(15);                           // waits for the servo to get there
}