SlideShare ist ein Scribd-Unternehmen logo
1 von 26
PHYSICAL PROTOTYPING
© 2011 K3 Creative Commons v3.0 SA-NC
Lab 6: Motors
With the Arduino prototyping board
millis()
• millis(); returns the number of milliseconds the
arduino has been on
• Useful when you want two things to happen at once
”semi threading”
• Returns a long
• Examples/Digital
/Blinkwithoutdelay
Made by: David Sjunnesson
micro()

Returns the number of microseconds since the
Arduino board began running the current
program

Returns a long

Works the same way as millis()
Random
• random(min, max)
• Returns a pseudorandom number
between min and max.
• random(10,50) returns a number
between 10-49
• randomSeed();
• randomSeed(analogRead(4)); Gives you
a better random value
Try it out
• Create a program that randomly in time sends a
random value to the computer.
map()

Re-maps a number from one range to another

Useful when a sensor sends one range of
values but you need it in another.

map(value, fromLow, fromHigh, toLow, toHigh)
constrain()

Constrains a number to be within a range.

Helps to make sure a value is in a certain range

constrain(value, minimum, maximum)
Try it out!

Create a program that maps your value from a
potentometer from the read range into another
and sends it back to the computer.
MOTOR
• Actuator that transforms electricity into movement
• Motors can be of different kinds: DC, stepper, servos, etc. Each type has a different
way of being driven
• New motors can be very expensive. In many cases we will not be interested in high
accuracy and precission, just in showing the basic functionality
• It is in those cases when dismounting some kind of motor-driven device will be
useful to acquire the basic components for our design
• Car-toys, electric razors, printers, CD-drives, old hard drives, cash registers, and
many devices contain motors that we should be able of using
TYPES OF MOTORS
• There are three main types of motors
– DC motors: they are used in toys and devices that do not need high degrees of
accuracy in terms of speed or angle. With certain circuits that can be improved
– Stepper motors: they can move to a very precise position. We find them in
printers, scanners, etc
– Servo motors will move and stop at a certain angle on request. They are used in
car models to control the direction, model-planes for the flaps, etc
TYPES OF MOTORS
• DC motors:
– run freely
– hard to control their position/speed
– can use as less as 2,5Volts
– speed can be controlled using PWM
– we use relays, transistors or H-bridges to control them from Arduino
– with encoding circuits can become very precise
DC MOTORS: PWM
• PWM stands for Pulse Width Modulation. Microprocessors cannot produce pure
analog signals, nor can they provide enough current to drive motors
• Through calculating the average value of a sequence of pulses, microprocessors
emulate the generation of analog signals
• It is with PWM that we can change the speed of a DC motor. It is anyway needed
the use of a transistor, since the pins on Arduino cannot handle the amount of
current to move the motor
PICTURES © their authors
STEPPER MOTORS
• Stepper motors:
– 2 types: unipolar or bipolar
– rotate a certain amount of degrees at each pulse
– typical values of angles are 1,8 - 3,6 - 7,2 ...
– we use transistors, transistor chips, and H-bridges to control them
– they have 4 or more wires
– RepRap
STEPPER MOTORS
SERVO
• they will rotate to a certain angle depending on a PWM value we push into them
• recently there are continuous rotation servos
• broadly used in robotics
SERVO/Continuous
• Connect the servo to the arduino
• Black ----> Arduino ground
• Red -----> Arduino 5v+
• White ----> Arduino motorPin
• Make it move Clockwise or Counter-clockwise
depending on the values read from a potentiometer
• Usefull functions is map()
SERVO/Standard
• Connect the servo to the arduino
• Black ----> Arduino ground
• Red -----> Arduino 5v+
• White ----> Arduino motorPin
• Make it move to a specified angle depending on the
values read from a analog input
• Usefull functions is map()
Power

Battery packs

Rechargables

Ampere * Volt = Watt

Biltema
Transistor
• The transistor is considered by many to be the
greatest invention of the twentieth century. It is
the key active component in practically all
modern electronics.
Transistor
• A transistor is a semiconductor device,
commonly used to amplify or switch electronic
signals. The transistor is the fundamental
building block of computers, cellular phones,
and all other modern electronic devices.
Transistor
• We use transistors for:
– turning DC devices on/off: motors, lamps, etc
– dimming DC lights
– changing the speed of motors seamlessly (using
PWM)
How to hook up a motor
using IRF Z24
Copyright Kajsa Sahlström and Matilda Marcelius
How to hook up a motor
using BC547
DANGER!
Relay
• A relay is an electrical switch that opens and closes under the
control of another electrical circuit
• Makes it possible to control big stuff with Arduino
• Control up to 220V with 5v from Arduino
• Cant control speed...
Hook it UP!

