Browsing Tag

electronics

Musings & Meta

Raspberry Pi – Stupid Beginner Electronics

I’ve been doing all the drone stuff, which is a lot of electronics. I have some knowledge, like really basic stuff, but I’ve never really played with hobby electronics stuff in the past. My dad and I built a computer from parts, and from there my interest has always been in software. I like typing, and I’ve always felt like I could make a computer do anything. With hardware, I’ve let the magic smoke out more times than my wallet is happy with!

I bought a Raspberry Pi a month ago, because we’re looking at building some race timers for the drones, because…why not. But now that I have this thing, I started looking at other fun things I could do.

One of the things in my head has been to try to teach electronics to some of my wife’s little-cousins and nephews and nieces (she has a few). So I’ve been thinking about how to do that, and it starts with an easy project like…

IMAG2489.jpg

Attach some wires to a breadboard, put a resistor (180Ohm) and an LED in. Write some code to turn the light on and off, because I want to show both sides – hardware and software. Here’s the code, in Python, which I’ve never written anything in before yesterday:

import RPi.GPIO as gpio
import sys
gpio.setmode(gpio.BCM)
gpio.setwarnings(False)
gpio.setup(18, gpio.OUT)
if sys.argv[1] == “on”:
gpio.output(18, gpio.HIGH)
else:
gpio.output(18, gpio.LOW)

I started doing some reading on how to explain electricity and electronics to kids. It’s not an easy concept, and analogies can help. Some people think of it like a water-pipe – it all has to be connected in a loop to work, water flows through the pipes. But resistance is weird, and voltage as an analogy to the force of the water is weird.

I wondered if using “force” as a starting point was a better idea: hold out your hand, and I press against it. This is voltage. When I press harder, that’s more voltage. When you try to stop me, that’s resistance. Amperage gets lost here though, but I was thinking about moving to objects-in-hands – this brick (cause I’ll totally have a brick handy) is more amperage than this feather?

One article I read suggested not trying to teach the concepts until you’ve done through the examples, and lots of different examples. Probably a better idea, since you don’t need to know how many amps are running from the Pi to know that it will power that light. You do need to know to put a resistor in the circuit with an LED though, I’ve read you can blow out your Pi that way!