As we wait to hear the results from the InvenTeam Application, we have transitioned to other class activities. The "Electronics Project" will aid in our preparation for the InvenTeam grant if we are selected. (9/14/20)
These labeled materials, found in kits made by my teacher, will form the basis for our project. I will understand what they can do to help in the construction process.
The circuit diagram represent the circuit in symbolic form and without a breadboard. The circuit picture represents what the actual components look like. This picture above includes a breadboard and the Arduino Nano was imported from a separate file.
This source shows how the 8x8 LED matrix would be wired with an Arduino Uno. Although we were only supplied with an Arduino Nano, both arduinos have the same pins. It also includes the coding to begin with.
This diagram shows how to light up specific areas on the LED matrix by using the appropriate row and column. The linked site also shows the pin configurations for this particular module.
This source shows the setup of the LED matrix with an Arduino Uno. The picture includes two potentiometers, but they can be ignored during the setup. This source also includes the array of pin connections to determine which matrix pin number corresponds with the arduino pin number.
This diagram shows the proper wiring between 8x8 LEDs and an Arduino Nano.
This circuit picture uses a breadboard to correctly wire 8x8 LEDs and an Arduino Nano.
This video shows the lighting up of the LED Matrix in an All-L-O-V-E-❤ pattern where the letters were individually coded using 0s and 1s.
#define ROW_1 2
#define ROW_2 3
#define ROW_3 4
#define ROW_4 5
#define ROW_5 6
#define ROW_6 7
#define ROW_7 8
#define ROW_8 9
#define COL_1 10
#define COL_2 11
#define COL_3 12
#define COL_4 13
#define COL_5 A0
#define COL_6 A1
#define COL_7 A2
#define COL_8 A3
const byte rows[] = {
ROW_1, ROW_2, ROW_3, ROW_4, ROW_5, ROW_6, ROW_7, ROW_8
};
const byte col[] = {
COL_1,COL_2, COL_3, COL_4, COL_5, COL_6, COL_7, COL_8
};
// The display buffer
// It's prefilled with a smiling face (1 = OFF, 0 = ON)
byte ALL[] = {B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000};
byte EX[] = {B11111111,B11101111,B11101111,B11101111,B11101111,B11111111,B11101111,B11111111};
byte A[] = {B11000011,B10000001,B10011001,B10011001,B10000001,B10011001,B10011001,B10011001};
byte B[] = {B10000011,B10011001,B10011001,B10000011,B10000011,B10011001,B10011001,B10000011};
byte C[] = {B11000011,B10011001,B10011111,B10011111,B10011111,B10011111,B10011001,B11000011};
byte D[] = {B10000111,B10000011,B10011001,B10011101,B10011101,B10011001,B10000011,B10000111};
byte E[] = {B10000001,B10000001,B10011111,B10000011,B10000011,B10011111,B10000001,B10000001};
byte F[] = {B10000001,B10000001,B10011111,B10000011,B10010011,B10011111,B10011111,B10011111};
byte G[] = {B11000011,B10000001,B10011111,B10011111,B10010001,B10010001,B10011101,B11000011};
byte H[] = {B10011001,B10011001,B10011001,B10000001,B10000001,B10011001,B10011001,B10011001};
byte I[] = {B10000001,B10000001,B11100111,B11100111,B11100111,B11100111,B10000001,B10000001};
byte J[] = {B11111001,B11111001,B11111001,B11111001,B10011001,B10011001,B10000001,B10000001};
byte K[] = {B10011101,B10011001,B10010011,B10000011,B10000111,B10010011,B10011001,B10011101};
byte L[] = {B10011111,B10011111,B10011111,B10011111,B10011111,B10011111,B10000001,B10000001};
byte M[] = {B00011000,B00000000,B00000000,B00100100,B00100100,B00100100,B00111100,B00111100};
byte N[] = {B10111001,B10011001,B10001001,B10000001,B10000001,B10010001,B10011001,B10011101};
byte O[] = {B11000011,B10000001,B10011001,B10011001,B10011001,B10011001,B10000001,B11000011};
byte P[] = {B10000011,B10000001,B10011001,B10000001,B10000011,B10011111,B10011111,B10011111};
byte Q[] = {B11000011,B10000001,B10011001,B10011001,B10011001,B10011001,B10000000,B11000000};
byte R[] = {B10000011,B10011001,B10011001,B10000011,B10000001,B10011001,B10011001,B10011001};
byte S[] = {B11111111,B11000011,B11011111,B11000011,B11111011,B11111011,B11000011,B11111111};
byte T[] = {B10000001,B10000001,B11100111,B11100111,B11100111,B11100111,B11100111,B11100111};
byte U[] = {B10011001,B10011001,B10011001,B10011001,B10011001,B10011001,B10000001,B11000011};
byte V[] = {B10011001,B10011001,B10011001,B10011001,B10011001,B10011001,B11000011,B11100111};
byte W[] = {B00111100,B00100100,B00100100,B00100100,B00100100,B00100100,B10000001,B11000011};
byte X[] = {B00011000,B10011001,B11011011,B11100111,B11100111,B11011011,B10011001,B00011000};
byte Y[] = {B10011001,B10011001,B10011001,B11000011,B11100111,B11100111,B11100111,B11100111};
byte Z[] = {B10000001,B10000001,B11110001,B11100011,B11000111,B10001111,B10000001,B10000001};
byte Square[] = {B11111111,B10000001,B10000001,B10000001,B10000001,B10000001,B10000001,B11111111};
byte Circle[] = {B11000011,B10000001,B00000000,B00000000,B00000000,B00000000,B10000001,B11000011};
byte Wings[] = {B01111110,B00111100,B00011000,B00000000,B00000000,B00011000,B00111100,B01111110};
byte Wifi[] = {B10000001,B01111110,B11000011,B10111101,B11100111,B11011011,B11111111,B11100111};
byte Diamond[] = {B11111111,B11000011,B10000001,B00000000,B10000001,B11000011,B11100111,B11111111};
byte Heart[] = {B11111111,B10011001,B00000000,B00000000,B00000000,B10000001,B11000011,B11100111};
float timeCount = 0;
void setup()
{
// Open serial port
Serial.begin(9600);
// Set all used pins to OUTPUT
// This is very important! If the pins are set to input
// the display will be very dim.
for (byte i = 2; i <= 13; i++)
pinMode(i, OUTPUT);
pinMode(A0, OUTPUT);
pinMode(A1, OUTPUT);
pinMode(A2, OUTPUT);
pinMode(A3, OUTPUT);
}
void loop() {
delay(5);
timeCount += 1;
if(timeCount < 200) {
drawScreen(ALL);
} else if (timeCount < 230) {
} else if (timeCount < 400) {
drawScreen(L);
} else if (timeCount < 430) {
} else if (timeCount < 500) {
drawScreen(O);
} else if (timeCount < 530) {
} else if (timeCount < 600) {
drawScreen(V);
} else if (timeCount < 630) {
} else if (timeCount < 700) {
drawScreen(E);
} else if (timeCount < 730) {
} else if (timeCount < 800) {
drawScreen(Heart);
} else if (timeCount < 830) {
} else {
timeCount = 0;
}
}
void drawScreen(byte buffer2[])
{
// Turn on each row in series
for (byte i = 0; i < 8; i++) // count next row
{
digitalWrite(rows[i], HIGH); //initiate whole row
for (byte a = 0; a < 8; a++) // count next row
{
// if You set (~buffer2[i] >> a) then You will have positive
digitalWrite(col[a], (buffer2[i] >> a) & 0x01); // initiate whole column
delayMicroseconds(100); // uncoment deley for diferent speed of display
//delayMicroseconds(1000);
//delay(10);
//delay(100);
digitalWrite(col[a], 1); // reset whole column
}
digitalWrite(rows[i], LOW); // reset whole row
// otherwise last row will intersect with next row
}
}
//
/* this is siplest resemplation how for loop is working with each row.
digitalWrite(COL_1, (~b >> 0) & 0x01); // Get the 1st bit: 10000000
digitalWrite(COL_2, (~b >> 1) & 0x01); // Get the 2nd bit: 01000000
digitalWrite(COL_3, (~b >> 2) & 0x01); // Get the 3rd bit: 00100000
digitalWrite(COL_4, (~b >> 3) & 0x01); // Get the 4th bit: 00010000
digitalWrite(COL_5, (~b >> 4) & 0x01); // Get the 5th bit: 00001000
digitalWrite(COL_6, (~b >> 5) & 0x01); // Get the 6th bit: 00000100
digitalWrite(COL_7, (~b >> 6) & 0x01); // Get the 7th bit: 00000010
digitalWrite(COL_8, (~b >> 7) & 0x01); // Get the 8th bit: 00000001
}*/
This circuit picture shows how to properly wire the ultrasonic sensor(HC-SR04 model) to an Arduino with the help of a breadboard.
The ultrasonic sensor produces a frequency of 40,000 Hz, which is too high for a human ear to pick up. If there is an object in front, the frequency will reflect back to the sensor, and the time is takes to be received, along with the speed, will determine how far away the object is.
Once I correctly wired the ultrasonic sensor to my Arduino Nano with the help of my breadboard, I uploaded the code below to the Arduino app. Next, I placed an object in front of the sensor and opened the serial monitor screen (the screen that shows the changing values) to see how the sensor reacted. As I moved the object farther away, an increase in length/distance was shown (vice versa: as it moved closer, the values were smaller).
void setup() {
pinMode(2, OUTPUT);//define arduino pin
pinMode(4, INPUT);//define arduino pin
Serial.begin(9600);//enable serial monitor
}
void loop() {
//pulse output
digitalWrite(2, LOW);
delayMicroseconds(4);
digitalWrite(2, HIGH);
delayMicroseconds(10);
digitalWrite(2, LOW);
long t = pulseIn(4, HIGH);//input pulse and save it veriable
long inches = t / 74 / 2; //time convert distance
long cm = t / 29 / 2; //time convert distance
String inch = " inches \t";
String CM = " cm";
Serial.print(inches +inch);//print serial monitor inches
Serial.println(cm +CM);//print serial monitor cm
Serial.println();//print space
delay(100);//delay
}