Connect a DC motor and control the speed with
a analog sensor

Create a gaspedal!

Weitere ähnliche Inhalte

Was ist angesagt?

Using Ready-for-PIC and SDR Libraries
Using Ready-for-PIC and SDR LibrariesUsing Ready-for-PIC and SDR Libraries
Using Ready-for-PIC and SDR Libraries
Corrado Santoro
 

Was ist angesagt? (20)

02 General Purpose Input - Output on the Arduino
02   General Purpose Input -  Output on the Arduino02   General Purpose Input -  Output on the Arduino
02 General Purpose Input - Output on the Arduino
 
How to measure frequency and duty cycle using arduino
How to measure frequency and duty cycle using  arduinoHow to measure frequency and duty cycle using  arduino
How to measure frequency and duty cycle using arduino
 
04 Arduino Peripheral Interfacing
04   Arduino Peripheral Interfacing04   Arduino Peripheral Interfacing
04 Arduino Peripheral Interfacing
 
GCC 4-1-16
GCC 4-1-16GCC 4-1-16
GCC 4-1-16
 
Gcc 4 15-16
Gcc 4 15-16Gcc 4 15-16
Gcc 4 15-16
 
Arduino slides
Arduino slidesArduino slides
Arduino slides
 
GCC 3-18-16
GCC 3-18-16GCC 3-18-16
GCC 3-18-16
 
2009 11-17-arduino-basics
2009 11-17-arduino-basics2009 11-17-arduino-basics
2009 11-17-arduino-basics
 
I2 c and mpu6050 basics
I2 c and mpu6050 basicsI2 c and mpu6050 basics
I2 c and mpu6050 basics
 
MPU6050 IMU with Arduino
MPU6050 IMU with ArduinoMPU6050 IMU with Arduino
MPU6050 IMU with Arduino
 
Embedded system course projects - Arduino Course
Embedded system course projects - Arduino CourseEmbedded system course projects - Arduino Course
Embedded system course projects - Arduino Course
 
برمجة الأردوينو - اليوم الأول
برمجة الأردوينو - اليوم الأولبرمجة الأردوينو - اليوم الأول
برمجة الأردوينو - اليوم الأول
 
Distance measurement using Ultrasonic sensor on Arduino Uno
Distance measurement using Ultrasonic sensor on Arduino UnoDistance measurement using Ultrasonic sensor on Arduino Uno
Distance measurement using Ultrasonic sensor on Arduino Uno
 
Starting with Arduino
Starting with Arduino Starting with Arduino
Starting with Arduino
 
Arduino Robotics workshop Day1
Arduino Robotics workshop Day1Arduino Robotics workshop Day1
Arduino Robotics workshop Day1
 
Contactless digital tachometer using microcontroller
Contactless digital tachometer using microcontroller Contactless digital tachometer using microcontroller
Contactless digital tachometer using microcontroller
 
Using Ready-for-PIC and SDR Libraries
Using Ready-for-PIC and SDR LibrariesUsing Ready-for-PIC and SDR Libraries
Using Ready-for-PIC and SDR Libraries
 
Arduino Interface LM35 MQTT Using UART
Arduino Interface LM35 MQTT Using UARTArduino Interface LM35 MQTT Using UART
Arduino Interface LM35 MQTT Using UART
 
Gcc 4 22-16
Gcc 4 22-16Gcc 4 22-16
Gcc 4 22-16
 
2 Digit Object counter
2 Digit Object counter2 Digit Object counter
2 Digit Object counter
 

Andere mochten auch (6)

David Cuartielles and Tony Olsson - Going Physical (K3 research seminar)
David Cuartielles and Tony Olsson - Going Physical (K3 research seminar)David Cuartielles and Tony Olsson - Going Physical (K3 research seminar)
David Cuartielles and Tony Olsson - Going Physical (K3 research seminar)
 
Physical prototyping lab2-analog_digital
Physical prototyping lab2-analog_digitalPhysical prototyping lab2-analog_digital
Physical prototyping lab2-analog_digital
 
Lect23 Engin112
Lect23 Engin112Lect23 Engin112
Lect23 Engin112
 
