Ask HN: Where did you learn modular electronics?

222 points by BrandoElFollito ↗ HN
I like to build simple IoT devices and code around them. While I am comfortable with the dev part, I have problems to understand the electronics.

This is why I started with modules (arduino, nodemcu, sensors, audio amplificators) but there are issues the weird resistor, capacitor and whatnot which is plugged beyween, say, the arduino and the sensor.

Is there a place I could learn this "modular" electronics, where I could find "cookbook" advices on these elements needed for the modules to work correctly?

Since this is the way I lend to develop (take a problem, look at the solution and understand the details on the go) I would love to get into electronics via this path, if possible.

69 comments

[ 4.9 ms ] story [ 142 ms ] thread
The simplest modules I’ve seen are from Grove. The grove compatible modules don’t need you to dabble with any resistors and capacitors.

Once you go beyond the pieces provided by them and you try adding your own, you’ll inevitably have to deal with the electronics bit. Learning the basics is easy and shouldn’t take more than a month. I’m afraid I don’t have a ready resource to recommend for that. I believe there is a good MOOC course on edX to learn the basics. I’ll see if I can find the link and update this comment.

Learn Ohms law like it was a relative.

A book by Ashby called Electrical Engineering 101 is helpful.

There's just so many good books, and videos.

Try look for local FabLab or Maker/Hacker Space. People in there are usually willing to share their knowledge or they are even organizing some courses on that topic.

Either way, it's mandatory to understand electronics essentials (Ohm's law, Kirhoff's laws etc.) Try to find some electronics schoolbooks (I can provide something in czech only). After understanding basics, you can start with buses and digital communications (because digital is actually two level analog, right?)

Anyway, good luck.

It is unavoidable, you must learn some basic theory. A gentle introduction is found in this book: "Make: Electronics: Learning Through Discovery, 2nd Edition" by Charles Platt
I learned electrical and electronic fundamentals on the job working for a film industry supplier in Toronto. I'm kind of in the opposite spot— I'm just getting into modular electronics as part of my path to learning embedded engineering.

I highly recommend gaining an understanding of the fundamentals of electricity, then something about how those various parts play a role in a given circuit.

If you want a bit of a playground, you should try out Tinkercad. Just sign up, set up a new Circuit and you have all of those parts at your disposal. It might help to toy around with parts there while you follow along any tutorials or reading some basics.

For instance, try changing the resistor value in this circuit and watch what happens to the LED when it's on:

https://www.tinkercad.com/things/hmBoHhmong2-bodacious-krunk...

(hint: Try setting it lower, to say 1Ω from the default 440Ω. Then try setting it much higher like 10kΩ and see what happens.)

Also this gives a really brief breakdown of some essential knowledge:

http://www.ia470.com/primer/electric.htm

I think what you are asking is about just learning basic electronics and the digital protocols that connect different "modules" (and what kind of extra circuitry they need). For most consumer stuff (i.e. if you are not working on cars or industrial robots) you can get a lot done with just knowing about these three protocols:

- UART: https://en.wikipedia.org/wiki/Uart

- SPI: https://en.wikipedia.org/wiki/Serial_Peripheral_Interface_Bu...

- I2C (sometimes called TWI - two wire interface): https://en.wikipedia.org/wiki/I%C2%B2C

For more links for learning electronics check out my list of resources: https://github.com/monostable/awesome-electronics.

Take a look at The Art of Electronics if you were after a textbook. It is a little expensive, but is written beautifully
TBH, that is a pretty meaty book not well suited to the beginner. It is nice though!
Reading this thread I realized that somewhere in the past few decades people stopped referring to books by their authors*. I'd never heard of "The Art of Electronics" but of course I am very familiar with "Horowitz & Hill"!

Or sometimes the picture on the cover or the color ("The Dragon Book" or "The Yellow Book").

I work at a university and am working towards an M-Eng part time. I somewhat stumbled into a rapid prototyping class this semester after discovering that I needed to spend this semester and summer studying the advanced maths I never learned as an undergrad in order to take the ML/AI classes that my degree will mostly consist of.

I would recommend getting an M-Eng part time if your employer allows it. Yes, this suggestion punctures the idealistic narrative of the self-taught hacker that we are all supposed to romanticize on HN, but nobody can argue that I am receiving anything less than a world class education.

