222 points · by BrandoElFollito · 8y ago · 67 comments
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.
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 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.
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.
https://www.amazon.com/Practical-Electronics-Inventors-Fourt...
The workbook is definitely worth it to help make the book more concrete
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.
Good way to get started is to pick up one of their beginner kits and follow through, they are meticulously documented.
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.
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
But for someone just getting started? Absolutely, you'll have a pretty seamless experience.
- 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.
My favorite recommendation is to find a project that you want to make that can be found online. If someone else makes it and it works, but it doesn't work when you make it then something in the build went wrong, not the design. If you start from scratch with a design and a build, when something doesn't work, you're not sure if it's just the build or in the design itself. Once you see how other people are building things, it will help guide in your future designs. I've learned quite a few "tricks" from other dev's projects. How to put multiple analog buttons onto a single pin is one of my favorite low-tech solves.
[0]:https://www.robotshop.com/en/elenco-mx-907-200-in-1-electron...
As for the programming in BASIC the long chunks of DATA hex was confusing, but also made me very curious about what was hidden in that hex (even though I had no idea of the word hex). It might have bee frustrating, but it was a crucial learning step in efficient ways to debug typos.
Going down memory lane, in the back of I think Byte magazine, they would have a program's BASIC code printed out in the back (usually a game or Turkey In The Straw type of things). A friend of mine had a C64, and we would buddy program the code. As a kid, we would make all sorts of typos, and it would become mindnumbing debugging all of that hex in the DATA sections. One of us would hunt-and-peck type the code in while the other would compare the page to the screen. We were finding typos in realtime. When we got to the DATA sections, one would read the hex while the other typed. Doing this, we brought our errors down significantly. Which meant we were playing the game much faster.
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.
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...
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.
Asking questions on the manufacturer's forum is useful to because you can typically get an application engineer to respond.
Have a look at Atmel/Microchip's AVR documentation, it's worlds better. That plus avrlibc and a few tutorials and you're golden.
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.
All of his books are great, but "Getting Started with Electronics" is the best IMO.
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:
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.)
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.
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.
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.
I've had all editions of this including the first and it's definitely in there!
Everyone is different however and it may indeed not be the right course for everyone.
- Relevant frequencies are low enough so you can breadboard circuits, use cheap components etc.
- You can hear what everything is doing, so it's intuitive and you don't need test equipment
- There are plenty of tutorials, because musicians have been doing this crap for decades
For example, you can build a simple "wah-wah pedal" or low pass/high pass filters, swap in different components, and hear what happens.
If I had access to YouTube and the DIY community today it would have been so much easier.
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.
Paul Scherz & Dr. Simon Monk's "Practical Electronics for Inventors, Fourth Edition" [1]
[1]: https://www.amazon.com/Practical-Electronics-Inventors-Fourt...
The issue is not the modules, but the underlying electronic components themselves. I started back as a wee lad with one of those 150-in-one kits and it was a great way to learn as a kid. From there I moved on to the various 'cookbooks'. Then I was able to follow projects in magazines etc. All doable over the course of a year or two depending on how motivated you are.
If I were starting from scratch today, I'd probably use an Arduino and follow some basic circuit tutorials online. (i.e. wire up breadboard circuits to the Arduino using it for power, digital input/output, ADC etc) If you only want to do digital electronics (i.e. true/false logic input/output), you can get by without too much analog knowledge (i.e. reservoir and noise filtering capacitors, using resistors to tie lines high/low etc.) but as soon as you want to interact with the real world (i.e. driving banks of LEDs, temperature and other sensors, motor control, etc) you really, REALLY, need to learn about analog circuits. No need to become an expert, but you want to get the basics down so you have an idea what's going on when things go wrong (and they will!)
It shouldn't take too long but you need to get below the modules and focus on the individual components (i.e. the basics of voltage/current, resistors, capacitors, inductors, diodes, transistors, amplifiers and then move on to ICs and modules etc. and not just what they are/do but get some basic knowledge about how to measure and troubleshoot issues with them) to understand at least conceptually what things are doing at the component level. Then those modules won't seem like such a mystery when problems arise.
Or sometimes the picture on the cover or the color ("The Dragon Book" or "The Yellow Book").