PROject Proposal

Using all the skills learned in this class over the next six weeks, I plan to build a vehicle capable of locomotion in the water and on the ground, also known as an amphibious vehicle. The vehicles frame will be made out of a trash can and primary purpose will be a trash can. I want to make a trash can that takes the trash out itself:).

Alternatively, I also could make a shopping cart that drove itself or self propelled longboard or bicycle; however, I really like the idea of making a trash can that takes itself out when full!

Additionally, I would like to add sensors to know when the trash can is getting to heavy so that the automatic trashcan can always take out the trash. Also, it will have maybe a compactor or a way of compressing the trash and dropping it in a predetermined location programmed into the bots gps or a like system, so it can go from stay/ home location to the drop location. Project Idea 3D

Update UNO

After much struggling with the arduino uno I have mmade progress. Progress, meaning that I am now able to control 2 motors simultaneously in both directions, brake, and accelorate to different speeds using pwm. While this is just a minor part of this project, locomotion is very important, and this is how I did it. First off, I got a motor driver; to be more specific I got an L298N motor driver. This is a VERY important part of this project. The motor driver allows me to move the motors in different dirrections at the same time, which allows the to be automated trash can to turn. You also need some wire, an arduino uno, nano, or something like it, and a geared dc motor , or two. ALso, you are gonna need a computer and cable to connect to the arduino. After you have accumalated all the suppies necassary we are going to start connecting the arduino and L298N. You are going to this starting with the in cables you should put a wire from in_1 on the motordriver to a digital number 6-13 on the arduino. then you will do this with in_2, in_3, and in_4, also. Then connect the ena on the motor driver to a analog. This analog is going to allow you to modulate the speed at which the motor turns. Connect your motors to the out(1-4). These outs are given power by the in_1-4 by the way. So to program this you are going to set your analog write to whater analog number port you used. Also set your other digitalWrite as the numbers you chose also. Here is my code:void setup() { Project code //Setup Channel A pinMode(12, OUTPUT); //Initiates Motor Channel A pin pinMode(9, OUTPUT); //Initiates Brake Channel A pin //Setup Channel B pinMode(13, OUTPUT); //Initiates Motor Channel B pin pinMode(8, OUTPUT); //Initiates Brake Channel B pin } void loop(){ //Motor A forward @ full speed digitalWrite(12, HIGH); //Establishes forward direction of Channel A digitalWrite(9, LOW); //Disengage the Brake for Channel A analogWrite(3, 255); //Spins the motor on Channel A at full speed //Motor B backward @ half speed digitalWrite(13, LOW); //Establishes backward direction of Channel B digitalWrite(8, LOW); //Disengage the Brake for Channel B analogWrite(2, 123); //Spins the motor on Channel B at half speed delay(10000); digitalWrite(9, HIGH); //Engage the Brake for Channel A digitalWrite(8, HIGH); //Engage the Brake for Channel B delay(10000); //Motor A forward @ full speed digitalWrite(12, LOW); //Establishes backward direction of Channel A digitalWrite(9, LOW); //Disengage the Brake for Channel A analogWrite(3, 123); //Spins the motor on Channel A at half speed //Motor B forward @ full speed digitalWrite(13, HIGH); //Establishes forward direction of Channel B digitalWrite(8, LOW); //Disengage the Brake for Channel B analogWrite(2, 255); //Spins the motor on Channel B at full speed delay(10000); digitalWrite(9, HIGH); //Engage the Brake for Channel A digitalWrite(8, HIGH); //Engage the Brake for Channel B delay(1000); }</p1>

Update: 7-24-2019

Over the past few weeks my prototype has eveolved A TON! here are the links to some progress that has been made. [link1](https://jonjonr13.github.io/PHYS-12-assignments/07/) [link2](https://jonjonr13.github.io/PHYS-12-assignments/04/) THis week; however, i have added another component: the sonar sensor. IT is BOMB. actually this is amazing and here is the code and setup. #define trigPin 3 #define echoPin 2 int LightPin = 0; int threshold = 980; unsigned long previousMillis = 0; const long interval = 1000; int ledState = LOW; int n; long duration, distance; String readString; #include <Servo.h> Servo myservo1; Servo myservo2; void setup() { Serial.begin(9600); //myservo1.attach(8); //myservo2.attach(9); pinMode(trigPin, OUTPUT); pinMode(echoPin, INPUT); pinMode(13, OUTPUT); pinMode(12, OUTPUT); pinMode(9, OUTPUT); pinMode(8, OUTPUT); //pinMode(LED5, OUTPUT); } void loop() { Serial.println(analogRead(LightPin)); digitalWrite(trigPin, HIGH); _delay_ms(500); digitalWrite(trigPin, LOW); duration = pulseIn(echoPin, HIGH); distance = (duration / 2) / 29.1; // unsigned long currentMillis = millis(); // if (analogRead(LightPin) &gt; threshold &amp;&amp; currentMillis - previousMillis &gt; interval) { //if (ledState == HIGH) { // ledState = LOW; // Serial.println("low"); //} else { // ledState = HIGH; // Serial.println("high"); // } //digitalWrite(LED5 , ledState); //} if (distance &lt; 30) { digitalWrite(12,LOW); digitalWrite(13,LOW); digitalWrite(9,HIGH); digitalWrite(8,HIGH); myservo1.write(n); myservo2.write(180 - n); delay(1000); myservo1.write(n); myservo2.write(90 - n); delay(500); } else { digitalWrite(13, HIGH); digitalWrite(12, HIGH); digitalWrite(9, LOW); digitalWrite(8,LOW); myservo1.write(180 - n); myservo2.write(n); } } &lt;/xmp&gt; GND&gt;GND VCC&gt;5V ECHO&gt;2 THING&gt;3 <body style="background-color:lightgrey;background-image: url(http://empoweredforexcellence.com/wp-content/uploads/2015/08/Dollarphotoclub_72421384-1200x900.jpg); background-repeat: no-repeat; background-size: cover;"> <img src="2019-07-03 (1).png" alt="Project code" /> <h1>The Trash Can Project</h1> Over the past two weeks, I have built a robot that will potentially take your trash can to the road everyweek, so you don't have to. Here is how i did it, the idea, and how you can do it too! <h1> The materials</h1> <p1> First things first you will need a few things to start here is the list: - motordriver - dc geared motor x2 - arduino nano or micro - acryllic sheet 1/4 in - laser cutter - fusion 360 - arduino ide desktop - ultrasonic sonar sensor - sautering iron - fan these supplies are necessary and shouldnt cost more than 30 dollars! </p1> <h1>The Hardware Assembled</h1> <img src="2019-08-07.png" alt="fritzing" /> Here is the hardware diagram and how you should connect and wire your bot. I highle recommend trial and error as a process for getting your exact digram right. <h1>The software</h1> For software here is the code is used: <xmp> int servoPin = 5; #define trigPin 3 #define echoPin 2 int LightPin = 0; int threshold = 980; unsigned long previousMillis = 0; const long interval = 1000; int ledState = LOW; int n; long duration, distance; String readString; void setup() { Serial.begin(9600); pinMode(trigPin, OUTPUT); pinMode(echoPin, INPUT); pinMode(9, OUTPUT); pinMode(6, OUTPUT); pinMode(8, OUTPUT); pinMode(7, OUTPUT); } void loop() { Serial.println(analogRead(LightPin)); digitalWrite(trigPin, HIGH); _delay_ms(500); digitalWrite(trigPin, LOW); duration = pulseIn(echoPin, HIGH); distance = (duration / 2) / 29.1; if (distance &lt; 70) { digitalWrite(9, LOW);//blue2 digitalWrite(6, LOW);//grey-4 digitalWrite(8, HIGH);//purple3 digitalWrite(7, HIGH);//green-1 delay(1000); digitalWrite(9, LOW); digitalWrite(6, HIGH); digitalWrite(8, LOW); digitalWrite(7, HIGH); delay(4000); digitalWrite(9, HIGH); digitalWrite(6, HIGH); digitalWrite(8, LOW); digitalWrite(7, LOW); delay(1000); } else { digitalWrite(9, LOW); digitalWrite(6, HIGH); digitalWrite(8, LOW); digitalWrite(7, HIGH); } } The code shown is a very simple program that will make the sonar sensor sense continuously and when it senses objects within 70 mm it will turn go forward and turn back and go forward onto the original path.

The created hardware

In order to create the frame and wheels of the robot you will have to use fusion 360 i have attached the files below. [the wheel mold](https://a360.co/2MOxa5W) [the frame](https://a360.co/2OJWAUI) The wheels are actually almost entirely silicon. The only piece not made of silicon is the core. Make these wheels you will have to 3d print the silicon wheel mold (print two because you will have to destroy them to remove the wheels) and the core. After printing place the core around the molded spindle and SLOWLY pour a silicon mix into the mold. Next, you will have to lasercut the frame out of acrylic! Power settings on your laser cutter will likely have to be changed so I recommend looking up suggested power settigns specifically for your laser cutter. Just do it. final final