How to design a machine?
How to design a machine?How to design a machine?
How to design a machine?
 
Obstacle detection Robot using Ultrasonic Sensor and Arduino UNO
Obstacle detection Robot using Ultrasonic Sensor and Arduino UNOObstacle detection Robot using Ultrasonic Sensor and Arduino UNO
Obstacle detection Robot using Ultrasonic Sensor and Arduino UNO
 
Code generation
Code generationCode generation
Code generation
 

Ähnlich wie Physical prototyping lab6-motors

major project ppt 27-4-16
major project ppt 27-4-16major project ppt 27-4-16
major project ppt 27-4-16
rafiya begum
 
teststststststLecture_3_2022_Arduino.pptx
teststststststLecture_3_2022_Arduino.pptxteststststststLecture_3_2022_Arduino.pptx
teststststststLecture_3_2022_Arduino.pptx
ethannguyen1618
 
Arduino spooky projects_class3
Arduino spooky projects_class3Arduino spooky projects_class3
Arduino spooky projects_class3
Anil Yadav
 
Introduction to the Arduino
Introduction to the ArduinoIntroduction to the Arduino
Introduction to the Arduino
Wingston
 

Ähnlich wie Physical prototyping lab6-motors (20)

Arduino
ArduinoArduino
Arduino
 
Introduction_to_Mechatronics_Chapter4.pdf
Introduction_to_Mechatronics_Chapter4.pdfIntroduction_to_Mechatronics_Chapter4.pdf
Introduction_to_Mechatronics_Chapter4.pdf
 
major project ppt 27-4-16
major project ppt 27-4-16major project ppt 27-4-16
major project ppt 27-4-16
 
arduinoworkshop-160204051621.pdf
arduinoworkshop-160204051621.pdfarduinoworkshop-160204051621.pdf
arduinoworkshop-160204051621.pdf
 
Ardui no
Ardui no Ardui no
Ardui no
 
Sensor and Actuators using Rasberry Pi controller
Sensor and Actuators using Rasberry Pi controllerSensor and Actuators using Rasberry Pi controller
Sensor and Actuators using Rasberry Pi controller
 
Smart shoe
Smart shoeSmart shoe
Smart shoe
 
Prestentation
PrestentationPrestentation
Prestentation
 
First step robotics
First step roboticsFirst step robotics
First step robotics
 
Lecture 08 robots and controllers
Lecture 08 robots and controllersLecture 08 robots and controllers
Lecture 08 robots and controllers
 
teststststststLecture_3_2022_Arduino.pptx
teststststststLecture_3_2022_Arduino.pptxteststststststLecture_3_2022_Arduino.pptx
teststststststLecture_3_2022_Arduino.pptx
 
Warehouse Managing Robot
Warehouse Managing  Robot Warehouse Managing  Robot
Warehouse Managing Robot
 
Self Obstacle Avoiding Rover
Self Obstacle Avoiding RoverSelf Obstacle Avoiding Rover
Self Obstacle Avoiding Rover
 
Arduino Based Project.pptx
Arduino Based Project.pptxArduino Based Project.pptx
Arduino Based Project.pptx
 
Newppt major
Newppt majorNewppt major
Newppt major
 
Arduino spooky projects_class3
Arduino spooky projects_class3Arduino spooky projects_class3
Arduino spooky projects_class3
 
Introduction to Arduino Webinar
Introduction to Arduino WebinarIntroduction to Arduino Webinar
Introduction to Arduino Webinar
 
Exoskeleton arm ppt
Exoskeleton arm pptExoskeleton arm ppt
Exoskeleton arm ppt
 
Embedded systems and robotics by scmandota
Embedded systems and robotics by scmandotaEmbedded systems and robotics by scmandota
Embedded systems and robotics by scmandota
 
Introduction to the Arduino
Introduction to the ArduinoIntroduction to the Arduino
Introduction to the Arduino
 

Kürzlich hochgeladen

Kürzlich hochgeladen (20)

Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
 
Advantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your BusinessAdvantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your Business
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of Terraform
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 
GenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdfGenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdf
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
 
Tech Trends Report 2024 Future Today Institute.pdf
Tech Trends Report 2024 Future Today Institute.pdfTech Trends Report 2024 Future Today Institute.pdf
Tech Trends Report 2024 Future Today Institute.pdf
 