In addition - and this is the part that is supposed to make HN snarl and gnash it’s teeth - when a hiring decision comes down to the self-taught hobbyist and the graduate of a prestigious university, CYA protocol dictates that you hire the graduate. If the hire fails, it’s better to shrug your shoulders and say “They have a masters degree from a major university, how was I supposed to know it wouldn’t work out?” Rather than “I know I took a risk hiring the self-taught developer. The company has suffered because of my risky decision.”

Office politics make the world go round.

(Keep in mind, I am not trying to discourage self-education. In the tech industry we all have to continually teach ourselves. But sometimes it is best to be taught by professionals. It is their job after all.)

There are people with MS who are not the sharpest tools in the shed. Though yes, I agree it is CYA.
There's not a huge difference between modular electronics and plain old electronics. When you dig into it a bit you still need to understand the same sort of stuff.

Practical Electronics for Inventors is a really good book to get started with this sort of stuff: https://www.amazon.co.uk/Practical-Electronics-Inventors-Fou...

Once you realise that under the modules there's the same MOSFET input stages, MOSFET output stages, diodes and voltages that you get in discrete electronics, it all becomes pretty clear how to make things talk and interact.

Did a search just to make sure this book is mentioned. It's a treasure of just-enough-of-everything to help you understand basic electronics and protocols, as well as little gotchas and things to look out for. I highly recommend it.
It's really a great book, but as a warning that got me if you're more of a paperback fan: it's GIGANTIC. I bought it planning to read it on the train to work. It never even occurred to me that the thumbnail might be hiding its true size ;)
Hobbyist here. I recommend...

Books:

- Simon Monk's Electronics Cookbook [1]

- Michael Margolis' Arduino Cookbook [2]

Youtube:

- GreatScott's Basics Playlist [3]

The concepts in those two books are useful for interfacing with any microcontroller, including NodeMCU and STM32s.

[1]: https://www.amazon.com/Electronics-Cookbook-Practical-Electr...

[2]: https://www.amazon.com/Arduino-Cookbook-2nd-Michael-Margolis...

[3]: https://www.youtube.com/watch?v=woTiKij76cA&list=PLAROrg3NQn...

I am about to launch a site called Electronics Club, which is exactly designed for this with videos and examples. It is pitched at children but will suit anyone learning electronics.
In practice, you'll find that the "discrete components" (official term for the miscellaneous things that aren't ICs) are also making up modules - that is, they're used as parts of standard recognisable sub-systems to perform a particular function. Such as "decoupling capacitor", "termination resistor", "common emitter amplifier", "pi filter" and so on.

I don't think you can really "cookbook" without knowing any theory, but the amount of theory you need is fairly small and you don't necessarily need all the maths.

"The Art Of Electronics" is the standard book to refer people to.

