Project Idea:-
The Assignment idea(graphic user interface for Simple circuit of a push button to toggle and control led and a display wich the write and value of temperature will be printed on it).
I care about this idea: to know the basic principles of creating a Graphical User interface that communicates through USB or Wirelessly through Bluetooth with a smart device.
I Searched on the Internet about smart Arduino Device Ideas, I Inspired by this Project from the Diploma content materials.
Components List For Project:-
breadboard.
Arduino Uno board
Lm 45 teperature sensor
push button
Wiers
Red led
resistor (330 ohms)
I Used Tinkercad as the Software of Design and Simulate as Tinkercad has many features such as:
Tinkercad is very easy to use. Most of the 3d design software have steep learning curves.
It is compatible with 3d printing. It is a proper tool that gives you solid 3d files needed for 3d printing.
Tinkercad is fun to use. There are tones of 3d models created by the community. You could share your designs or even collaborate on designs.
Tinkercad can simulate all the electrical circuits with all the components.
Design Process of the Project:-
I Searched on the internet about the Sample project circuits Ideas
I imagined the schematic diagram of the circuit in my mind, then I sketched it using paper and pen.
I searched about the datasheets of all the components to know the (operating voltage and current) and to know to connect the Components together with the Arduino.
I opened the Tinkercad
I dragged all the components that I will use into the Working Area.
I Connected the 5v of Arduino to + on Breadboard and the GRD to the -.
I Connected The LED with the Resistors to the Breadboard and to the Arduino as it is on the wiring diagram for components with the Arduino board.
I Connected The switch to the GND on the breadboard and 9 with the Arduino.
I Connected The LM 35 Temprature to the GND on the breadboard and Vcc with the Arduino and Signal to A0
I Coding the Arduino MicroController to make the Function of the Device
After finishing. I simulated the circuit to make sure that all is ok.
The Coding sequence and Logic:-
Set the (Reading of LM35 Temprature Sensor) and potentiometer readings as the Input Data of the Device.
Define the Input Data
due to the topple, the led will on or off
Fabrication Process:-
I Used the Simulated diagram for components with the Arduino board to make it.
I collected all the parts that I will use to make the circuit device.
I joined and assembled the parts of the design together to show the final design of the project on the breadboard.
After making sure that all the connections are ok such as the Simultaed device on the Tinkercad.
I Connect the Arduino to My PC
I Opened Arduino IDE
I Uploaded the Programming code to The Arduino Micro Controller.
I opened Processing IDE to make the graphic user interface.
I sketched Programming code on the Processing IDE
I Connected Between Processing and Arduino.
Start powering
Here we have the Graphical User INterface.
we supported each other to know how to deal with the Electronics and connections and use them, Moreover we helped each other with a lot of problems which occur during the connecting and design.
We supported and helped each other in The Coding Process and we search and find fritzing has all components needed and we can program and export schematic diagrams from it.
The instructors helped us on how to make the week's Exercises Projects.
Tell my peer how to connect the H-bridge power .first channel with 9 V from adaptor second channel with the ground from the adaptor and Arduino third channel with Vcc.
Acknowledgment:-
I'd like to thank Haneen Faris for supporting and suggesting an idea for the week assignment.
Moreover, I'd like to thank Ahmed Saeed for supporting and helping.
I had some problems with the internet connection and uploading the materials of the ssignment.
I had some problems with The Coding Part.
After (Try & Error) all became ok.
I learned how to:-
Program an Arduino Uno board to do serial communication through a wired (USB)
Program an Arduino Uno board to do serial communication wirelessly (Bluetooth)
Create a Tangible User Interface that takes input from the user (through buttons and knobs) and display data to the user (through LCD display)
Create a simple Graphical User Interface using Processing
Create a simple Graphical User Interface using MIT App Inventor
After this week I learned how to Create a Graphical User interface that communicates through USB or Wirelessly through Bluetooth with a smart device.
The Coolest Thin that I have learned is Coding WithProcessing.
The Thing that I Will never Forget from this week is (Bluetooth code with a mobile app.)
The diagram for components with Arduino board
The Tex Code
The GUI
The GUI VIDEO
List of components and materials :-
The Arduino code:-
int buttom = 8;
int led = 9;
int buzzer = 10;
int temp = A0;
int state = 1;
void setup() {
// put your setup code here, to run once:
pinMode(buttom, INPUT_PULLUP);
pinMode(led, OUTPUT);
pinMode(buzzer, OUTPUT);
Serial.begin(9600);
}
void loop() {
// put your main code here, to run repeatedly:
if (Serial.available())
{
char x = Serial.read();
if (x == 'a') {
if (state == 0) {
state = 1 ;
digitalWrite(led, LOW);
digitalWrite(buzzer, LOW);
}
else if (state == 1) {
state = 0;
digitalWrite(led, HIGH);
digitalWrite(buzzer, HIGH);
}
}
}
int temprature = analogRead(temp);
int mv = (temprature / 1024.0) * 5000;
int cel = mv / 10;
Serial.println(cel);
delay(100);
}
The GUI Code :-
import controlP5.*;
import processing.serial.*;
Serial myPort;
ControlP5 cp5;
Textlabel label;
void setup() {
size(400, 200);
background(0);
cp5 = new ControlP5(this);
label = cp5.addTextlabel("label")
.setText("Temprature is : 35")
.setPosition(100, 80)
;
cp5.addButton("Toggle")
.setBroadcast(false)
.setPosition(100,100)
.setSize(200,19)
.setBroadcast(true);
;
myPort = new Serial(this, Serial.list()[0], 9600);
}
void draw(){
if(myPort.available()>0)
{
String x = myPort.readString();
label.setText(" Temprature is " + x);
background(0);
label.draw(this);
}
}
void Toggle(int theValue){
myPort.write('a');
}