Developing An App To Navigate The Roads of Brazil
Developing An App To Navigate The Roads of BrazilDeveloping An App To Navigate The Roads of Brazil
Developing An App To Navigate The Roads of Brazil
 
What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CV
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed texts
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Script
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘
 

Physical prototyping lab6-motors

  • 1. PHYSICAL PROTOTYPING © 2011 K3 Creative Commons v3.0 SA-NC Lab 6: Motors With the Arduino prototyping board
  • 2. millis() • millis(); returns the number of milliseconds the arduino has been on • Useful when you want two things to happen at once ”semi threading” • Returns a long • Examples/Digital /Blinkwithoutdelay Made by: David Sjunnesson
  • 3. micro()  Returns the number of microseconds since the Arduino board began running the current program  Returns a long  Works the same way as millis()
  • 4. Random • random(min, max) • Returns a pseudorandom number between min and max. • random(10,50) returns a number between 10-49 • randomSeed(); • randomSeed(analogRead(4)); Gives you a better random value
  • 5. Try it out • Create a program that randomly in time sends a random value to the computer.
  • 6. map()  Re-maps a number from one range to another  Useful when a sensor sends one range of values but you need it in another.  map(value, fromLow, fromHigh, toLow, toHigh)
  • 7. constrain()  Constrains a number to be within a range.  Helps to make sure a value is in a certain range  constrain(value, minimum, maximum)
  • 8. Try it out!  Create a program that maps your value from a potentometer from the read range into another and sends it back to the computer.
  • 9. MOTOR • Actuator that transforms electricity into movement • Motors can be of different kinds: DC, stepper, servos, etc. Each type has a different way of being driven • New motors can be very expensive. In many cases we will not be interested in high accuracy and precission, just in showing the basic functionality • It is in those cases when dismounting some kind of motor-driven device will be useful to acquire the basic components for our design • Car-toys, electric razors, printers, CD-drives, old hard drives, cash registers, and many devices contain motors that we should be able of using
  • 10. TYPES OF MOTORS • There are three main types of motors – DC motors: they are used in toys and devices that do not need high degrees of accuracy in terms of speed or angle. With certain circuits that can be improved – Stepper motors: they can move to a very precise position. We find them in printers, scanners, etc – Servo motors will move and stop at a certain angle on request. They are used in car models to control the direction, model-planes for the flaps, etc
  • 11. TYPES OF MOTORS • DC motors: – run freely – hard to control their position/speed – can use as less as 2,5Volts – speed can be controlled using PWM – we use relays, transistors or H-bridges to control them from Arduino – with encoding circuits can become very precise
  • 12. DC MOTORS: PWM • PWM stands for Pulse Width Modulation. Microprocessors cannot produce pure analog signals, nor can they provide enough current to drive motors • Through calculating the average value of a sequence of pulses, microprocessors emulate the generation of analog signals • It is with PWM that we can change the speed of a DC motor. It is anyway needed the use of a transistor, since the pins on Arduino cannot handle the amount of current to move the motor PICTURES © their authors
  • 13. STEPPER MOTORS • Stepper motors: – 2 types: unipolar or bipolar – rotate a certain amount of degrees at each pulse – typical values of angles are 1,8 - 3,6 - 7,2 ... – we use transistors, transistor chips, and H-bridges to control them – they have 4 or more wires – RepRap
  • 15. SERVO • they will rotate to a certain angle depending on a PWM value we push into them • recently there are continuous rotation servos • broadly used in robotics
  • 16. SERVO/Continuous • Connect the servo to the arduino • Black ----> Arduino ground • Red -----> Arduino 5v+ • White ----> Arduino motorPin • Make it move Clockwise or Counter-clockwise depending on the values read from a potentiometer • Usefull functions is map()
  • 17. SERVO/Standard • Connect the servo to the arduino • Black ----> Arduino ground • Red -----> Arduino 5v+ • White ----> Arduino motorPin • Make it move to a specified angle depending on the values read from a analog input • Usefull functions is map()
  • 19. Transistor • The transistor is considered by many to be the greatest invention of the twentieth century. It is the key active component in practically all modern electronics.
  • 20. Transistor • A transistor is a semiconductor device, commonly used to amplify or switch electronic signals. The transistor is the fundamental building block of computers, cellular phones, and all other modern electronic devices.
  • 21. Transistor • We use transistors for: – turning DC devices on/off: motors, lamps, etc – dimming DC lights – changing the speed of motors seamlessly (using PWM)
  • 22. How to hook up a motor using IRF Z24 Copyright Kajsa Sahlström and Matilda Marcelius
  • 23. How to hook up a motor using BC547
  • 25. Relay • A relay is an electrical switch that opens and closes under the control of another electrical circuit • Makes it possible to control big stuff with Arduino • Control up to 220V with 5v from Arduino • Cant control speed...
  • 26. Hook it UP!  Connect a DC motor and control the speed with a analog sensor  Create a gaspedal!

