Electric guitar – Learning path project 12

Our Learning Path is an itinerary designed to teach all the foundaments and a little more about electronics, coding and robotics.

When you complete all the projects you will be able to develop almost any project you can imagine. In each chapter new concepts are introduced. You will learn by doing in a funny way.

Play your own tuned guitar!!

Project 12
IR ELECTRIC GUITAR GAME

Learn how to use Line Follower IR Sensor and other funny applications for it!

BEFORE TO START

DIFFICULTY LEVEL: Intermediate
DURATION OF THE ACTIVITY: 45 min.

MATERIALS:
4in1 board
Buzzer
Battery holder & wires
Battery holder & wires
Battery holder & wires

1 - Buzzer module
Battery holder, USB cable and wires.

12 - Line Follower IR Sensor

The Line Follower IR Sensor from ebotics is capable of following a black line on a white surface autonomously and with no external control. It is made up of an infrared LED and a phototransistor placed next to each other.

The LED acts as a transmitter, and the phototransistor acts as a receiver. The infrared LED emits infrared light, that is, light that has a longer wavelength (or lower frequency) and is invisible to the human eye. If this light hits a white surface, it will be reflected and bounce off onto the phototransistor. On the other hand, if it hits a black surface, the material will absorb the majority of the light, and it will not reach the phototransistor.

Line follower contest

It is a common category in robot competitions. The fastest autonomous robot that completes the circuit wins!

12 - Circuit

To be able to use the line follower sensor, we have to use only one digital input for each one. The own board has electronics to distinguish between black and white, and we will receive high or low state accordingly.

Connect wires from 4in1 board to components:
- DIO6 to Buzzer module
- DIO2 to line follower 1
- DIO3 to line follower 2
- DIO4 to line follower 3

12.1 Black and white reading

Our line follower sensor send a high state when dark color is on front of it. Let's see using onboard led (PIN 13)

Block Coding
Arduino Coding
void setup() {
  pinMode(2,INPUT);
  pinMode(13,OUTPUT);
}
void loop() {
   if(digitalRead(2)){
          digitalWrite(13,1);
   }else{
          digitalWrite(13,0);
   }
}
12.2 - Follower Maker Robot

Use the robot build in previous project, and make it follow your line circuit. You need to build a circuit to test it. Try it yourself! Find some inspiration in our line follower activities:

See
what is capable to do your follower!
Final project - Electric guitar game

Have some fun playing your guitar in a different way!! Find the way to add more thn 3 different tones combining different inputs and play! Download our cardboard template

Block coding
Arduino code
int Buzzer = 6;
int IR1 = 2, IR2 = 3, IR3 = 4;
boolean IR1Value, IR2Value, IR3Value;

void setup() {
  // put your setup code here, to run once:
  Serial.begin(9600); 
  pinMode(Buzzer, OUTPUT);
  pinMode(IR1, INPUT);
  pinMode(IR2, INPUT);
  pinMode(IR3, INPUT);
}

void loop() {
  // put your main code here, to run repeatedly:
  IR1Value = digitalRead(IR1);
  IR2Value = digitalRead(IR2);
  IR3Value = digitalRead(IR3);
  Serial.print(IR1Value);  
  if(IR1Value == true)
  {
    tone (Buzzer, 262, 250);
    delay(250);
  }
    if(IR2Value == true)
  {
    tone (Buzzer, 330, 250);
    delay(250);
  }
    if(IR3Value == true)
  {
    tone (Buzzer, 392, 250);
    delay(250);
  }
  noTone(Buzzer);
}
SHARE YOUR GUITAR!!
FINISHED!
previous arrow
next arrow
Slider

The Mega Maker Kit fits perfectly with the Learning Path, you can build all projects with it, but if you have other kits, you can also follow the entire itinerary and finish some projects, or buy the missing components. You can check in our Learning Path page.

0 0

0