The Art of Electronics is a great reference guide and there is also a workbook(https://www.amazon.com/Learning-Art-Electronics-Hands-Course...) and student guide (https://www.amazon.com/Art-Electronics-Student-Manual/dp/052...) that you can buy as a companion books. It can be dense at times though.
That was the book for my first electronics class in college and I found it awesome. I still reference it when doing hobby projects or the random time I get to work with electronics at work.

The workbook is definitely worth it to help make the book more concrete

Respectfully, Art Of Electronics is not a great choice for OP. AOE is a deep dive with a fast, steep learning curve and while appropriate for a serious student (EE?) I would argue it's not appropriate for someone who has no fundamentals and wants to learn to glue major components together. OP needs to learn practical fundamentals in a hands-on fashion -- debouncing a switch or a purpose of a pull-down/up resistor (and how to calculate values), converting signal levels, etc.

We forget how steep the learning curve can be and how likely it is to turn students away when every page is a baffling struggle focused on topics with purposes which are not germane / not clearly related to the learner's wants. AOE is the equivalent of a music theory book for someone who wants to play "happy birthday." Or Knuth's series for a beginning coder.

Try instead Practical Electronics for Inventors, which is approachable if you remember Pre-Calculus. It covers a lot of basic stuff, explains how all the different parts work, and is a wonderful reference for someone who just wants to build some basic stuff. We had a copy of it in our Physics electronics lab next to AOE and as undergraduates we were more likely to reach for it than for AOE.

https://www.amazon.com/Practical-Electronics-Inventors-Fourt...

To add onto this, if you want to quickly see many visual example explanations for these things, go to Google image search and choose type = Animated to get instant visualizations of the processes going on/principles demonstrated
It’s not as “modular” as you might expect if you come from software like me, you might think of each component as a “consumer” and a “producer”. You mentioned a capacitor, check out LRC circuits. When you put certain components together they act in non-linear ways that can be described using differential equations.
"the weird resistor, capacitor and whatnot which is plugged beyween, say, the arduino and the sensor" have to do with device termination and impedance matching so maybe that is a place to start.
Personally, I think the Forrest Mims books are THE best place to learn about circuits from zero. I read them when I was a kid, and still refer to them regularly. I especially like the combination of metaphors & drawings he uses to explain some of the concepts. He explains what's actually happening at the electron level, and provides helpful mental abstractions on top of that.

http://www.forrestmims.com/

All of his books are great, but "Getting Started with Electronics" is the best IMO.

Someone mentioned The Art of Electronics, can't recommend this highly enough, it's accessible and teaches you what you need to know to glue modules together and even build some of your own. A classic.
I recommend getting into Ham Radio. Certainly in the UK the three exams will give you a great introduction to electronics with a practical way to understand the principles. Even if you don't fancy getting on the bands, it would be a inexpensive way to get some standing.
As an ex EE who just did my intermediate, I’m not sure that it’s a good start. I’d suggest approaching The Art if Electronics and go from there. Even the full license material is quite basic.

Honestly I’m not a fan of the modular approach to learning using Arduino blobs stuck together. There are many gotchas. A bottom up understanding is far more valuable and satisfying to boot.

I thought the advanced covered a fair amount, basics of transistors, understanding decibels etc.

Everyone is different however and it may indeed not be the right course for everyone.

To be honest most of that is in the intermediate. The full covers basic AC circuits and minimal BJT amplifier structure and that's about it.
The issue with the AoE is the lack of practice problems and references when questions arise. For instance it's MOS and BJT parts glaze over how multi-stage amplifiers chain together and how the choice of one can effect the later (e.g. how your buffer effects source-follower).

Theory is good, but seeing how the implementation works is just as important and the AoE can glance over that because it's a sort of book of everything.

In short, it's a great reference manual and I have to sasy it's my favourite thing to start any question I have with, but for a beginner they need something that allows them to practice not just read about it.

That is in there. See p79/80 in 3e for example of impedance relationships. Also lots of practical examples in the companion book "Learning the Art of Electronics"

I've had all editions of this including the first and it's definitely in there!

I recommend Youtube, look for AvE and GreatScott
I recommend Youtube, look up AvE and GreatScott
You might appreciate a deep dive approach. Rheingoldheavy did a tremendous exploration into the underlying circuitry of an Arduino Uno [1]

I would also check out Chris Gammel's Contextual Electronics [2] as a semi-formal training course. It's also an opportunity to make connections with other EE's you can ping when you get "stuck"

Finally, invest in your tools! Get yourself a decent multimeter- if you aren't sure where to start, Dave Jones' EEVBlog [3] will provide more commentary than you expected. Having a good oscilloscope and logic analyzer also makes worlds of difference when you're troubleshooting a circuit. Digilent's Analog Discovery 2 [4] is a great get-you-started instrument.

[1]: https://rheingoldheavy.com/build-an-arduino-uno-from-scratch...

[2]: https://contextualelectronics.com/

[3]: https://www.youtube.com/watch?v=xdGQEVdxmQQ&t=414s

[4]: https://store.digilentinc.com/analog-discovery-2-100msps-usb...

Still in progress, but I'm writing https://www.circuitlab.com/textbook/ (an electronics book with schematics & simulations built in) which will get into some the details mentioned.

It's still harder than programming because electronics doesn't have any comments or variable names and runs all at once like a massively parallel piece of software. In many cases it takes a lot of experience and pattern matching to engineer or reverse-engineer why that capacitor is that size and goes there.

On the other hand, if you learn a handful of concepts really well, that'll probably get you 50% of the way there: Thevenin equivalents, input/output impedance, low-pass/high-pass filters, voltage dividers, level shifting, how to use MOSFETs and BJTs as switches...

I'd also recommend https://electronics.stackexchange.com/ -- a double-digit share of questions are of the type OP describes.

If the modules are made by good manufacturers, then they'll have datasheets that have ample explanation of how to use the module. The easier the manufacturer makes it to use their device, the more likely someone's going to buy it afterall.

Look through the datasheet and there should be several example application circuits. The datasheet will usually include descriptions about each pin of the module. If you need to use external components to "set" the pins of the module in some way, the datasheet will usually have some equations about how to calculate the correct value and maybe an explanation of where that equation came from. It'll also list maximum, minimum, and typical drive(voltage or current) levels for the pins. When you see the datasheet mention a term you don't know, spend a few minutes looking it up. A few used to describe module pins that jump to mind are "open drain" and "open collector" - those terms tell you a lot about what components you might want to add externally to the pin.

Make sure you understand Ohm's law and the concept of a pull-up or pull-down resistor and when to use them. Also, what a decoupling capacitor does. When you see a capacitor tied to a module pin, can you tell if it's acting like a filter or a charge reservoir.

Keep playing around with it and you'll eventually build up a lot of knowledge and intuition about how to connect everything. And other people have mentioned a lot of great books to use as resources as well.

I recently bought an stm32 board to start learning and found the datasheet to be complete gobble-de-gook. I have a feeling there is a lot fundamentals I need to learn before the sheet starts to make sense.
There is a lot of "noise" in the datasheet that you wont have to pay much mind to. There are usually examples of circuits buried in there along with pinouts. You can ignore a lot of it if you are doing hobby-level work.
True. There are several companies that are infamous for how terrible their datasheets are. Especially as a hobbyist it can be important to pick companies that provide good documentation because you don't have the leverage of saying you work for a large company that's going to buy 1000s of their parts.

Asking questions on the manufacturer's forum is useful to because you can typically get an application engineer to respond.

STM's documentation is a bit of a mess. I wouldn't recommend it for a beginner unless you're piggybacking off a development board that uses an STM32 core. This way you can learn snippets of ARM code, but leverage an easier to use framework.

Have a look at Atmel/Microchip's AVR documentation, it's worlds better. That plus avrlibc and a few tutorials and you're golden.

I would recommend starting with some simple discrete logic devices such a 555 timer chip. Learn how to read its spec sheet. Connect it to an LED. Then move on to something more complicated like using the 555 to drive a counter which in turn counts on multiple leds, etc. These circuits are simple and probably nothing you have a practical need for. But they will get you familier with reading data sheets and basic components.

Later jump in to microcrontrollers.

I used to teach a class called Electronics for Artists at a local maker space. This process worked well for that.

In addition to what others have suggested, Adafruit and Sparkfun both have loads of tutorials. Even if you're not using their parts their documentation is still some of the best if you're using a similar part.

Good way to get started is to pick up one of their beginner kits and follow through, they are meticulously documented.

https://learn.adafruit.com

https://learn.sparkfun.com

There's also some really high quality material on YouTube for a variety of skill levels, I'd especially recommend these two channels:

https://www.youtube.com/channel/UC6mIxFTvXkWQVEHPsEdflzQ

https://www.youtube.com/channel/UCu7_D0o48KbfhpEohoP7YSQ

Scroll through their videos and you will find a lot on the sort of things you are asking about.

> In addition to what others have suggested, Adafruit and Sparkfun both have loads of tutorials. Even if you're not using their parts their documentation is still some of the best if you're using a similar part.

If, however, you are not using their parts pay particular attention to voltages.

For example suppose you are playing around with a range finding module that uses one of ST Microelectronics' nifty time-of-flight IR laser rangefinder chips. These are 2.8 V chips and are not 3.3 V or 5 V tolerant.

Adafruit has modules for two of them, a short range one [1] and a longer range one [2]. The Adafruit modules add a 2.8 V regulator and level shifters so you can hook them right up to your 3.3 V or 5 V system with no additional components.

Sparkfun has two modules for the shorter range one [3] [4]. The first of those, which is about the same price as the Adafruit module, does NOT provide a regulator or level shifters. The second Sparkfun module, which is about $10 more, does provide a regulator and level shifting.

If you are following the Adafruit tutorials, which hook the module directly up to an Arduino, but you are using the first Sparkfun module and just hook it directly up you are probably going to fry your module.

[1] https://www.adafruit.com/product/3316

[2] https://www.adafruit.com/product/3317

[3] https://www.sparkfun.com/products/12784

[4] https://www.sparkfun.com/products/12785

I particularly recommend Adafruit for dev boards, because their tutorials are just so good, and they have one for pretty much everything they make.
I have mixed feelings. Their tutorials and selection are great, but their markup is pretty obscene on some parts and their libraries are often over-complicated/take up a ton of space. I try and support them and buy parts from them occasionally because I love what they do, but it's hard to justify getting more stuff from them price wise and I don't generally like using their code.

But for someone just getting started? Absolutely, you'll have a pretty seamless experience.