Ask HN: How to get started with practical hardware?
Hi HN!
For a long time, I've wanted to learn how to build projects which "bridge" the gap between software and hardware. I've learned to solder decently well and operate 3d printers, but have found myself absolutely stumped with progressing to a real practical project.
Sample projects which get me excited: microcontroller to turn coffee machine on some basic SMS controlled minibot- really anything practical, so I can start to deeply understand the harware construction process / first principles of hardware.
Are there any seminal (and practical) guides, books, or projects which could get a software engineer well-acquainted with the basics of hardware? Check out Ben Eater at eater.net, he has 2 kits, one where you build an 8-bit CPU, and another where you build a custom computer using a 6502 CPU, all on breadboards (no soldering). The newest third kit is a very primitive VGA card. His Youtube videos are a great resource and really help you understand without just painting by numbers. I would second this, if you really want to learn hardware then Arduino (etc) won’t help as much as jumping into something a bit lower level. Ben’s kits and videos are a fantastic resource, and you can progress to more in-depth stuff like rc2014.co.uk or rosco-m68k.com (yeah, shameless self-plug at the end there :D). A particularly well-suited project is to make a (mech) keyboard. It is good because the basics are simple, and you can "complicate" it in any dimension: - Weird shape? Check
- Add a trackball? Check
- Crazy layout? Check
- Add a mini-lcd screen? Check
- Get nuts with actuation points? Check It has a large and healthy community, and people are receptive to nuts ideas. Agreed that keyboards are a good early project. To add to that, if you play video games, leverless arcade controllers can be a fun build also. Pretty similar overall as far as parts and shape, but the firmware they run (stuff like GP2040-CE or HayBox) make them act as controllers instead of keyboards, and they can even work on game consoles. Specifically I'd recommend the Flatbox rev 5[0] and the Open-Frame1[1]. Seconding this. It's how I got into electronics myself. I'll add that you can complicate the software in much the same way-- the basics are pretty trivial, but you can go nuts with customization. For one of my keyboards, I implemented my own USB handling using the hardware USB registers just for "fun" (and education, and to be able to say I wrote every line of code running on it). Get an Arduino and write HelloWorld. Then add sensors (inputs) and actuators (outputs) to make something more according to your interests. Rinse and repeat. Why not start with some lowkey Arduino or Raspberry Pi Pico projects? I found the cost (five years ago) was what put me off, but it only took me a few hours to get up and running with a very simple led flashing project. Then life got in the way, but simple temperature sensors, light sensors, etc. can make for some interesting quality-of-life projects. Edit: For additional
context, it was a self-driven project (no instructions). Incredibly easy to get into. Getting a simpler CUDA program running took me longer; and I gave up altogether on OpenCL after spending a frustrating 12 hours. Mechanical or Electrical with software applications? A search engine(s) can provive a way to explore/find specific diy project(s) of interest. A few diy project sites [0][1][2][3] and/or ready made kits[3] starter examples. [0] : https://www.openhardware.io/explore / https://hackaday.com/ [1] : https://www.hackster.io/ [2] : https://www.instructables.com/projects [3] : https://shop.evilmadscientist.com/directory
https://www.thingiverse.com/tag:diy_projects
https://makezine.com/ https://www.colorado.edu/faculty/bogatin/projects-students/w... I found the following books quite useful in my study of "Embedded Systems/Hardware" coming from a purely Software background. Without overwhelming you they provide just the right level/amount of Hardware knowledge to get you going. 1) Designing Embedded Hardware by John Catsoulis. 2) Introduction to Embedded Systems: Using Microcontrollers and the MSP430 by Manuel Jimenez et al. 3) Prototype to Product: A Practical Guide for Getting to Market by Alan Cohen. You can also look at using Digilent equipment (eg. Analog Discovery 3 or 2) and learning materials along with Arduino/MSP430/whatever to get better practical insight into your system - https://digilent.com/reference/landing and https://digilent.com/reference/learn/start It depends, on what you want to do. - Electronics is now huge, and have few extremely different parts, which could be all in one project. As example, you mentioned 3d printers, they have digital part, power electronic part and some could have optic (vision) part. To be honest, in University typical person learn few years, and become master in one part, and learn others by books or now by videos. What I see from my experience, nearly all programmers absolutely don't understand chemistry, and it is really important for electronics, because you could damage expensive components with wrong chemistry. Second thing, physics, probably astronomy good fit. Electronics itself is not hard, if you know enough chemistry and physics, but without them, will be constant impostor syndrome. For example, once my buddy worked with large batch of mobiles, and he bought new Flux, claimed "not need to rinse off". So he made manipulations, and try to turn on - 1,2,..,5,..9.. Well, whole batch not worked. Imagine, his feelings! He asked professional, answer was: "you don't need to use chemical additives to rinse off, but you must use just clear water, then sure dry board". And it really helped. Chemistry? I barely studied that at all. That’s why it’s meant to be taught in highschool You needn’t be an expert but you should be able to read the chemical terms and data in a data sheet and not make a dangerous or sufficiently risky choice on component selection This is especially important for hardware applications in adverse environments For example, knowing that you need to use a tinned copper alloy if your device is going to be used in marine environments rather than pure copper due to it reacting to chlorides dissolved in sea water Or realising that you would generally avoid using batteries as the energy source for mission critical activities in polar areas as the chemical reactions for SLA or Lithium batteries are dramatically inhibited at sufficiently low temperatures These aren’t hard intuitions to grasp and follow when designing a system, but you can find your design can go catastrophically wrong even a few units outside every component’s operating temperature or overall environment Graphs and performance on datasheets are generally linear but the consequences of erring too close to the metaphorical sun may be anything but linear! I took chemistry in high school as well as one course in university. I'm not saying it isn't useful but doesn't feature prominently in an EE curriculum. It is mostly math, physics and EE specific courses. Ok, how you will learn polymer capacitors without chemistry? Or for you normal to make broken tech, just because you don't know chemistry specifics? You don’t need to know chemistry. Read the spec sheet for voltage and temperature limits. Observe voltage polarity, if necessary. If you need more general information on how to choose which type of capacitor, read The Art of Electronics. i = c*dv/dt That is what the EE knows, not necessarily how to make a capacitor from scratch. A lot of time was spent on leading up to understanding how semi-conductors work however. Including modern physics and requisite math, particle in a box, wave functions, etc. My journey to IoTs was through home automation, specifically using Home Assistant. It allows to quickly integrate some hardware through a unified protocol (MQTT, or worst case HTTP) and your van write hardware code easily if you have any dev experience. Or just use ESPHome and YAML. Coupled with 3D printing you can build near stuff (I will have the surprise of a 3D printer for Christmas :)) That's fun but I'm still missing some fundamentals I can't exactly put my finger on. Like: how to prevent microchip overload, how to stabilize a circuit, prevent rush-in current, handle different voltage levels, etc. I know how to drive a servo with an Arduino, but this still doesn't help me truly engineer a circuit. Ah ok - well I was in the same place as you a few years ago and asked a very similar question here - and got interesting answers: https://news.ycombinator.com/item?id=16920476 5 years later I did not proceed with the electronics part. For one I did not have time but even now I realize that learning to properly do things in electronics requires serious studies. A typical problem I had was: how should I connect a loudspeaker (which resistor, capacitator, etc. to add and where). I found out that it is better to use "building blocks" that include all the electronics and require cabling and coding. For instance, as we speak, I am connecting a NodeMCU to a relay module and all I need are cables and a 3D-printed case. This is really a matter of personal taste though - I prefer to code than to design electronics gven that I have limited time. reposting this tutorial I made some time ago to help bridge the divide between the internet and microcontroller pins, at the end you get a physical Hacker News Badge - https://github.com/jareklupinski/hackernews-badge Having spent 2023 doing exactly what you aspire to do, I have some casual friendly advice: go into this problem-first. While everyone learns differently and finds motivation in unique ways, nothing pushes me through all of the layers of frustration and learning like having an end-goal that I'm passionate about realizing. On the contrary, just hitting a list of things to learn in an arbitrary order hoping that it will stick when I actually need to get something done is like driving high speed into a wall. When you approach a problem, the correct answer to "what next" is usually pretty apparent. In my case, for example, I had no idea that transitioning from software development to "hardware" (which really is just software running on hardware) would involve detours into learning Solidworks CAD so that I could model enclosures as well as render out what things will look like before they exist. Another major area that I drastically underestimated was connecting the dots between the parts/components I use and the logistics of sourcing and using those parts. For example, the parts that are easily available on demand at JLCPCB are not only vastly different than what you can get from Digikey and Mouser, but they often need to be ordered in quantities of 100+. It's also "fun" realizing that if you want KiCAD to have nice looking 3D renders of your future board, you often have to go off hunting for 3D step files of each part. You are about to learn how it's common to make an order at Digikey that is actually shipped to JLCPCB so that they can assemble your board. They will even hold on to your parts in between orders. Get comfortable with Octopart! One project that I recommend is to actually implement your own MCU board instead of relying on prefabricated Adafruit or Arduino boards. Not only will it give you more flexibility, but there is something really gratifying about fully understanding how and why everything is working. While there are many tutorials on how to do this, I personally really like working with RP2040 chips and I found this three part series excellent: https://www.youtube.com/watch?v=RNH-CL8GrF8 One bit of parting advice (feel free to ask more) is around the concept of switch debouncing and hardware interrupts. I've found that there's a sort of "stages of grief" where people go through a dozen increasingly complex ways to make 1 press = 1 event. The short version is that there's no perfect way to do it in software, and where software is involved, you want to move away from polling pin state in your loop to using interrupt handlers ASAFP because sleeping in your loop is the root of all evil. IMO, the only correct way to do switch debouncing is to use resistors and capacitors; this is known as an RC debounce (Google it). You then send those signals into a hex inverter like the 74HC04, and then into a digital pin on your MCU (which is then captured by an ISR hardware interrupt). Every other path will just lead to pain. This might seem like a digression, but you'll thank me later. Finally, you will be pleasantly shocked by how amazing GPT is at talking through schematics. It knows the datasheets, can explain circuits and alert you to quirks and gotchas. ps. if you find yourself without interesting problems to solve, I highly recommend buying some cheap Nerd Musician courses and building some MIDI controllers! https://www.musiconerd.com/ I suggest searching for a makerspace / hackerspace in your city, and scheduling a tour. Day 1, you’ll meet interesting people working on projects like that - meeting them and geeking out, you might quickly have a local advice / how-to / project partner buddy. Buy an fpga Embedded tech here! There are many ways to get started but since you seem to be interesting in the practical, modern, IoT centric way it makes things a lot easier. This is all quickly typed on mobile: The first thing to do is to check out this online simulator and get a sense of basic circuit theory: https://www.falstad.com/circuit/ The first thing not to do, is to buy a bunch of random junk. Buying stuff is a fun hobby but it is very different from actually doing projects and learning! You will probably want a good multimeter, but I can't recommend a good affordable one. They are all pretty OK these days, but the current "Really nice one everyone likes" changes every few months or so as they change the models. Probably all the same chips inside... You'll probably want an ESP32 development board with USB-C, some random sensor modules, whatever happens to interest you, maybe some relay modules, etc. After that, you'll want to try out some breadboard projects, but I think you might quickly want to move on from that, and start doing PCB design. It's so cheap and easy these days. and a soldering iron. I suspect you will want a Pinecil, and the thumb screw upgrade for said pinecil. I have a similar one but haven't tried the pinecil itself, this stuff changes fast. It's about $25. SMD breakout boards are a good way to learn surfaces mount soldering while still doing breadboard stuff. Eventually you'll want to do a project with just a bare microcontroller, if you're serious about learning. I don't ever actually do this in real life because I don't do high volume work, and IMHO using modules just makes so much more sense if you're making 10 of something custom that's hand-assembled. But I'm glad I know how to, even if I don't generally need to. You do not need a bench supply till you get a bit more advanced, very basic stuff can all be done on USB. If you really are serious about this stuff, you're probably gonna want to learn some math if you're not already a math person, and maybe look into FPGA work, because there seems to be lots of jobs these days doing pretty high end advanced stuff. A Coffee machine microcontroller seems like a simple enough starting point. Stuff to consider: How will you interface with the machine? Will you be switching 120vac? That of course requires lots of caution and you shouldn't mess with it till you actually know what you're doing. But there are power strips with control voltage inputs that essentially abstract away the dangerous part in a professionally made box. For an SMS controlled bot, you have a couple challenges that are all pretty independent. First you need a source of power, and protection and charging for said power. I like to just use modules for that, but it might be fun to do that yourself on a PCB. You need motor drivers and motors. You need the mechanical side, for me this would be the hard part. You need a microcontroller, and some kind of modem. They don't have to be on the same device, maybe you have a 4G gateway device that sends commands over WiFi to the bot, or maybe it's all onboard. There's always lots of possibilities. Modern tech is basically just tiny computers with different IO, and computers allow a ton of creative freedom. And you need to figure out how it all connects. Will you breadboard, use modules and jumpers, or go straight to a PCB design? Once you generally know how electronics works(A simulator will greatly aid this), pick a project, pick a subsystem, and research all the ways that subsystem could be implemented. I started pretty much just by jumping in. Arduino is the classic place to start and it's pretty nice. PlatformIO is even better these days.