HACKER Q&A
📣 paultopia

How to learn small electronics and HW interfacing?


I, probably like many of the people who read HN, am satisfactorily competent at slinging code but have absolutely no clue how to make that code talk to the physical world. Like, suppose I wanted to attach a motion sensor to something: unless the sensor comes with a USB cable and a well-documented Python API, I'd be out of luck.

HN, what are your recommendations for strategies, books, projects, etc. to learn this stuff?


  👤 blendo Accepted Answer ✓
At age 62 (18 months ago) I took a 1 day “ham cram” and got my technician license, and bought a couple of $25 vhf/uhf walk-in talkies. And played with homemade antennas for a while.

A year ago I enrolled in my local community college’s Electronics 101 course, which meant resistors, voltage, current, capacitors, and inductors. And voltmeters and power supplies.

Six months ago I took Elec 102, which are transformers, diodes, AC to DC rectification, transformers, and, voila, transistors.

Next step: microcontrollers, sensors, and relays.

Future: relearn imaginary exponents and Euler.

It’s a _big_ field!


👤 mkhcodes
As others have stated, start with an Arduino. Have fun.

But I would recommend as a next step is to find a component that is more complex than an LED or Switch and with relatively good Arduino libraries (e.g., a 2x16 LCD screen) and try to write your own driver for it (e.g., a library that does all of the handling of the IO pins), using the data sheet of the component to figure out how to use the IO pins. Feel free to look at the Arduino library source code (or libraries for other languages).

I have done the same, using Rust and a Feather M0[1] and am now finding it easier to look at the datasheet of the more complicated ATSAMD21[2] microprocessor.

1. https://www.adafruit.com/product/2772

2. https://www.microchip.com/wwwproducts/en/ATsamd21g18


👤 saluki
I'm just getting started with arduino. This is the tutorial I followed for my first project. Pick something that interests you and find a tutorial.

https://www.reddit.com/r/PUBATTLEGROUNDS/comments/9q4rph/hea...

Other projects that are in the queue:

Similar to the first but with a sensor on the headset- https://www.hackster.io/news/easily-add-head-tracking-for-an...

Overhead Garage Door status indicator lights- https://www.instructables.com/id/Yet-Another-Garage-Door-Sta...

Roomba Virtual Wall- https://github.com/MKme/Roomba/blob/master/Arduino%20Code/Ro...

You don't need lots of parts and most are inexpensive, for the soldering gun and holder I got those at harbor freight, I order all the other parts off amazon. I did buy one of elecrontics part kits with lots of small components and a few breadboards.


👤 h2odragon
Go get you one of the cheap Arduino clones (or several!) and a starter kit with sensors and lights to play with. The Arduino Mega clones at $15 or less are worth keeping a few in stock; and you'll never worry about burning one out or leaving a thing assembled for a while to blink its light because its fun.

https://www.adafruit.com/ is a good place to go for information, parts, and excellent service.


👤 Obsnold
I think arduino is a good place to start. If you want something slightly different I like the teensy which is arduino compatible and can plug into a breadboard. I'd pick up a basic electronics kit as well that includes a bread board and a bunch of components and then you can actually make some basic circuits with LEDs and sensors.

https://www.pjrc.com/teensy/teensy31.html https://www.amazon.com/s?k=basic+electronics+kit+for+breadbo...


👤 dmavila
I recommend you also check out Ben Eater.

https://eater.net https://www.youtube.com/beneater


👤 runjake
h20dragon mentioned https://adafruit.com. Just comb through the info and tutorials on this site and grab yourself a basic Arduino kit and get started.

👤 iamcreasy
Documentations on Sparkfun is also very useful.