If you're seeing this message, it means we're having trouble loading external resources on our website.

If you're behind a web filter, please make sure that the domains *.kastatic.org and *.kasandbox.org are unblocked.

Main content
Current time:0:00Total duration:9:48

Video transcript

in this video we're going to show you how to make a bumper switch for your bitsy bot so we've got the wires connected to one and three that can the powers connected to one and three and you can see the LED light up there and then when we switch the power to one and two the LED turns off when we push the switch instead of turning on so we want to connect the wires to one and three we're just going to double check this with our multimeter and so when we connect the contacts to one and two you can see that it turns off when the power when the button is pressed and then when connected to one and three it turns on when the button is pressed so we want to connect to one and three and you can see there's a one and three really small on the on the lever switch there and you can buy a micro lever switches like this from RadioShack or a variety of places online and so now we've got our alligator clips and we're going to bend the wire around the one and three contacts so that we can get a good connection and then we're going to solder those wires in place to make sure that they don't come out and we'll use our needle nose plier to squeeze the wire against the connection there and I've already put some solder on those connections to make them a little easier to solder to there we go we got the first wire in place and the number three connection we're going to just clamp that down and then we'll go ahead and heat it up and we've got that soldered in place too so now those wires are soldered well and to make sure that the connections good and that we got everything soldered correctly we're going to go ahead and turn on our multimeter and check the ends of the wire so we'll strip the ends of the wire off there and use some alligator clips and we'll clip to the ends of the leads on our multimeter and that way we can make sure that yeah in fact the switch is wired correctly and it's working so now we're going to take the outer housing that surrounds the bot off and we're going to try and position the switch so we're going to drill some holes and you will use the holes they're actually in the switch as a guide for our drill it's important that you make sure that you don't drill into your fingers when you're doing this kind of closed work so you want to keep your fingers away from from the drill bit itself but we've positioned that drill we've positioned that switch so that it is right off of the edge of the bitsy bot so it sticks out over the edge you can see right there sort of tangent to the circle and that will be important when we get the rest of our connector there in place and we've put the put the screws in upside down and that's so when we put our speaker back in place the bolts that are protruding won't interfere with that speaker so that that's why they're sticking up from the underside so we're just tightening those down again with the screwdriver and the needlenose plier pliers and we just used 12 gauge solid copper wire and the reor we're using 12 gauge solid copper wire and the reason for that is that it allows us it's pretty stiff so it'll uh it'll allow us to extend the lever arm of our switch considerably so anything that gets in front of our bit Zbot will be able to be we'll be able to trigger it's its bumper switch and this is a bit of an improvement over the previous design so we're just drilling a hole in the back there and that's going to put we're going to put a screw in and that that screw is it's basically a machine screw and it's going to hold our our lever made out of that wire in place so we just twisted the wire around like a snail and now that the wires in place we can bend it so that it makes the right kind of connection with the switch and this takes a fair amount of sort of trial and error but once you get the wire bent correctly it'll trigger the switch every time and it'll extend the reach of that switch so you only need to use one switch instead of the same multiple ones and so we're just going to get our bolt there and tighten that down and now it's really important that that nut and bolts that are and the washer that are holding that wire in place are tightened very tightly because if the wire slips it won't trigger it won't return to its location it'll it'll just sort of move and hold the hold the switch down so if you want to make sure that the wire is tight really tight so that it the bolt is really tight so that the wire doesn't stay pressed against the switch so that it returns to its original location so it's really important tighten that all the way down so we're going to do the same thing on the other side and drill the the holes out for the switch on the other side so now that we've got the the switch on the other side drilled out we're going to go ahead and install our our nuts and our screws and this is actually a good example of a term called pokey oak and that means basically it's it's a Japanese term that refers to designing parts in such a way that they can't be installed wrong and so this part is not pokey oKed it's actually the switches in backwards and I hadn't realized that it was in backwards until I put the the switch extender the green wire that's the 12 gauge solid core copper with a little snail tail in so I snaked that around the screw that's right next to the switch and then I realize that I can't it won't trigger the switch because the switch is in backwards so in industry sometimes part you know if parts are designed very similarly they somebody may put the wrong part in or they may put the part in backwards because it's it's so similar and so what they'll do is they'll design it with some feature so that it can't that can't happen and they call that pokey oking and so this is not pokey Oaks so I take the switch back out and flip it around so that the lever extends off of the edge of the radius of the circle tangent to the circle so that the when it when the switch extender or that 12 gauge wire pushes against it it will cause the switch to trigger and allow us to reverse direction or perform a number of different functions again it's important to tighten that switch down pretty snugly and those switches again can be bought from anywhere from like Radio Shack or any place that sells lover switches and they're not not very expensive so now we're going to wire the switches and we're going to take two of the leads one lead from each switch and run it to the the positive terminal on our on our board down there so this is the the extender board or the Power Distribution board that we created and so the you can tell the positive side because it's going to plus on it and we we've run a red wire to power it so we're going to take two of our switch wires and run them to the positive side of our power distribution board and connect them there so now that we've got the power distribution connected the ground wires connected we're going to take a look at the initial sketch for our code and we've got looks like our bumper switches are a 5 and a 4 the rear is the a 5 and the front one is the a 4 so those are the analog 5 and 4 connections so that's around the other side of our breadboard there it's close to the between 24 and 30 on the breadboard so the 24 grows 24 and 30 so we're stripping our wires and getting those set up - those are the wires that are coming from our switch the the other side of our switch and before we connect those we're going to use some 10k ohm resistors these 10k ohm resistors are going to help to limit the current there for us and we're going to connect the switch wire to one side of the 10k ohm resistor and on each resistor and then we're going to connect the other side of the resistor to a ground wire and the so we're going to cut our ground wires there and then again strip the ends of the wires so that we can make contact and we're going to connect those ground wires to the negative or ground side of our Power Distribution board which is underneath our Arduino I'm going to kind of thread them in there and then we'll run those over back to the same location on our breadboard as our 10k ohm resistors and once we get them back over to the same location we'll strip the ends of them off and we'll connect them to the same row as the other side of our resistor so now we're ready to connect the setup to our Arduino so again we're going to go to pin out a 5 and pin out a 4 and we'll connect those to the same row as the green wires that you can see there are connected to those are our switch wires and so now our circuit is ready for our bumper switches so now it's now it's time for us to double check and see if those things are working and before we do that though I think we're going to reattach our speaker we had to move our speaker so that we could pop it up out of the way so that we could get to the lever switch that we installed we needed to be able to put those screws in and they they actually sit underneath where the speaker is so we had to move the speaker now we've reinstalled it glued it back into place that's one of the great things about hot glue it it does pop loose easily so now we're going to test the device and you can see it's running there we've got a some code running on the Arduino and when we push on our bumper switches it causes the motors to stop like it's supposed to the code will be available on our videos for the Arduino and we'll also create a link for that when we post those videos as well