I often feel alone so I've created this cardboard companion robot.
It is based on an Arduino MKR1010 WiFi and it is very simple to do.
I've post the video on my TikTok account https://vm.tiktok.com/ZMdKqHrwm/
and the it was shared also from the official Instagram account of Arduino!
Many people start asked me the full sketch and tutorial and so I'm here for this!
TUTORIALFirst of all I've cut the cardboard for the body of the robot and then I've attached the ultrasonic sensor.
Then I've set up the servo in the 90° position with this code and this circuit (sorry there isn't the MKR on Tinkercad)
#include <Servo.h>
Servo servo;
void setup() {
servo.attach(9);
}
void loop() {
servo.write(90);
}
After that I've put everything on the cardoard. I attach here some photos but be creative!
After this I've connected also the ultrasonic sensor and I've add some code and the full circuit
#include <Servo.h>
#define trig 11
#define echo 10
Servo servo;
unsigned long durata;
float distanza;
void setup() {
servo.attach(9);
pinMode(trig, OUTPUT);
pinMode(echo, INPUT);
}
void loop() {
if(distanza < 10){
for(int j=0; j<2; j++){
for(int i= 40; i<100; i++){
servo.write(i);
delay(10);
}
for(int i= 100; i>=40; i--){
servo.write(i);
delay(10);
}
}
}
Now you have the version 1 of the robot, you can already use it!
VERSION 2The last step was the Blynk application.
Download Blynk from the app store/play store and create a new app. Use Arduino MKR1010 WiFi how board and WiFi how connection. Then add only a 'notification' item. Go on your mail and take the auth code, then upload the full code.
I hope you can enjoy this project. You can find me on the other social.
Thanks in advance,
Greta
Instagram -- https://instagram.com/_gregalli02
TikTok -- https://tiktok.com/@gretagalli02
Youtube -- https://www.youtube.com/channel/UC2mIDEnDv7f3r5KdhddDhkQ
Comments
Please log in or sign up to comment.