Alexa take out the trash
hey what's up Nassir Malik here welcome
to another IOT tutorial it's been a while I
haven't done a tutorial I have been busy
working on different projects so today I
have a very exciting project for you
this is Alexa taking out the trash so
this is a part 1 garage door
augmentation so basically the idea is to
modify the garage door and a trash can
and each of them should be able to
communicate with each other also we
should be able to control them that
Alexa given a command like open garage
door 1 or 2 or take out the trash so
idea is when I give it a command to
Alexa take out trash it should open up a
garage door and drive the trash can
outside and bring it on a curbside right
here so the next thing is once the trash
can is parked trash pickup is going to
happen and once this happens trashcan is
going to detect that it's emptied out
and it's gonna drive itself back and
actually before it does that is gonna
ask the garage door to open and the
garage door gonna tell it communicate
back and say it is already open or it is
opening it so once you get the
confirmation from garage door it's gonna
drive it back to its original spot and
then the garage door will close so here
the communication is this is how it's
going to work this is a high-level this
is the first tutorial so will probably
go into more details once we start
working on these projects but I want to
just kind of visualize it to see how
everything is gonna work so once so idea
is I want to say Alexa take out the
trash so Alexa is gonna take that
command and process it and then it's
gonna send that command from the cloud
to the trash can so once the trashcan
receives the command it's gonna go and
talk to the garage door opener which is
gonna be implemented using node MCU and
it's gonna say open the garage door and
the node MCU is going to say
okay hold on it's going to go and check
with the sensor to get a physical
verification that if the garage door
open or closed if the garage door is
open it's gonna come back and
verification and it is gonna tell the
trashcan the garage door open and go
ahead and drive yourself on the curbside
if it the sensor detects that it is
closed it's going to send then a signal
to relay briefly to switch on and off
and trigger the garage door opener to
open the garage door so while it's doing
that trashcan is going to wait for the
confirmation once the garage door is
open and it is detected by a note MCU
using the sensor it's gonna let the
trashcan now that is open and now you
can start driving
so here are a few the things you will
need you will need ultrasonic sensor
module note MCU a relay I'm using a
single real a single channel relay you
could use dual channel if you want to
control both garage doors or the all the
plumbing in the code is there but I have
not tested out but it should work but
the little bit of effort also needs some
bunch of breadboard wires Alexa dot or
echo and micro USB cable and also you
need a five volt cell phone adapter and
the wire so in this series the this is
on a high level this is what you're
gonna be learning so we're going to be
doing device to device communication
maybe using JSON or some other method
maybe we're gonna be using I to see
protocol maybe I'm not sure I'm reusing
it right now for my trashcan but and the
final version would probably go to
different things experimenting it to
figure out what works best for us we're
going to be doing implementing PID
controller to control the wheel movement
and make sure that we can drive it in a
straight line
and you know turn left right backward
whatever and make sure that we're able
to drive it correctly we're gonna take a
full-size trashcan which is 64 at the
gallon we're gonna modify that take the
wheels off put the hoverboard wheels on
we're gonna install the two hoverboard
motors on the trashcan they have a lot
of torque so they should be able to pull
the trashcan uphill or downhill we're
gonna get the garage door to be
controlled by Alexa so it should be able
to control it saying open garage door
one or two or close it and also at the
same time the same electronics should be
able to talk to the trashcan and then
back and forth we're gonna argument the
trashcan to communicate with Alexa and
garage door we're gonna install sensors
to make trashcan fully autonomous then
we're gonna set up a trash out schedule
with voice command so that's basically
then yeah you know every week when your
trash is picked up so you can say you
know let's schedule or trash out for
every Wednesday or every Thursday or
whatever and then it should you
shouldn't have to worry about it it's
gonna automatically in routine every
week it's gonna put itself out and then
bring it back and you can all of course
you'll be able to write override the
scheduler with your voice command trash
out assistant from the smart device
that's got something to do with we're
gonna have to install video camera and
if it is stuck it cannot move from a
garage or because you have a car parked
or some other issues and all this stuff
it's gonna page you on your phone and
you'll be able to guide it through your
phone and you'll be able to see the
front view image of the trash can and
should be able to just tilt your
cellphone and drive it to the park at
curbside so here's a very simple diagram
of connecting the garage door sensor and
relay so basically you look at the
ground gets connected to any other
ground it doesn't matter he
there the echo pin will be d2 and you
can change it to any pin it doesn't
matter but if you do change it here make
sure you update the sketch but I'm using
this configuration so if you use this
configuration you just need to upload
the sketch don't without modifying
anything and the trigger pin will go
into d1 and the VCC will go into
disconnect so you have to solder a wire
right here because the the other pins
they have like 3.3 volts because of this
is a voltage regulator so we need 5
volts to drive this 3.3 volts it's not
stable it doesn't work so for me at
least it didn't work so once I use the 5
volt connector from here it is fine
working fine and we don't need to worry
about it but I think the no times you
GPIO is our firewall tolerant so I'm at
least I'm not having any issues it's
working like a charm and it's working
you know there's no issues at all so
next you need to connect to relay so you
take your negative and you connect to
any ground pin and you take the signal
connector to d0 and the 5 volt 5 volt
goes from there to the positive o'hara
on the relay and this is basically a
very simple setup so this is how you
need to connect your I'm using the
breadboard to connect these now
female-to-female my breadboard wires to
connect all of this stuff on these two
poles were going to connect a long wire
these poles by default are open so I'm
gonna connect a long wire that goes into
the garage door opener it's gonna
connect these two poles briefly and then
unconnect them and this way it'll
trigger the garage door open and close
so here I have single channel relay
hooked up with the breadboard wires and
speaker wires and also it is connected
to this node MCU here is the ultrasonic
sensor and the 5 volt phone charger and
are we gonna need for this tutorial here
I'm gonna cut meal to meal breadboard
wires for the garage door opener she cut
it in half and connected to the long
wire that is gonna hook up to the relay
these two wires get connected to relay
poles and this goes into the garage door
switch you guys need to go to this
github page and download this sketch for
your garage door right here I will add
the links in the video description below
and these are all the files that you
would need just downloaded it you need
to open this file up in I dunno IDE and
it should automatically load all these
files once you download and open the
sketch in arduino ide if you have the
same gateway and subnet like mine you
can go ahead and start flashing it to
your node MCU otherwise you need to make
the change and IP address should be that
any available IP address on your network
you don't have to modify anything else
at all so we're gonna be setting this up
using a Wi-Fi manager so once it is
flashed you should see a similar screen
and after that you need to go into your
cell phone and look for net media AP and
connect to it and it's good to connect
take a little bit few seconds and the
woods is connected click on a managed
router and after that it's gonna take
you to this screen and click configure
Wi-Fi button and then put in your SSID
name and password and connect and after
that it's gonna show you on the screen
the Wi-Fi and the connecting and it
should say if it's fails just reset it
and it should be able to connect and
then you can see that it's connected so
once it's connected you're gonna see a
similar screen right there where it's
reading up the the garage door and all
that stuff in here and by default since
there's no setting it's gonna say
connecting Wi-Fi you should see a
similar prompt once it's successfully
connected
so once you enter the password username
you may not see it connecting failing
you just reset it by pressing the reset
button on the node MCU and then you can
go in on the web browser on your PC and
type in this your IP address index.html
and then in the garage door one you're
gonna see in the second
it says connecting and it's gonna and
SEC gonna say you know 0 or some number
and a closed status so basically you
don't have anything set up yet it's the
first time so what you need to do is you
click calibrate garage door and this is
well you have you installed a garage
door sensor and everything else you do
that and it's going to automatically
calibrate it and you need to do this
while your garage door is open and it's
gonna measure the distance between your
garage door and the sensor and it's
gonna save it in the memory so you don't
have to do it over and over again so
here I'm opening my garage door opener
and I'm gonna test it out that which two
wires are gonna control the garage door
open and close I traced it from the wall
plate back to this so I'm using
male-to-male breadboard wire to test
that out to make sure those are the two
wires that I need to connect to my
garage door opener circuit and I'll test
it open and close each time you short it
it's gonna either open or close based on
the current position so it's opening now
and I'm gonna probably show you this
from a different angle so it's a little
more clear so on this angle you can see
the left red and then the white wire are
the ones I'm shortening with this
male-to-male wire so when I push these
in it's going to short it
it's gonna trigger the garage or the
close and once it's closed if I shorted
again it's gonna open the garage door
again so you need to just do the same
thing what I'm doing just trace it from
your wall switch to back to the this
garage door opener and he should be able
to do the same thing and it's pretty
easy and I'm using these breadboard
male-to-male wires because I don't need
to worry about now trying to shove the
wires in there and stuff it's you know I
could just put in there straight and it
goes and it works so now what I'm going
to do I'm gonna run the wire through
that is hooked to my real a just to put
it through these so put it through this
support so it doesn't get yanked and so
then I'm going to hook up so here you
need to make sure garage door is open
and towards the end of it you need to
install your ultrasonic sensor on the
ceiling so we're going to go ahead and
do that now right towards at the end of
it so now my sensor I wanna say make
sure it is hooked up at the end of it
somewhere close to it so I'm using
double-sided tape to stick that on
ceiling and then I'm gonna hook up the
adapter and the power of the node MCU
that this cell phone charger and this is
a temporary solution because I need to
hook up both garage doors so now I'm
gonna plug these two end and I'm going
to just go ahead and test it out LexA
open garage door one
Alexa open garage door one okay Alexa
close garage door one
letsa take out the trash
Alexa take out the trash okay
LexA take out the trash okay
so I'm using this controller it's a
version seven and it's basically useless
for me because it doesn't have any
brakes and also it doesn't really work
the way I want it to and if I want to
switch the direction and it's not
possible to do a quick switching and
it's a ten dollar board it may be good
for other projects where you don't need
braking in quick switching but other
than that then this thing is useless I
have different version of it and none of
them works and that's why you see the
trash can fall in at the end because I
can't really control it much okay guys
this is it for this tutorial until next
time bye let me know what you think and
see you in next video
