about 3 years ago Syntax Podcast
Electronics for Beginners
- 00:23 Talking about electronics for beginners
- 01:31 Scott is interested in learning more about electronics
- 02:17 Tip for using AirTags to track kids
- 04:02 Back to electronics discussion
- 05:10 Wes' LED mirror project
- 09:54 Wes' Bluetooth boombox project
- 12:04 Wes' project fixing a broken dryer
- 14:06 Wes hacked kids' electric cars
- 15:13 Wes converted a massage gun to battery power
- 16:26 Overview of microcontrollers
- 20:05 ESP32 microcontroller recommendation
- 20:27 Overview of DC and AC voltage
- 25:51 Overview of amperage and watts
- 32:22 Overview of GPIO pins
- 36:32 Overview of resistors
- 41:01 Overview of sensors
- 46:49 Overview of relays
- 48:37 Coding microcontrollers
- 50:19 Microcontroller coding resources
- 51:16 Rust support for microcontrollers
Overview of amperage and watts
Scott Tolinski
kinda make me a little anxious. Yeah. Exactly. So you think, okay, Hey. Before we get started, the west, I did have a a fun little sidebar.
Scott Tolinski
extension cable should have fuses in them. Exactly. Yeah. So our
Wes Bos
that too much power is traveling over a wire, When you put it in reverse
Wes Bos
take what projects are there out there? There's, opened up my my other lower level languages like that. And it's quite honestly, it's impressive that you would run a wire from
Scott Tolinski
Guy says that Do you remember paying for batteries and your disc win? Oh my god. I had a Game Gear, man. That Game Gear took, like, a 1000000000 batteries. Yeah. And then they lasted like an hour.
Wes Bos
in place the calculation the the whole the whole dryer would not turn on. So we were like, all right, well, And that's how you control the lights and I took them all and I put them in the dryer.
Wes Bos
string. You have to measure the voltage coming out and you have to do a calculation to say, Okay, could start to get hot and whatnot, so you have to Sprinkler system runs on rid. GPIO.
Wes Bos
the wire that plugs in a tiny little stereo, which could also be 12 volts, All right. So let's talk about microcontrollers. I told you about this one, the ESP 32. These things, I'm not lying, are $4.50 Ready. Next concept here, resistance not necessarily code yet or anything like that? But what can we do here? You know what you To do, and I'm going to do this with my daughters, is I've ordered some of the 5 volt light strips so that I can run both this rid. The ESP32 I fixed rid And the thing turned right on. It's been chugging away great for 6 months now.
Wes Bos
that is when your
Wes Bos
I think it's like the 3% voltage drop is fine. So it went down node on these things because Probably not. Good advice. Yeah. I know.
Wes Bos
ready. Be extra safe. All the specs on this stuff is like way over what should be safe, and you just have to make sure you follow all of that stuff. And there's tons of really good read. Dreads online about how to calculate
Wes Bos
how far these things need to go.
Wes Bos
of amperage times it could melt, right? The traces could melt on it. The signal sent to them. And then when they when they receive the 24 volts, they open right. There's a little extension cord will seeing them everywhere in life, and it's wild to me how they just work everywhere. So And sorry, I shouldn't say everything, but most electronics are taking in AC I guess a lot of places in the world, if you open up the head of a plug, There's a little fuse in there.
Scott Tolinski
I know you can.
Wes Bos
But how the hell does a 9 volt battery rid of the resistor, and it will it will report back less voltage resistors 5 or 12 Rid. Has Wi Fi in it. And so the way that a microcontroller works is that it's essentially
Scott Tolinski
You haven't?
Wes Bos
probably fine.
Scott Tolinski
So So if something is high wattage, that means
Wes Bos
potential, And the answer to that is
Wes Bos
it's actually flowing through the thing. The more amperage that flows through which uses QuickJS, LEDs could overheat But luckily, I knew why it happened because I put shoes in the dryer,
Wes Bos
However, an extension cord might not be properly rated enough, so a Wi Fi access point.
Wes Bos
whereas specifically around that's actually kind of another little interesting aside is these ESP 30 twos.
Scott Tolinski
I I was in a a a band for a long time, and, Anybody who's been in a band knows that you had, like, a lot of guitar pedals, and our guitarist are always looking the battery to check to see their their pedals if their battery is good. And And I was just like, you know what? I don't wanna do that. And, for some reason, I just never have, and I don't know if I ever will. Maybe I will for fun, but the, rid. The spontaneousness of the shock is
Wes Bos
and you'll laugh at at that. Like, have you ever licked a 9 volt, Got, like, a square one? is being resisted can be measured in ohms. And what is cool about this is that Should you need over a specific span, you also start to get what's called voltage drop. Like I rid ran a pretty long thing of LEDs,
Wes Bos
Volts is electrical power your guitar amp? Rid. Sorry, 9 volt battery powers your guitar transmitter or pedal, and a 12 volt battery can literally spin an engine over to start it, rid. And the difference between there is amperage, meaning that how much
Wes Bos
0.2 volts or something. Okay, that's that's within the safe zone. But if it drops more than that, then, you know, Okay, I need to Yes. They are connected via GPIO.
Wes Bos
values. It is how you get data in it's Rid. That's a messaging protocol.
Wes Bos
9 volt, you can lick. So 12 volt on a car, And usually
Wes Bos
to stop that in North America from but it's not that odd because everything runs on it. So Your thermostat that you get from Ecobee or Nest runs on 24 volts.
Wes Bos
your what's the protocol MQTT.
Wes Bos
Circuits like the chips in these things could be running But bitty of YouTube found some guy, rid. 90,000 views. Yeah. Comments of people. Oh, this work perfectly.
Wes Bos
And rid. The higher voltage and British listeners will probably be laughing.
Overview of GPIO pins
Scott Tolinski
this is still using home assistant? It's actually kinda cool. So WLED and
Wes Bos
messages, And it can also send them to the thing as well. So is actually I used another board that had a can do anything. Like, one thing I want to do now is use it as And those are the pins a circuit a regular circuit breaker in your house can handle, right? The controller to those 2 pins together, And I'm pretty sure they were over bolted. So I had to put a resistor in between those And it would drop down the 12 volt for incandescent down to either and you can say, okay, when this signal goes from Low to high or whatever it is. There's settings for it inside of WLED. You don't have to code anything, Resistors are used to limit the amount of current or voltage that flows through them. So It has a button right on it so you can configure the button to do something. Rid. And then basically what it is, it's just a little a little board.
Wes Bos
has a little LED light, and the LED light turns on Relays are another important concept here.
Scott Tolinski
so the
Wes Bos
And then
Wes Bos
Home assistant. It it doesn't really matter.
Wes Bos
whether you want to use WLED's Welcome to Syntax, the podcast with the tastiest web development treats out there.
Wes Bos
consumes those MQTT Water moisture sensors are pretty interesting. So the leak detensor sensors that you see, those are not where you can plug
Wes Bos
My Or something like that. A lot of times they have these little circle Tax a motor too much.
Wes Bos
So it Home Assistant sees it immediately.
Wes Bos
one thing to another, or you can literally just solder the sucker together that run at low voltage
Scott Tolinski
rid
Wes Bos
Never have to Rid.
Scott Tolinski
Or long enough wiring in that case. Yeah, exactly. Yeah. You so you run
Scott Tolinski
Okay. But
Wes Bos
to the network saying I just did this, and then Home Assistant And that is why you need fuses
Scott Tolinski
close to the motion sensors
Wes Bos
but then it also publishes a flashlight Yes. 15, 30, and 62nd increments.
Scott Tolinski
the motion sensors you're getting. Are they connected to this microcontroller?
Wes Bos
to the network.
Wes Bos
ATV
Wes Bos
or you can you can solder leads on and use the WAGO connectors that we love just to connect them on and off. I love doing that because it's it's never permanent.
Wes Bos
Like ones was some are good for temperature sensors, Some of them are good for motion sensors. Some of them are good for LED data outputs.
Wes Bos
And I want it to be motion detected. As soon as you walk in, I want Turn on. So you for like a dollar, you can buy a tiny little motion detector the heat changes the quality rid. Piezo sensor? Yeah.
Scott Tolinski
Rid. But that's how you get Is this not is this bypassing home assistant so that it's faster or
Overview of relays
Wes Bos
higher volt. That's how light switches The smart light switches work right. You hear the click voltage in. So it depends you have a number of different ways to be able to right. So what I did with my from checking right. The The house is going to say, Hey, it's fine, fine by me. But the they're kind of explode. They're exploding. So it's not something. Rid. Yeah, It is letting through less voltage, and there's some sort of correlation between Man. How much Yeah.
Scott Tolinski
to turn on. Kind of tracks with the JavaScript
Wes Bos
and those buttons run at low voltage. And when you press it, rid. It flips the switch in the relay that says, okay, If you step on the bathroom scale,
Wes Bos
really annoying because then that thing can melt. And that's because the wires in your house are properly rated.
Wes Bos
rid. Relay library and its name. Oh, you're right. Oh, interesting. I never even thought about that. I like it.
Wes Bos
when when your smart switch turns on. That's a relay. The low voltage DC not anything, but you can tackle a lot of
Wes Bos
I'm on. Now you can go on yourself. So ready. If you look at a relay, there's generally like 5 inputs to it, right? There's a ground and there's input output for the low voltage and input output for Coding microcontroller.
Wes Bos
Is they're just tiny, thin little wires that run to buttons, 1500 a lot of these embedded things.
Wes Bos
Gates for high voltage.
Wes Bos
house wiring Rid. Relays how much And it poses everything to the distance between
Wes Bos
high voltage.
Wes Bos
the stock on your car and then out of the car all the way to the motor. That would be
Overview of sensors
Wes Bos
But so guess what the light sensor is? and Watts is
Scott Tolinski
then fire. Yeah.
Wes Bos
Reporting, almost easier just to buy Clips on Amazon. You clip them on both ends and you're good to go. You don't have to solder mess with the mess with any of that stuff. Rid Nice. Cool. Oh, this it's been really interesting. I I think, again, you know, the A lot of the smart home stuff, I've
Scott Tolinski
millimeter wave sensors? Have you seen these at all? Is that
Wes Bos
Oh, yeah. Yeah.
Scott Tolinski
Essentially, map out space,
Wes Bos
and based on based on how much how moist the soil is, the resistor 20,000 of them at once? No, probably even cheaper than that.
Wes Bos
I don't know. Yeah. That's something for the guest. Yeah, right.
Scott Tolinski
not the same way that, like, a LIDAR is or something like that. But Yeah. It's it's a motion sensor where you can pinpoint
Wes Bos
And it's doing it because the closer you put your hand, the darker it is.
Wes Bos
Yeah. Anyways, there is there is moisture sensors That you can put in your plants For things that need a lot of them. So that is why when you open Car because your USB is 5 volt. Your car is 12 volt. So somewhere in your car, there is a little thing. You can buy 1 on Amazon and you You connect 2 wires to 12 volts a really good example I'll give you is That is it. I'm not gonna talk about soldering today because quite honestly, volts. So you have 1800 watts divided by 120 volts. That means that 18 amps is going through the cord.
Scott Tolinski
They're annoying.
Scott Tolinski
rid. Somebody connected me. It's like putting a battery into a toy. Right? Oh. Yeah. I'm I'm alive. And then it says there must be a All these things are so simple sometimes when you, like, think There must be some missed like, some fancy technology going in there, and and it's just is the,
Scott Tolinski
is it is it connected? Is the circuit connected? If it is,
Wes Bos
Rid sensors. So we talked about the motion sensor. You can pipe all kinds of different sensors into these things, and they all I'll I'll try to fix it. Otherwise, we'll go buy a new dryer. You know? Yeah. It's the worst that can happen. At that point, it's already pooched.
Scott Tolinski
Aqara makes a FP 2 sensor, which is, like, their new one that is, like, not out yet. But it's a millimeter wave radar sensor
Wes Bos
that Whoever wrote WLED, maybe we should have him on the show.
Wes Bos
Programming these ESP 32 specifically program them with JavaScript, so we'll ask him all of our questions.
Wes Bos
I only know that because I had to open our waffle maker a it's called the it will conduct a different amount of voltage.
Scott Tolinski
Yeah,
Wes Bos
PIR is sensor is called the motion sensor. Those are really good. A lot of cameras will have those built in. Rid.
Wes Bos
you know? Wouldn't that be cool? Do what's called power injection. You have to you have to go somewhere down the line of the LED strip and just inject power in So that the power is not traveling all the way to the end. It just I'm just gonna start halfway and and go down from there. And when you say, like, safe, rid. What's the risk of it not having enough power? the balance knob on it. So I fixed that. I fixed it. I turned the knob.
Scott Tolinski
blow on one of my powered speakers at some point, and I was like, you you you read the back. It's like opening this Speaker up could result in death. And I was just like, yeah.
Scott Tolinski
Rid. I that's a great question because it looks cool, but I don't know. It's a resistor. I didn't even know this.
Scott Tolinski
need to get in here. Yeah. Yeah.
Wes Bos
so I just thought of another thing. So at Christmas, Century sent us these boxes Working with lithium batteries is not something I am super stoked about because it's then Something is measured in ohms, so how much residence, and we have that for our home. But at our cottage, Before we sold our last house, I used a razor blade to get all the, like, Stuffed baked on gunk under rid. There also is You're able to pretty much tackle ESP Home at ESPHome.
Scott Tolinski
Have you heard of,
Scott Tolinski
Rid. You know, I had a capacitor
Wes Bos
and depending on how much you've turned it, It will report those values back to the board, and then it's up to you Rid. And generally, you don't want to, like, just, like, fix stuff unless you know why it happens.
Wes Bos
in motors is if you something like ESP32 Oh, I don't have it here. It's in the gym right now. But so I found at a yard sale rid The if you look up photo resistor, out there. There's AC and DC. Actually, there's even is that once I had but then there was also the ability to plug in 12 volts rid. Wire will start to melt or heat up because there's too much it comes default with Wi Fi. You don't need to buy Arduino Wi Fi adapter comes default with Bluetooth.
Scott Tolinski
I think I'm good. I think I don't
Scott Tolinski
Down to, like, a layout. If there's motion in this quadrant or dangerous. Do not touch.
Scott Tolinski
that is basically a motion or a present sensor, but it's able to
Scott Tolinski
this tiny little space or this tiny little space, then fire off using millimeter wave. It's a it's like a new thing. Rid Oh, millimeter wave is not a new thing, but these sensors are new.
Wes Bos
because it sounds like a fire, like a smoke alarm when it goes but I've been sort of digging into it a little bit more myself.
Scott Tolinski
hand is on top of it. It uses a light center length light sensor specifically to do that where the theremin uses like a radio.
Overview of resistors
Scott Tolinski
required at the time. And it's just a common thing you can buy on Amazon and plug it in before you get there.
Wes Bos
Broken electronic I had because I didn't have LEDs on me at the time.
Wes Bos
whatever the LED headlights
Wes Bos
rid You are a you're standing on a very thin little how do how do batteries work? What are the different voltages? You know what's amperages? What are watts? What is GPIO? work, to make them go faster. Pretty fun stuff. And then I took my I got, like, a knockoff Theragun, UI or whether you want to use So if you take a look, A like if your car has aux in, but no Bluetooth, this was from like 10 years ago when not all cars had Bluetooth, you know. So what you do is you just you plug the thing in the cigarette adapter, you plug the aux aux in I started different things. Generally, they're outputting voltage, but they can also output data as well.
Scott Tolinski
Unraveling the mysteries of resistors that I will link to here because I'm sure that explains a little bit of that. I put LED headlights in our Subaru at one point,
Wes Bos
You'd buy 12 volt LEDs, which is what the ATV had initially. So I didn't realize that I thought, oh, there's probably a voltage converter in there for me. There wasn't.
Wes Bos
Usually it just burns out, but I I over vaulted it so high that the thing exploded.
Wes Bos
Resistance comes through the thing and how much the person actually weighs.
Wes Bos
Resistance is used in a lot of day to day things, so your meat thermometer pretty much to detect That. What it will do is it will take.
Wes Bos
but
Scott Tolinski
feel like fluid
Wes Bos
I took the led out of it, and they send a tiny little bit of voltage on the device. Most of these sensors will simply just rid. Return of value. Same with like like another good use is the knob. You could take a knob, There's you go to rid. That needs to run. So your phone, batteries in them. Even most Tesla's out there are running on these. Those cells are 3.3 volts.
Scott Tolinski
Yeah. Yeah. Cool.
Scott Tolinski
Alright. That's not that's not real. I just get that out. I'm sorry.
Wes Bos
So I, That's why there's all these fires with space heaters. A space heater is going to rid. LED lighting in our master bedroom closet.
Scott Tolinski
blew my mind. Yeah, my scales are resistor because when I when I step on it, it says, no, Please stop.
Wes Bos
1 volt or 1.2 volts. The different color LEDs run on a different And the reason why a lot of stuff works on 3.3 volts is so that they can worked really well. Oh, yeah. Also razor blades work super well on windows that are
Scott Tolinski
for electricity? I mean, a lot of these words really
Wes Bos
So I'm not gonna answer that because I don't think I have a good example of of how to describe it. But, yeah, it we can the engineering mindset has a video called a 5 volt power supply Or a old USB thing kicking around somewhere that you can use. And then what you can do is you just take like and then it gives you a little puck that is Bluetooth. And you can just rid. That that adds Bluetooth to your car. Right? So I had that sitting in a bin somewhere. I hadn't used it in 8 years because all cars have Bluetooth now. So I was like, I wonder Rid. Next up, amperage in watts. So volts, we just talked about, come in.
Wes Bos
We by the way, we well, next week, we're having somebody on the show who is going to talk more about Your car is 12 volts. Computer power supplies are 12 volts. Generally, your computer power supply, and if you've built PCs, you probably know this, but All those are doing is they have 2 pins, and there's if the oil is over temp, one of those turns on and they're all burnt out because I bought a clapped out piece of crap. Rid So a foot of led strips and you like turn something into a light in there. Take an old toy, cut a cut a hole in it and stick the light strips inside or are on these devices, a We have and then it goes through some sort of circuit and converts it into 5 volts because that's what USB power is actually needing.
Wes Bos
I think just understanding the basic concepts of them is It's pretty important.
Wes Bos
That is interesting. And then I also learned that's how scales work.
Wes Bos
So when you're when you stand on the bathroom scale, you're literally just bending a tiny little piece of metal And measuring how much voltage can go in and out of and connect them or you need to cut them and connect it around a corner, it's
Wes Bos
So resistance And I guess
Scott Tolinski
to drop down as much as you need. So you could think of it as a kind of like A dam
Rust support for microcontrollers
Wes Bos
Some LED strips, a couple jumpers, will run, most of them will run if you look at the spec sheet, they say they've run from 20 a piece of electronics, especially something like Something that has heating elements or air conditioning or something like that. Be careful because even though it's unplugged, capacitors hold energy web development adjacent.
Scott Tolinski
Yeah. Or I don't wanna scratch off my seasoning of my rid. Cast iron? Rid. Cool. Well, shameless plugs. I'm going to shamelessly plug the syntax Discord. Hop on there and chat. I'll have a link in the show notes. It's a A wonderful place full of a lot of cool people, and everybody's talking code. We're talking about the pod. We're talking about the new website. We're just talking about anything. We're talking about sports and all that stuff. So rid. Check it out. The Syntax Discord.
Scott Tolinski
applications here in programming besides just, like, what can you do with it? I think the general concepts are are fascinating, and I need to
Wes Bos
the stove LED project either if you're into that kind of stuff, Check it on out. I am Wes Boss on Instagram.
Wes Bos
I'm going to The boom box, it said there was an AC in, Svelte compiler or something like that on this thing. But it Seems like a pretty cool project, and that is what we're gonna have our guest on to talk about the different things that he's he's made with him. That's really interesting. I also found this,
Scott Tolinski
Yeah. You know, the blade is too sharp. It's going to cut in there. You know what?
Scott Tolinski
kitchen
Scott Tolinski
And
Scott Tolinski
I need to spend some time in this space just as a hobbyist stuff. You know, my my son is getting more into experiments, and he's like, what kind of experiments can we do? Yeah. And it's like, yeah, we've kind of exhausted the basic,
Wes Bos
I'll shamelessly plug my Instagram. That's where I post a lot of these fiddly things. I post LEDs run on, like, almost, Rechargeable pack. Mhmm. And you could you could plug it in the DC port on the side of the Game Boy. Oh, I know exactly what that looks like. Yeah.
Wes Bos
like this entire board is 4.50 to you can get it sends data to your phone. You can get it's like you can send it to the Peloton app. All kinds of stuff like that, right? So I was like, oh, like, where's the Ant adapter for this type of thing. So, yeah, you can you can get it to work with anything. But generally, are kind of an interesting thing. And once I learned what a resistor was,
Scott Tolinski
rid. Interesting electronics projects. What can we do with yeah, at the back of the I wish I it has all the pins. Yeah. But so so then you have to have, like, wiring for the you either have to, like, keep the microcontroller
Scott Tolinski
cleaning thing. I may have even sick pick this before, but it's cheap. What it is, it's like a A 2 sided,
Scott Tolinski
every single day of my life to do the dishes. Rid
Scott Tolinski
Head on over to syntax.fm
Wes Bos
Arduino for $60 or something like that. Yeah. Having my mind blown, you know? Yeah, yeah, totally.
Scott Tolinski
or drop a review if you like this show.
Scott Tolinski
volcano type of chemical experiments. And I'm not a chemist, so I don't wanna get too deep there. But it's like, well, what can we do with,
Wes Bos
shamelessly a computer power supply will output.
Wes Bos
You can run Rust on this type that you can run Rust or JavaScript on these tiny little devices It was pulling too much current.
Wes Bos
and you're up and running with this type of stuff. It's pretty fun to play with. Okay. Here's what I'm going to sick pick. This is a through 1 pin. And as soon as the water connects this stuff on Twitter sparingly.
Scott Tolinski
Sick. Cool. Well, that's it. Hope you learned something.
Scott Tolinski
Alright. Peace.
Scott Tolinski
this is something that we talked about briefly in one of the other episodes, but the ESP Rust book, which I I you know, if you're into Rust, rid. There is a nice little ESP Rust Yeah. That's all about what you can do and what you can't do. And,
Scott Tolinski
I I do the dishes every day. So I am very happy to use this tool. It comes with, I don't know. It's $10. You could probably find it cheaper on AliExpress or something. But, if you just want a cheaper one out of Amazon,
Wes Bos
on it because these chips are that auto turns on a pump At our cottage, so it as soon as the sprinkler calls for water, it sends a signal, Wi Fi chip rid. Is telling the high voltage Rid. It takes to turn them on and off are 24 volts, Your sprinkler system to open and close the water valves are little switches
Wes Bos
and the light strips off of the same 5 volt power supply. You probably have or I went and I actually just cracked open some Correct? Yeah. If if something is high wattage, that means it is They're often used to either hold voltage or to spike up voltage And then where does the excess voltage go? Sometimes it goes to heat, rid. You know? the batteries are 1.5 volts. Right. So 90 batteries, That trace had too much power go through it, so the trace melted and then Rid. Then when you have voltages in DC, from like, you know, you see like these guys in those big Jeeps and they put those big LED bars or those big spotlights on top of their cars.
Scott Tolinski
dishes are my chore, and I do,
Scott Tolinski
for a full archive of all of our shows,
Scott Tolinski
Yeah. A lot of great ideas here. So check it out.
Wes Bos
Rid. You could even And so QuickJS I'm not going to talk about capacitors. That's Capacitors hold.
Scott Tolinski
yeah, it even involves a lot of the different ESP units. Rid. So that that is so wild to me that.
Wes Bos
plug with colors
Wes Bos
If you got a window that you can't seem to get clean or has a little bit of fog on it Gunk. Or dirt. Your kids put a sticker paper sticker on there, you can't get it off. Yeah. Yeah.
Scott Tolinski
And don't forget to subscribe in your podcast player
Scott Tolinski
our counters can use the razor blade without scratching it. You get a bunch of gunk on the counters. You just clean it off. You got a cooktop, any of that stuff. Or the other side, I use the plastic side for cleaning off dishes or anything like that. And it it's literally just, You know, like, you have a paint scraper, but one end is a a a blade and one end is a plastic blade. And I use it
Wes Bos
rid.
Scott Tolinski
This is not a,
Wes Bos
photos and videos that I recorded over the months. And AC.
Wes Bos
flashing it and connecting the wires and things like that.
Scott Tolinski
razor. One side's a, like, a a razor blade, and one side's like a a fake plastic razor blade.
Scott is interested in learning more about electronics
Scott Tolinski
I can do very basic things. I I am bad at soldering. I soldered 1. I,
Scott Tolinski
prowess comes in and, like, I can install an outlet or an install light switch.
Scott Tolinski
I mean, like, a motion controller that used a Wiimote in college
Scott Tolinski
like, my level of electronic
Scott Tolinski
that used an IR, like, a custom IR bar that I built. And, like, I had to solder that thing, and it, like, didn't work over and over again because I was just really bad at. I didn't know what I was doing, and I haven't gotten any better at that. So I'm interested to hear a little bit about some of the stuff that you have to say here in general because,
Scott Tolinski
I I would consider myself the very much a noob In this regard.
Wes' Bluetooth boombox project
Wes Bos
Has microphone input, all that stuff. And the lady is like motion detectors Things have fuses in them. The pop. You replace the fuse. You did something you shouldn't have. There was no fuse in this circuit or whatever.
Wes Bos
And then I made a little, there's not Basically a wire that is part of a circuit board.
Wes Bos
And that is so that's 12 volts DC. That will power it.
Wes Bos
The balance knob was or a laptop off.
Wes Bos
it doesn't have aux out. So you have to, like Yep. It's it's a little involved. I'm going to do it. It's iffy. Yeah, but I was like, you know what? I do have theremin resistor.
Scott Tolinski
It just just works super well. So it's like a really fun, quick project that I did.
Wes Bos
rid.
Wes Bos
Other ones real quick. I fixed some traces So I went on YouTube, found a tutorial. This happens to everybody.
Wes Bos
And then I Yeah. It's totally. It's actually not a bad idea. I've seen people do it with their dog as well because the. Mhmm. I don't know what the range is for the range is good thing for GPS.
Wes Bos
rid. Headphone adapter that and I tapped into
Back to electronics discussion
Scott Tolinski
garage sale, or it was either a garage sale rid purchase or it was a marketplace purchase? Oh, yeah. Even worse, my parents found it in the garbage in front of somebody's house.
Wes Bos
Sorry for the sidebar, but let's see. Let's get back to our regularly scheduled program. Yeah. It's certainly interesting. So I thought I would talk let's just talk about some of the projects that I've worked on just to give you some context for how these things work. And then we'll get into a bit more of the nitty gritty and how these things work. So rid. My most recent project was a LED backlit mirror for our gym, so I got a massive
Wes Bos
I just glued some Wood to the back and then I rid. It makes different sounds based on where your
Wes Bos
mirror 12 is is On and off and change the color of it Rid. So in Britain, if you open up a plug, And then you can use these little jumper cables that I have here, and the jumper cables will connect But then on another project I'm working on, I had From going from 1 car to another are very thick,
Overview of microcontrollers
Wes Bos
So you you give your lights
Wes Bos
USB I was like, I'll just replace the LED.
Wes Bos
get an old computer plug and use that to give it to 12 volts. But the This this case, the rid So or
Scott Tolinski
the ESP
Wes Bos
And then it has a whole bunch of rid. And amperage is the amount that it that it flows. And that's the old saying is that volts don't kill. It's it's amperage.
Wes Bos
12 volt, but this is very much an enthusiast there's somebody out there that sells a moisture sensor you can plug into these ESP 30 rid and you can just put them in, you know, for $6, you could put 1 in every plant and have Wi Fi based And those pins can output voltages throughout your car. So what most things in your car are there are input and output 24 volt AC, which is kind of odd, everything else in JavaScript, which is nice. I see you can use the sync away. You can use your variables as if you're used to. And Quite honestly, that's kind of what I want is that If I can put this in the boom box, so I open the boom box, I got my little meter out, I found 12 volts DC, of current and watts. So if you think about Or a dryer to spin her out.
Wes Bos
And generally you power them hook up, like, a little motor to it that spins something around. You know, that's always exciting for kids as well. Yeah.
Wes Bos
what are called Rid. For that hardware I don't really mess with that all that much. I have a few things here or there, but it's not worth
Wes Bos
on your the little button to turn them on rid. ATV soldered in the LED. I was like, done. Put it in reverse. Boom.
Wes Bos
GPIO general purpose input output.
Wes Bos
chip in it, and it knows, Okay, when you're sending me Rid. Or the other the other thing is you just you just solder on resistors And a really good example of that is, 1800 watts is a space heater, and that's the max that And then the battery compartment was took 9 d batteries rid on these microcontrollers, You give it, I think, 5 volts Sick pick today. I'm going to sick pick the ESP 32.
Scott Tolinski
the lights both need rid. Twelve volts of power.
Wes Bos
a 12 to 12 to 5 volt converter. And that's generally what you have in your it basically allows you to turn on you can then pipe that voltage into something else like
Wes Bos
are there's 1 for voltage in.
Wes Bos
the Arduino has been popular for a long, long time, but it's Sort of recently been upstaged by this one called the ESP32 at DeWalt adapters.
Wes Bos
12 volts. You can get them in 5 as well, and then you give it a data line that is coming from this thing. And the data line is what's sending to the The LED lights and the LED lights, every single one has a tiny little This I'll hold it up For you, Scott here. And maybe maybe this will be on YouTube at some point. Okay. This is called an ESP thirty two, But yeah, and you can use either what's called a breadboard.
Wes Bos
There's tons of different microcontrollers like, a
Wes Bos
and what color to change to and whether I should be on or off. So So that's what this thing is doing is it's not sending it the voltage. The voltage is you have to get a 12 volt power supplier,
Scott Tolinski
So But you do need to power them both. You need to power both. This thing's not sending power. The ESP can be either powered by
Scott Tolinski
Like, they need to be powered separately. The ESP needs
Wes Bos
because Those led lights that I was talking about.
Wes Bos
I believe it is 5 volts.
Wes Bos
there's lots of threads of people that Cook them, which is nice because these are $4. You don't have to worry about, oh, man, I crossed some wires and the thing It's amazing. Like I didn't write any code. There's this software called WLED that it runs on. Rid. So basically what I did is I got a 12 volt power supply. I got a microcontroller. I'll talk about it in a second. Ran the software on it.
Wes Bos
you if you fry the thing, rid. Who cares? It's $4, a resistor a lot of items that will handle a range of voltage.
Wes Bos
that you see when you Google something like an Arduino or ESP32.
Wes' LED mirror project
Scott Tolinski
Rid. And does that something like that become Z Wave, or is it just straight up Wi Fi? So it comes baked in with
Scott Tolinski
rid As long as it's on your Wi Fi network, it'll work all the time. So
Wes Bos
which
Wes Bos
and then it reboots. And then all of a sudden the thing broadcasts on a local domain on your local network the the actual anything like that, this little, razor scraper works really well. Oh, I have this exact one. That's amazing. It's it's honestly so good that you have plastic, because so many times there's, wherever you want it to be and much easier just to buy these clips If you need to cut them It's going to do 1 of 2 things. It's going to say I'm having trouble turning.
Wes Bos
rid. Wi Fi and Bluetooth.
Wes Bos
Garmin based those LED strips Are called ws 2815bs, your computer, everything, everything is just taking in a minute timer then input it into one of the GPIO pins. And there's Schematics online about which GPIO pins are good for different types of things.
Wes Bos
And the stuff on it is it's kind of like when you you go on YouTube and you search for like smart home stuff. A lot of that stuff is enthusiast, And they're flickering like crazy. And the reason behind that was because going through it at once.
Scott Tolinski
like that makes me very
Wes Bos
which I found.
Wes Bos
networking and IP addresses and whatnot, you can get up and go in and You literally just plug the thing in and it finds it. You know, there's no, like, port mapping or USB unsold or something And glass went everywhere. I'm so lucky to keep my eyes. So what had happened with everything, once I had a good base of I want to be able to code this stuff in a language that I'm familiar with
Wes Bos
New or whatever the URL is, and it uses web serial and then it becomes or it can be powered by direct Oh, that's good. There's all kinds of different resistors out there. And quite honestly, I don't know a whole lot about them, you can lick a 9 volt battery, And the guy's like, oh, it just needs to be charged. I don't know, $5. So I bought it for $5, and the specific data. I know how dim There's Esprino, Yeah. Love my my pay grade.
Wes Bos
that's the LED lit mirror. That was really fun. I also just did a Bluetooth boom box,
Wes Bos
So 6 pairs of shoes in the washing machine, And apparently that's too heavy on our dryer. This is why it's helpful to understand how it works. So I put did I tell this story? I don't know. I don't even know if I know what a trace is. So I put, like, before the speaker amplifier.
Scott Tolinski
Can you elaborate on what that means to say I've ran the software on the microcontroller?
Wes Bos
because is an implementation 5 and 3.3,
Wes Bos
pretty like as long as you understand, like, a little bit of
Wes Bos
on it that and take ours out because it scared the shit out of our dog. He would hit the deck every time So that's microcontrollers.
Scott Tolinski
Yeah. In the last rid 5 seconds. You could have it flashing for the last 5 seconds and then go right. Just the the tail of the last 5 seconds could be flashing. Like, Again, there's Oh, man. 300 LEDs on this thing. I have control over all 300. Question. When when you say you run the software on it, rid. On the microcontroller.
Wes Bos
proprietary WiFi is the best this kind of stuff is has its own UI, Oh, I had a Game Boy, and my parents bought me like this like NiCad dynamics anyways or water. There's a really rid. I would probably defer to some of the YouTube experts in this because
Wes Bos
And now I have this, like, wicked backlit mirror in our gym that you So I was like, whatever. It's fine.
Wes Bos
protocol that it sends data and it looks like they started it networking adapters. Pretty much anything you can hook up to a Linux computer, a Raspberry Pi can do, Right? It's just a small little computer.
Wes Bos
You jump on that. You give it your WiFi password So there's a couple of giveaways It exploded Okay. And then if you want it to do other To be, man. Other things, you have to get different radios for it. So people extend them, right? So one thing I was looking into is we have a spin bike the cottage and the dock is far enough That every time I walked to the dock to look at the water, it says, hey, you forgot your dog. Yeah. I was like, he's he's inside. And I I guess I hadn't, like but basically you can run
Wes Bos
Ant, which is or Ant Plus, which is some start to heat up, especially if you go on very long runs as well. The longer the run, the thicker the cord you need as well. There's all these calculations in terms of like
Wes Bos
a serial interface on this thing. You plug it in via USB, it flashes it And of, like, Christmas gifts. They do it every year. They always have some really cool stuff. And they do one thing. They did this, like, Interesting Smaller microcontrollers WLED.
Wes Bos
And it's very similar to an Arduino. You've probably heard of that. Mhmm. And it has a Wi Fi chip in it. It has a Bluetooth chip in it, and you can run software on So people have written software 6 by 3, So my parents were just walking by somebody's house, and I guess they were renovating their bathroom, and they just had the mirror sitting out front for free. So they grabbed it and it was the perfect size. Gosh, like $500 to buy a mural that big. I'm very jealous. Yeah. Yeah.
Wes Bos
And I think we're developers, so we are more technical than their average enthusiast user.
Wes Bos
in a web browser.
Wes Bos
strips. And then then you put a fuse in there. And what will happen is you can get a fuse that says, all right, this is the 5 amp I have I have not seen that. That probably would not directly work with this type of thing because because it's software. Yeah, a lot of software. Yeah, there's probably some sort of computing going on The more amperage you have, the thicker the wire you need. That's why your jumper cables is absolutely tiny, and if you have wire that is too small for the amount of amperage that can go through it,
Scott Tolinski
And, you can you get all the software that that controls it all. It's pretty unreal. That's so cool. Yeah. It feels like when I hear about, like, flashing software to a microcontroller,
Wes Bos
because my wife does a lot of workouts. Yeah.
Wes converted a massage gun to battery power
Wes Bos
And I just converted it to In North America, it's 120 in between the power, the 12 volt and the LED, and that will drop the voltage from 12 down to whatever is required. You buy different types of resistors
Wes Bos
rid Run on a DEWALT battery. So now I have a DEWALT powered Theragun, and it works great. It's awesome.
Wes Bos
per piece on AliExpress.
Wes Bos
On contrast, an Arduino or an ESP32 a whole lot of of stuff in them, if not anything. So The That is meant for
Wes Bos
You can hook up a monitor to it. You can hook up, doesn't the power to the The power to the motor of your windshield wiper doesn't go from the battery and different components On your your border are going to need those different voltages.
Wes Bos
a little computer rid and go for it. It's generally better to use connectors, from China. How much does it cost I Rid. Generally, you can buy attachments. So I bought a bunch of little It gets loud as hell because I inputted the audio before the amplifier of the speaker.
ESP32 microcontroller recommendation
Wes Bos
So all the code examples, space And, rid. Down to 5 volts. And that's really cool because if they have a range, GPIO, I talked about that in and you should take a I've hacked many kids cars. I have the one of the batteries in it was fried.
Wes Bos
out there. But if if you are interested in getting into this right now, So if your wiring in your house can handle 18 sorry, 15 amps, but your extension cord, you might have bought at the dollar store And it can it can't handle 15 amps. And there's nothing WiFi based sleep tracker. You want to integrate it into home assistant. That's kind of where you want to go if there is too much current Traveling over an extension cord or a cord for a kettle or something like that, on it. So 12 times bigger than 1.
Wes Bos
there's nothing to really to sweat about there.
Wes Bos
Let's talk about voltages.
Tip for using AirTags to track kids
Wes Bos
we went to the cottage or saved stories, whatever those are called, so that you can go back and see kind of what's going on. I just did the whole gym build into too big. It's 200 Is it only letting some electricity through or is it literally dropping the voltage? And then along the sides of the boards because it's not like my doing your hands. Rid. Exactly. So what I did is I just converted it. Unlike AliExpress, you can buy these I promise there will be some JavaScript there's some, like, trickiness of
Scott Tolinski
Yeah. I love a sidebar. You know, we were talking just before the show started about Stuff that we had our key chain on our key chain. And I mentioned that all I have is, like, an AirTag and whatever.
Scott Tolinski
That's actually rid. Good idea to put them on a dog collar. That seems like a great idea.
Scott Tolinski
If you're gonna be somewhere where your kids are running rid. Wild, like, we went to some kids' play place for their birthdays recently. Yeah. We pinned AirTags on the kids. What Oh. Revelation.
Scott Tolinski
I'm at home.
Wes Bos
rid. That's the the dog starts running when it knows who's a snack.
Scott Tolinski
I have a nice little tip for you and anyone out there who is a parent. This is a tip from my wife who got it from Instagram from somewhere.
Wes Bos
We have 1 on our dog, and it's great. It's hilarious because Turn the lights on or turn the lights off. Right. At that point, it's just home assistant. Right. You can just turn things on or off or react to specific events.
Scott Tolinski
That was so great. That was a great idea. It works so well. You just pin the little AirTag. You can also we heard from other parents there who had done the same thing that said that rid. You just hit the button to make the sound and say, hey. When it starts beeping, you gotta come to go running. Food. Yep. Yeah. Pavlov. That's,
Coding microcontrollers
Wes Bos
Rid. You can't just run when it is warmer than when it is cooler, And it's kind of cool. So if you're putting 12 volts through a cold resistor, you might get 12 volts out the other end, but then you heat it up. And the more that it heats up, the less voltage that is passing through the resistor. And that's how that's how most thermometers work, which blew my mind To actually learn about Got an entire web server running
Wes Bos
All the different sensors, magnetic sensors, weight sensors, all of that good stuff. I did link up a millimeter wave human presence sensor as well. Oh, awesome.
Wes Bos
Io the drier I burned up the trace, there was too much amperage being because there's water on the ground, then the water will go in the other pin and they'll say, The darker it is, the different voltage that it reports, and then of JavaScript and then the flow of power stops before anything worse can happen. So is this why the Technology Connections Put all the guts inside the battery case because it took like 9 d batteries or something like that.
Wes Bos
temperature sensor, humidity sensor, And those will make a noise like.
Wes Bos
enough space on them. There's not enough memory.
Wes Bos
to look at You don't need soldering for a lot of stuff. Even with a lot of the LED stuff, So I haven't I haven't done rid. Very much So rid. Oh, that's a good one. I I was like, okay. Like, I wanna put, like, a Google Home in this thing because I I want to be able to stream my music to it. And I was like, I didn't have an extra Google Home. And and the Google Home stuff, wiring inside of the LED strip Arduino based.
Wes Bos
on it. And I went on like the GitHub. I was like, man, like,
Wes Bos
Is kind of the spot if you want to make any of these things yourself: a 12 volt
Wes Bos
and And you would be wasting a lot of money running thick wire and So a good example of that is Even the Arduino IDE works with it. So rid. You should wait for them to discharge. I'm not gonna tell you how to discharge them manually.
Wes Bos
Is he running react for this interface because he has a whole it's a whole web UI that's running on this tiny little computer here.
Wes Bos
Web serial port is another one. Johnny five is kind of an interesting project as well rid. For robotics, And as the resistor bends under your weight, DIY projects without
Wes Bos
They're not powerful. They run embedded code, right? They run C ready. Working with microcontrollers, the microcontroller I let the smoke out. Right. Like, if So there's 2 types of voltages on the board to actually do what you want with that specific data. Our British listeners are going nuts right now, man. But transmitted over A breadboard is just a grid of holes
Overview of DC and AC voltage
Wes Bos
they can be powered by a battery Rid. There are some threads that say you can run it on changes The wire size or in my case, the trace.
Wes Bos
But like in my case, remember, I said I needed 12 volts for the boom box.
Wes Bos
opens and converting it to DC so it will run. And that's why Give me more energy. This is that's what Amperage is.
Wes Bos
they will they don't run on 24 volts, but the controls fuse. If there is more than 5 amp traveling through it, the fuse melts And you when you put your thermometer in something that is hot, is using what's called a thermo resistor.
Wes Bos
battery.
Wes Bos
have boom, it's It's Bluetooth enabled. I can turn it on and it works great.
Wes Bos
AC and DC AC is what's in the wall at your house. DC is
Wes Bos
Rid. So those find rid turn something into a lamp, you know, and you can show them the whole process of They're all very simple. The sensors themselves generally don't have any set of voltages. Mhmm. That makes sense. The ATV is 12 volts. So or have data being sent out.
Scott Tolinski
a. K. A. Your entire month's salary.
Wes Bos
Rid. I opened up the boom box
Wes Bos
I listen to a really interesting podcast once about So I Like a sticker you wanna get off of something, but, like, using a razor blade will likely scratch it.
Wes Bos
and 9 times those motors need thick wire of those little 12 volt cars.
Wes Bos
you can power them from a number of different things. So in my case, and you have to measure the voltage going in. And then at the very end of the LED
Wes Bos
servo on them that goes rid And, use what's called the relay to turn on the pump. And then the pump starts pumping water from the lake, and that feeds it into the sprinkler system. That was a fun one
Wes Bos
dropping it down to a much lower voltage, and also converting it to a DC signal.
Wes Bos
on the back of Every time I walk to the dock, it's like, oh, you forgot your keys, your AirPods, your dock, and your backpack.
Wes Bos
need a 24 volt with the WLED software, And then you can use that data to say this is how moist this thing is. So I thought like
Wes Bos
rid. 18650 and then you it will return to you a signal, and I don't know for $20, $30, you could get some combination volts.
Wes Bos
A floodlight
Wes Bos
opens up for you. So
Wes Bos
and I powered it with a drill battery. So I hooked up 1 to a DeWalt drill battery, and now I have, like, the brightest
Scott Tolinski
volts. So how did you know it was 12 volts?
Wes Bos
rid directly. So I said, Okay, well, there must be a converter in there around the entire mirror. So basically, the wood was a couple inches inset to the back of the mirror. And then around that wood, I glued LED or it has a wall wart rid Get in too deep for a lot of the stuff I'm gonna talk about. You don't even know how to sort or something, which is you just plug in stuff together and and run-in you know? So but also just the basics of, like, Every single thing that you plug in has some sort of power brick run on high voltage DC or something like that.
Wes Bos
in 120 AC from the wall and it will output 12, and the spin bike has will I've heard that word. Detect how and it works with your hand, Where the resources on it are extremely limited. So this is different from like a Raspberry Pi. A Raspberry Pi is literally a tiny little Linux computer.
Wes Bos
flashlight in the world and lucky me, there was 12 volts in there because, again, most stuff runs on and then you input those into the GPIO.
Wes Bos
that runs off of a standard dual battery.
Wes Bos
an input.
Wes' project fixing a broken dryer
Scott Tolinski
Yeah. Well, especially with, like, something high voltage,
Wes Bos
Just soldered a little jumper wire on from before the burn to after the burn.
Wes Bos
you know? Yeah, exactly.
Wes Bos
But the thing about several different popular voltages out there. Pretty much everything is in line. So if you if there's a possibility ready. Shipped uncomfortable for every day because it it doesn't it doesn't sound hard, but it feels hard, you know? Yeah. Rid. Yeah, it it can be hard. But the thing about all the stuff that I talk about today is that I have a question. Where do you think I got it? Do you think I just went to a store rid. Got it. If I'm gonna guess you, I you you you were walking out, and you saw it on on somebody's, How close someone is to something? Well so, like, there's a, the windshield wipers on your car. So when you turn the windshield wipers on in your car, electronic items
Talking about electronics for beginners
Wes Bos
Is tinkering and fixing and playing with
Wes Bos
Sometimes you get into these things and you You got to hold it for a minute or 15 seconds. And I was like, how do I rid. Visualize to put a WiFi chip in a smart home device when you're ordering at last count, I think 5 or 6 is the more current there is. In my example of if not all, Arduino stuff works with the ESP 32.
Scott Tolinski
Code that somebody else wrote. Yeah. I'm really excited because I
Wes Bos
Something that is very interesting to a lot of developers, including myself, that open up twice a day or something.
Wes Bos
around the house, so coding on these types of things, and I glued From where? that only run specific languages I took a rid. Most people are running it on 12 in a car, but I took them the photo resistor And the reason behind that is because think the hardest thing with that would be like getting power to it. Rid. I often wonder if you could put a battery on it and program it to wake up Like I'll post like 1 photo of something I'm doing on Twitter, but like I'll post literally every single step of what I'm working on in Instagram because it's a great medium and I've recently been trying to go back and Put them into, like, Instagram memories It's Amazing to me that you can get something for so affordable watts, So I just took the logic board off and I looked at it and there's a trace. A trace is if you if you goof it up.
Wes Bos
how electronics if you open it up, the thermostat that I use to heat my floor in my office, If you open it up and you look at it, it's going to say it's pretty heavily, heavily Then you get up to 5 volts is USB power, 12 volts.
Wes Bos
anything, because I want to be able to say when somebody walks in front of these LED lights, turn them on like I'm going to do out of voltage that is not safe and the thing could burn out or it could decrease the life of it Or it's very unlikely, but rid Moving that you need to plug in and you can't just plug in straight voltage. It's because it's Taking the AC, And basically anything it does, it changes color, it dims, it turns on, it turns off. It sends a message out For like a watch project, kind of an interesting read, but The risk of not having enough power is programmatically.
Wes Bos
electronics for beginners.
Wes Bos
in the show, But we're gonna talk about serial mapping or weird cables or anything like that.
Wes Bos
you start looking at tutorials and you're going, oh, my goodness. Like, I I don't know what any of these things are. And what I found So pretty wild times for that type of stuff. I remember buying an there's a buck. Take it, take it or leave it. 1 of the speakers broken, she said. So The speaker wasn't broken. She just had the I'll link up the which ones I used. But essentially what they are, they are addressable individually addressable LEDs, meaning that you can turn every single one with usually it's 3, 5 or 12 volts. I'll talk about that in a second.
Transcript
Announcer
You're listening to Syntax, the podcast with the tastiest web development treats out there. Strap yourself in and get ready. Here is Scott Talinski and Wes Bos.
Wes Bos
Kind of an interesting show for you today that is Those wires running up behind your thermostat are carrying 24 volts. Rid. Baseboard heaters, Voltage dropper in it. And basically you gave it 12 volts in and then it it had the chips on board to convert the 12 down to 5.
Microcontroller coding resources
Wes Bos
and write functions as I'm familiar with them and not like a positive and a negative rid. You're allowed. You can say, like, don't tell me if I leave my items at this car adapter for Bluetooth.
Wes Bos
And that doesn't mean you can npm install every package under the sun. But what it means is that you can interface with rid. Put juice batteries in new batteries, in So.
Wes Bos
JavaScript will it outputs voltages and signals. And we'll talk about what all that is. But So all you have to do is you literally flash the thing
Wes Bos
all of the APIs.
Wes Bos
I'm not installing like a so Elevators in San Francisco or you can plug in your own 12 volts, which is good if you want to Plug directly into your car and have a boom box.
Wes hacked kids' electric cars
Wes Bos
from the controller. And then I take the signal from the controller Rid It's pretty sweet. So Built a sprinkler system So if you have a And
Wes Bos
a yard sale.
Wes Bos
replaced batteries, put drill batteries in it So basically, power is going from here to here, right?
Scott Tolinski
water is always available, like in the city, right? You have to have water pressure before the sprinklers push it out.