Hinweis der Redaktion

  1. Encourage people to interrupt you so you can help them immediately. Explain they do you a favor. It’s good to time the duration of the presentation.
  2. Millis() gives you the amount of time the arduino has been running in milliseconds. Use a long variable to store this information, int is too small to hold the data. Show blink without delay example Picture: use an arduino to control the flash of a camera to do high speed photography based on the sound. (In the case of the picture the bulb breaking) If you would use delay() it would not work because you would hit the actual kaboom. (the moment you want to photograph)
  3. Micro works the same as millis, but returns the time in microseconds. You use it when generating sound with arduino.
  4. Explain random, give minium and maximum value. The value returned is always in between the minimum and maximum specified. You use static electricity of the physical world on an analog port to get a true random number.
  5. Read the values in the serial monitor. Explain everything again, random and randomseed.
  6. You use this value often to constrain the value of sensors to get rid of their random behaviour. Example: LDR. It fluctuates a lot, so you can constrain it’s value to make it more accurate.
  7. Read the value in the serial monitor. Remap the value of 0-1023 to something else 0-255 for instance.
  8. Explain DC-motors Stepper motors Servo motors Every piece of electronics which moves has a motor. There is a trade of between price, easiness to connect and accuracy.
  9. Retarded brother of the other two motors. If you switch the cables around it runs in the other direction. You can use PWM on a low power motor to make it run at different speeds. If it’s a high power motor you need a transistor to control it at different speeds. When you need some sort of precision servo motors are the way to go. An H-bridge not only allows you to change the speed but also the direction of turning. H-bridge is a bunch of transistors connected You put the motor as the bridge in the letter H, the center piece.
  10. You can tell it’s a stepper motor because it has 4 more wires then the DC motor. They need a transistor chip to be controlled. They need more power. They can be moved at very specific angles. You can use the steps 7,2 degrees per step for a normal stepper motor. They also exist in 3,6 degrees per step. They are used in scanners to scan the picture at the same speed for the whole picture. Reprap is an open source 3D printer.
  11. Magnets activate in turn and make the piston turn.
  12. You control them with PWM, don’t use the motor library. All robots use servo motors, and model airplanes. There are two kinds, a standard servo motors, the standard one only turns 180 degrees, and a continuous rotation servo. Continuous rotation servos are slower and they can’t be turned to a specific angle.
  13. With a continuous rotation servo you can influence the speed by pulsing it at a specific speed. 500--------1000--------1500 If you pulse it at 1000 it will stop, 500 it will spin left way around and 1500 the right way around. Map the values from the They have a small potentiometer hole at the connector You can distinguish them this way from 180 degrees servos.
  14. The standard servo, you pulse it, and the length of the pulse determines the angle to which it will turn. If you pulse it with a delay of 500 milliseconds it will go to 0 degrees.
  15. You can buy batteries to power the arduino so you don’t need the USB cable Safe is: 6-17 volts. Direct current
  16. Most important electronic invention. 31 years old. It’s the basis of all modern computers. In prototyping they are usufally used to switch a lower power circuit to a higher power circuit. So for instance you can control a high power lamp or solenoid indirectly from the Arduino with a transistor.
  17. The IRF Z24 is a good transistor to use. Some operate at lower power. The IRF Z24 handles up to 80 volts, so it’s good for anything. This one is about 15 SEK
  18. This is a smaller cheaper one. The BC547 is low voltage
  19. Talk about 220 volts. IF you go above 80 volts, you have to switch to a Relay instead. If you want to control AC power you also need a Relay. Transistors are only for Direct Current.
  20. They are not allowed to experiment with this in school. You can blow out the wall sockets. If you want to control 220 volts, Most relays only start to work from 12 volts. You have to activate an electro magnet inside the relay to close the high power circuit. You use an arduino to control the transistor and the transistor to control the relay. You can experiment with this by buying a Relay kit. IF you are unsure of what you’re doing with Relays then you’re not supposed to work with them.