Hacker News new | past | comments | ask | show | jobs | submit login
Exploring different microcontrollers less than $1 (jaycarlson.net)
929 points by stefanpie on Nov 6, 2017 | hide | past | web | favorite | 183 comments

If I hadn't seen this article on Hacker News today, is there any combination of plausible keywords I could have typed into Google to find this particular article if I were looking for an in-depth review of microcontrollers?

I tried "best microcontrollers reviewed", "best low-cost microcontrollers", "survey of microcontrollers", and a bunch of others. Nothing that Google finds in the first 10-20 hits is as good this resource, other than Wikipedia, though very good, isn't a technical review.

I suppose the lessons are: there's room for lots of improvement in search engines, or SEO really works and you better promote yourself no matter how good you are, or word of mouth (Hacker News in this case) is still the way to find the best stuff.

This article is remarkable because there is typically very limited accessible blogs about topics like this. This long article requires in-depth knowledge of a large number of microcontrollers, and the time, desire, and ability to verify, collate, and summarize all that information. That's a rare combination.

An ordinary journalist could not write this article. It would take hundreds or thousands of hours to gain the domain knowledge required to understand what needs to be written up and described - it demonstrates a deep understanding of topics like ISR latencies, peripheral compatibility, memory and instruction requirements, and other stuff that really matters to engineers but is typically beyond the reach of a casual reader. As a result, news in the field is very, very rarely unbiased, informative reviews - there are a lot of 'new product' press releases unsubtly promoted as 'articles'.

An embedded systems engineer at some company building a product using these microcontrollers would not write up this article. Not only is the comprehensive knowledge required uncommon even among skilled engineers, it would take dozens of non-billable hours and would make it easier for competitors. And we typically have very narrow domain expertise, so the ability to create a website and rich blog experience like this would be unusual. (The database issues the site had under load this morning are excused!) Open-source and information sharing are not commonplace within embedded systems development.

And you won't be able to easily generate this comparison yourself without a lot of work. You might think that the numbers described would be front-and-center on the first page of each datasheet for these microcontrollers. But you'd be wrong, or at least naive. Each manufacturer's marketing department exaggerates their numbers in slightly different ways, so the first page of the datasheet is inevitably worthless bull shit.

> This long article requires in-depth knowledge of a large number of microcontrollers, and the time, desire, and ability to verify, collate, and summarize all that information.

So, Google needs to train its AI to recognize this instead of relying on PageRank.

We still need page rank to measure authority, though. Otherwise other AIs will soon mass produce content which looks like it "requires in-depth knowledge of a large number of microcontrollers, and the time, desire, and ability to verify, collate, and summarize all that information" but is actually nonsense. Alternatively, we trick spam producer into doing valuable work.

Google doesn't _need_ to recognize this because it's objective isn't to show you the best result but just a good enough result to keep you using Google.

A search engine that only gives you the best result wouldn't even need the search results page. And that's where Google likes to sell ads.

How about an (technical advisor to a) buyer for a company like Adafruit, that both resells SoC/microcontroller "developer boards", and puts out their own? I could see them writing up their experience in trying to find good SoCs to base their products on, and how they compare to the ones in the boards they resell.

Methinks most business owners/managers, especially MBA-types, would see that as giving away sensitive info/competitive advantage to competitors and nix the idea.

Well, "most" is OK, just as long as there are some that think otherwise.

So why was it written, what is the motivation of the author?

From the first sentences of this article:

> As an embedded design consultant

I know that for my own part, a lot of what I blog when I blog tends to be motivated either from increasing my professional visibility or because it's something I spend time doing anyway and where I figure I it'll be useful to someone (I know I've done it right whenever I find my own blog posts in search results a couple of years later and they answer my question)

And it works, depending on who you are trying to reach.

I know that this article has me completely convinced that Jay could be extremely effective assisting with any of my projects. Much more so than any Ivy League diplomas, years of experience or lack thereof, glossy brochures, testimonials, or other conventional marketing tools. And it's significantly more effective than any FizzBuzz quiz I could administer to potential candidates.

For all the foibles of business politics, expert opinion from within the organization is extremely persuasive when it's available (though an organization that really needs Jay's services because they have no internal experts would have a hard time using this article).

Also people like to talk about their interests and work. I don't see a lot of my own writings being about profit. My interest in them existed well before they helped me get into this profession.

And from https://jaycarlson.net/about/:

> Jay is available for engineering services on a contract basis

I'm not saying that's the number one goal here, I think this very thorough and informative piece goes way beyond a personal advert. But it must help (and rightly so).

> I suppose the lessons are: there's room for lots of improvement in search engines, or SEO really works and you better promote yourself no matter how good you are, or word of mouth (Hacker News in this case) is still the way to find the best stuff.

The way I look at it: SEO really works, and shit sources tend to spend a lot on it, while quality sources tend to not spend anything on it at all - therefore a lot of quality stuff is hard to find, unless you can hear the right words from the right mouths.

(IMO SEO, beyond making your website not look like shit, is user-hostile behaviour. It games search engines into serving users links to those who spend effort on gaming search engines instead of links to content the user was looking for.)

Indeed. SEO how it's referred to and done most of the time is almost an anti-pattern: People adjust their system (website) to implementation details of another service (search engines) instead of just fulfilling the "public contract" (exposing good, accessible content).

But that's dangerous, as search engines evolve, change behavior and occasionally penalize this kind of behavior. That's why I always tried to explain to customers they should just focus on good content for humans and not care about explicit SEO after they claimed someone had told them that Google had recently "changed their algorithm" and now did XY.

There are SEOs that cannot be detected and at the end you have quality articles after hundreds of pages. This is the case for maibstream subjects like recipes where you compete with ten of thousands of SEOers.

I posted this in another comment, but this is exactly why I built a project I call Piglet:


Google is really good for general information, but really bad for domain specific information. Piglet (in contrast) is really good at domain specific, but can be poor in the general case (although I haven't seen that yet). We track discussions around the articles, as opposed to linked pages. This typically provides more information. You can read about it on our about page.

For instance, this article appears right at the top of the search results: https://imgur.com/a/AkUTb

I recommend reaching out to me if you're interested - we are currently doing a private beta. Spcifically, the application is for investing (we are building an AI financial advisor), but I personally use it as a search engine as well.

Is there any way to use just the search engine bit? I don't care much about investing, but it'd be great if you could take the investment-specific information out of the free/public account and just returned the results for searches.

Not at the moment, although that is an interesting idea.

I second the request. As I wrote in another comment, if it was good at ignoring the usual SEO crap, I'd pay for a subscription.

This article is the second result in DDG for `survey of microcontrollers` - https://duckduckgo.com/?q=survey+of+microcontrollers&t=ffcm&...

This (besides privacy considerations) made me switch to DDG finally! Thanks!

I've noticed some _very_ odd things going on with Google Search results recently. The other day I tried a search for an error message from SQLAlchemy, the results were poor so I added the word `SQLAlchemy` to the query and it removed _all_ answers about databases and returned a bunch of stuff about mineral mining.

To get anything useful out of Google, I often have to resort to using "verbatim" results from the search tools. Those results are much closer to the old Google than the standard search, but not perfect.

I remember how revolutionary late 90s Google was in how it would show you exactly what you were looking for, or pages with relevant content, whereas the other popular search engines was just be a jumble of stuff.

It seems like in order to monetize search, Google has had to regress what once worked well.

Are you familiar with duckduckgo.com stack overflow integration?

It will pickup your search is technical and embed the best stack overflow answer it could find. Sometimes with a code snippet.

Google is increasingly returning irrelevant results in the effort to deliver the targeted content their advertisers want. I predict a future for a subscription funded search engine that just delivers lexically relevant results without all the bullshit. I for one would gladly pay to use something better than Google. The advertising monetization model is broken.

Second your opinion, Google hasn't been crazy good at domain specific search for me lately.

Google video search is also weaker than a pure youtube search for me too, so much so that I only use youtube search nowadays which is perhaps their intent...

I've noticed recently (few years maybe) that Google "punishes" results from blogs and less known domains. Searching for some specific keyword combination often results in skipping first few pages of cruft from popular sites just to find exactly what I was looking for in some blog post buried >3 pages deep.

Sometime around the housing market crash (though unrelated, I assume) Google seemed to give up on fighting spam sites and just harshly down-ranked anything that's wasn't an ultra-high-traffic site. A little while later (2010? 2011?) their search got much "smarter" and it became difficult to impossible to trick it into giving you less-popular results using well-crafted searches. A big (and very good!) chunk of the web became way less visible over that span of 2-3 years or so—and my impressive-even-to-other-developers Shaolin Google-Fu was defeated by Google's Tiger Style :-(

You can also see the ugly results of their new ranking system any time you search for a simple answer that deserves maybe two sentences, and are greeted with ten search results all of which are a dozen rambling, content-free paragraphs, with a title closely matching your search and with your answer buried somewhere inside (maybe). That reads as "high value" and "high relevance" so google eats it up, even though it's 100% grade-A garbage content.

One other thing I've noticed, and it's been happening for a few years. Is that somehow, magically, there are websites out there that have the exact combination of my search results in their title. Almost as if Google forwarded my search to some party which then went ahead and created a dummy "proxy-search" site with the exact heading, and whose body just contains their own results for the same search criteria I used.

I've had this exact experience many times myself and I'm also at a loss to explain how it happens unless Google is (unintentionally) facilitating it. An observation I can add is that the dummy site may not appear on my first search for "very unlikely phrase". But if I keep tweaking my Google search, a dummy site that has "very unlikely phrase" as its title soon appears in the results.

I was recently wondering about the same and was also wondering how this can happen.

Your proxy-search would be a solution but then I wonder what "indexing" would mean to Google

It shouldn't be too hard to make Google index all 3 words combinations from your site. I've inadvertently made them index every city location at my country once.

iirc the original pagerank algorithm was based on weighting page value by how often other pages linked to it, with higher weighted pages lending greater to weight to outlinked pages. Obviously google's extended it greatly since, but that core behavior of lowering unpopular blogs in search results should always be there; in terms of linkage, they're not much different from spam/trash

It's been on my mind for a while that I could use a search engine that's seeded only with sites that contain little or no advertising or tracking.

A starting point could even be the corpus of HN articles and comments, perhaps augmented with entries from the Common Crawl archives and traditional crawling.

I tend to be interested in novel and creative work, and it seems to me that most of the sites I find most rewarding are not commercially driven.

I'd buy a subscription to such a site.

Over the last 1.5 decade I've been seriously on-line I developed this heuristic: quality of content is inversely proportional to advertising, and also inversely proportional to page bloat.

I've been thinking about this recently, too. This was just on the front page of HN yesterday:

"Does anyone remember websites?"


"Search engines like Google are indispensable, able to find answers to all of your technical questions; but along the way, the fun of web surfing was lost. In the early days of the web, pages were made primarily by hobbyists, academics, and computer savvy people about subjects they were interested in. Later on, the web became saturated with commercial pages that overcrowded everything else. All the personalized websites are hidden among a pile of commercial pages. Google isn't great at finding those gems, its focus is on finding answers to technical questions, and it works well. But finding things you didn't know you wanted to know, which was the real joy of web surfing, no longer happens. In addition, many pages today are created using bloated scripts that add slick cosmetic features in order to mask the lack of content available on them. Those pages contribute to the blandness of today's web.

The wiby search engine is building a web of pages as it was in the earlier days of the internet."

Thanks - that post had been on my readar, but got forgotten.

The paragraph you quote pretty much sums up my feelings, though I'm not particularly concerned with finding old school sites.

Google used to do a good job of answering technical questions, as well as finding the little gems of originality (and lots of lovely mediocrity too, of course).

I don't think the two need be mutually exclusive. It's just that what I consider the good stuff is lost in the attention seeking nonsense that the web has become. Filter that out, and I have a feeling that lots of great stuff will become a lot more accessible.

wiby is wonderful, I had a play around and found pangs of nostalgia, and stuff that made me laugh out loud. But I think the criteria of lightness of a site, for example, the amount of JavaScript used, means it will be missing many great contemporary sites that happen to use the technology of today.

This is actually part of the reason I built a project I call Piglet:


Google is really good for general information, but really bad for domain specific information. Piglet (in contrast) is really good at domain specific, but can be poor in the general case (although I haven't seen that yet).

For instance, this article appears right at the top of the search results: https://imgur.com/a/AkUTb

I recommend reaching out to me if you're interested - we are currently doing a private beta. Spcifically, the application is for investing (we are building an AI financial advisor), but I personally use it as a search engine as well.

I suppose the lessons are: there's room for lots of improvement in search engines

There's also the tried and true distribution method of newsletters and mailing lists specific to a certain industry.

If you've been in embedded a long time, you probably know about Jack Ganssle and his "Embedded Muse" newsletter, which has been going on for about 20 years now.


The lesson is more "smart titles are fun but use a boring descriptive one if you want people to find you"

Sad since it turns everything into tasteless unoriginal yogurt. But true.

>>> I suppose the lessons are: there's room for lots of improvement in search engines, or SEO really works and you better promote yourself no matter how good you are, or word of mouth (Hacker News in this case) is still the way to find the best stuff.

As someone who runs a similar blog and is first page for hundreds of search terms, Google is fantastic at discovering niche content. You can't even being to fathom how good it is.

The article is already the 4th google result if you look for "best micro controllers under a dollar".

If anything, the title should be improved by the author. "The Amazing $1 Microcontroller" is a very poor description of the content and noone is going to google that.

> The article is already the 4th google result if you look for "best micro controllers under a dollar".

That worked because you're mentioning the "$1" from the article's title. Google is not interpreting "under a dollar" as "cheap". As proof, I searched for "best microcontrollers under £1", "best microcontrollers under 50 cents", and "best microcontrollers under $2". Jay Carlson's article wasn't found in any of those cases.

A more commonsense search of "best cheap microcontrollers" doesn't find the article even in the top 100 results.

> "The Amazing $1 Microcontroller" is a very poor description of the content and noone is going to google that.

I thought the title intriguing and pithy. You don't want a web where every title is SEO-optimzed, do you?

There are thousands upon thousands of micro controllers. The space is crowded. I'm not surprised that google doesn't rank an article that is poorly worded.

I find the title intriguing too... but on HN and with 100 upvotes already. It's pretty terrible in a search context. If I am looking for a comparison, I'm not clicking on something called "the amazing microcontroller".

That will change now that it's at the top of HN, but I agree - it's currently very obscure to search engines.

My guess is that it's a new site? Only a few articles, and Open Site Explorer reports a Domain Authority of 18, which is approximately equal to zero :)

However, if the author keeps writing these articles at this level of quality, chances are in a year it'll dominate relevant SERPs.

[best $1 microcontroller] returns it on top.

It's easy to find something once you know where it is. Omit that magical "1$" and try dig your way to the OP...

This suggests an interesting "golf" game: Given any web page, find the shortest set of keywords that will cause Google to return that page in the first page of results.

Should probably exclude some operations like "inurl" or simply searching the entire page url.

G+ communities really shine for this kind of thing. I suggest subscribing to the various communities that take your fancy and make a point of checking once or twice a week.

A good search engine would pick up sentiment from discussion threads to improve ranking. But then you have to find the good forums, another hard problem.

I usually find stuff like this by searching for

"tinyavr vs pic24" or even "tinyavr vs" and see what google suggests is a competitor.

The lesson is put in more work. Don't expect Google or your Grandmother to make things easy. They both will keep telling you, that is their job in life. A large part of the population has turned into a bunch of quitter because of it.

The most relevant part for me is this cherry picked line from the article:

    Consequently, the megaAVR remains the most open-source
    8-bit microcontroller on the market — by a long shot.
Even though the Atmel AVRs aren't the fastest, or cheapest (in cost per unit) or the toolchain isn't the easiest to use or the debugging capabilities aren't as good, the fact that it's open-source makes it win, hands down. There's a reason why nearly every hobby electronics project you see has an Arduino in it. Assuming the Arduino IDE is installed and permissions issues have been resolved, you can go from unboxing your Arduino to making it blink in under 60 seconds.

In addition, places like Adafruit [1] and Sparkfun [2] build their own boards and make most of their code free/libre/open-source [3] [4], with a large focus on Arduino.

It'll be interesting to see how the electronics market evolves when the current and subsequent generations are trained on AVRs.

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

[2] https://www.sparkfun.com/

[3] https://github.com/adafruit

[4] https://github.com/sparkfun

It's important to note the rest of that portion though.

    But even as popular as Atmel is among hobbyists, Atmel has largely stayed out of this 
    space directly. Instead, they’ve secured small-volume AVR sales by relying on the open-
    source community to build their own tools for themselves: turning out a slew of 
    hardware and software used to program the megaAVR devices.

    While I applaud the efforts of these developers, these tools are inferior to Atmel’s. 
    Their programming speeds are terrible, they don’t support the new tinyAVR 1-Series 
    devices, and they have absolutely no debug capability.
Atmel has deliberately enabled the open source toolchains for its MCUs but it largely keeps out of it directly.

Mobile-friendly copy of the parent's quote:

> Consequently, the megaAVR remains the most open-source 8-bit microcontroller on the market — by a long shot.

and your quote:

> But even as popular as Atmel is among hobbyists, Atmel has largely stayed out of this space directly. Instead, they’ve secured small-volume AVR sales by relying on the open-source community to build their own tools for themselves: turning out a slew of hardware and software used to program the megaAVR devices.

> While I applaud the efforts of these developers, these tools are inferior to Atmel’s. Their programming speeds are terrible, they don’t support the new tinyAVR 1-Series devices, and they have absolutely no debug capability.

Don't use leading spaces to quote text, that's for unformatted text. Do this instead:

  > *Text.*

This is why I'm so excited to see Rust (with full core libs) running on AVR.


That's great! I've been looking forward to Rust on microcontrollers. What's the current status? Is it fully functional so that you can use your usual Cargo and rustc? Are all AVRs supported?

Open source hardware in the microcontroller world isn't quite as big of a deal as it is in the software world. While it would be great to see the processor architecture and all, I would much rather have an ARM that I know works and won't have to look at. I believe modern Arduinos are going to Cortex processors which are ARM as well, so I don't think the open source claim is what keeps Arduino hardware going. It is most likely going to be ease of use, accessibility, community and the tools.

I agree that open source hardware isn't as big of a deal (yet?) as open source software but the open source that we're talking about here is mostly software in the form of Arduino libraries to drive modules and other chips.

I think the major point is that "ease of use, accessibility, community and the tools" are exactly where the open source software model thrives over a walled garden one. It's not impossible to do this with proprietary software but for the open source projects that are successful, they tend to be successful because the freedom they offer encourages each of those points (imo).

I would love to see open source hardware take off at that level! You do see plenty of projects at the PCB level, which is nice and likely as far as most people will ever need to go. The price point of a small custom PCB is actually very reasonable now and usually easier to buy than rolling your own anymore.

But until you can spin your own silicon with the ease of something like a 3D printer or buy custom low cost/quantity silicon, it doesn't matter what your open source HW design does if you don't have the money or a business to create and distribute it. That's one thing that is very hard to do with something physical and why opensource has worked so well in the software community.

There does seem to be some stuff being done here using FPGAs... But they are still a rather expensive way to go just to drop a custom architecture on for now.

In the meantime, there is still plenty of software work to do to make a truly useful and professional grade opensouce stack that you can develop on the chips we have.

ESP8266 and ESP32 trumps AVR in every respect, including their openness.

They don’t meet the explicitly stated $1 goal

Understand and I am very well aware having purchased over 20k ESP32 MCUs. However, the parent comment that I responded to is talking about opensource aspects and community of AVR microcontroller to which I responded that Espressif is not only cost competitive, but it beats AVR in every aspect (perhaps you can say it's not as mature of an ecosystem).

This is a fantastic article, a thesis-length piece of work covering the subject from every possible angle. And it's all on a single page, not an ad-encumbered pagethrough like some review sites.

Ecosystem is an interesting area. It seems that everyone has converged on Eclipse, which is probably better than trying to write their own environment but can still be infuriatingly clunky at times.

I'm impressed with the breadth of this review and the commitment to including everything that fits in the $1 parameter - which is now quite a lot, I hadn't expected to see Cypress PSOC there.

No love for the PIC10 series? Perhaps too many PIC already in the review would make it look like a MicroCHIP(TM) press release. I do see some justification in that the 10F series is more of the twenty five cents class not the $1 class. Those things are strangely charming, I had a lot of fun with the now-discontinued 10F2xx series. Adjusted for inflation the 10F3xx are now cheaper than the 10F2xx were, which is cool. Its strange to drink a can of diet coke knowing it costs 3 times as much as the controller you're troubleshooting.

Another novelty of small/cheap controllers is when I was playing with the defunct 10F2xx family I didn't own a meter sensitive enough to measure the current draw at 32 khz clock. I do now, but it was an expensive meter! In the old days cheap EE would wire up a capacitor and run the ckt off the cap and time how long the voltage drop took and use that to create an imaginary resistance and use the measured V and theoretical R to calculate the theoretical current. Of course my cheap meter drew more current than the microcontroller which leads to weird games like sample voltage for a second. Also leakage currents in most caps is larger than the uC current draw oh so much fun fun fun. One trick is to drive a square wave generator thru a diode to a low leakage ceramic disk cap, assuming your reset circuitry is faster than the square wave and you trust the DC response of your scope. Another thing I tried was creating a transfer function where a 100 watt lightbulb and a tiny solar panel generate say, 1 mA, so a 99.9% optical attenuator in front of the cell means 1 uA, right? Of course sleep current is a tiny fraction of that, so you stack a SECOND optical attenuator on the solar cell, say merely 99% blocking, and that should be 10 nA which is about half sleep current, right? You can also play games when your CPU costs 30 cents like hooking up 100 in parallel for $30 to measure 100x average current. Low current is fun if you're ever bored.

Whenever this kind of low current stuff is discussed, I like to bring up the master, Bob Pease: http://www.electronicdesign.com/test-amp-measurement/whats-a...

(also the article has reservations about PIC, pointing out its strangenesses and describing PIC24 as underwhelming)

Didn't read all the author's criteria, but esp8266 is worth mentioning in the context of cheap microcontrollers.


Yeah if anyone is just looking to get started tinkering with embedded hardware I'd say this is the way to go. The chips were made popular by NodeMCU which uses Lua, but you can easily run Arduino or write plain C on the same hardware.

I've tried a few breakout boards and my favourite is the WEMOS D1 Mini. All you need to supply is a MicroUSB cable. You can get them shipped from China for under $3: https://wiki.wemos.cc/products:d1:d1_mini

FWIW, based on recommendations here at HN, I went with the WEMOS D1 Mini early this year when I decided to replace all the electronics in my kids' RC trucks. The project went amazingly well. In each of the 2 trucks, I wired it up with a WEMOS motor controller driving a 9V/2A motor, a smaller motor for turning, and some LEDs. I 3D printed new shells with Lego compatible studs on top. I hot glued the electronics inside. I wrote mostly-ordinary Arduino code. All of this took only about 2 weeks in my spare time.

So now my kids have 2 wifi-tablet-controlled trucks with very custom programming (for N-point turns, playing music through the motor windings, headlight blinking, etc.) and the ability to update the program over the air at any time. It's basically magic. I spent only about $8 per truck.

Yeah, the WEMOS D1 is the real deal. I love it so much that I bought a pile of them before I've even decided what I want to use them for.

Absolute favorite for me too. ESP32 is now also widely available and pretty cheap for it's performance.

My second favorite ESP8266 hardware are the "Sonoff" brand WLAN mains power switches. I especially like the Sonoff S20 for its form factor, and the Sonoff POW for it's power metering capability. They contain an ESP8266 and can be reflashed with different firmware that does not need the vendors cloud services to work.

Oooh, ITEAD make sockets now? I got a bunch of switches a while ago, wrote my own firmware for them, and today I saw their wifi-enabled light switch and got one of those too. I love love love their stuff, they make it super easy to retrofit my house with "smart" devices where I can control every line of code.

I can vouch for the D1 mini also. It's the one you want, by far. It has an on board programmer so you can power and program it from USB, while being the smallest board in size out of the popular ones.

The actual smallest I've seen is one I made: https://github.com/skorokithakis/tiny-ESP8266-breakout

Have you tried the NodeMCU? (Not suggesting it, as I actually killed mine when trying to program it, but more curious about whether you’ve compared it to the Wemos D1.)

Yes, many of them, and a few others. The D1 is much smaller and has no redundant pins. It's also sexier.

Awesome. Thank you!

No problem, enjoy! You can also try something like this, if you want to power it from a battery: https://www.aliexpress.com/item/WeMos-D1-Esp-Wroom-02-Mother...

That's brilliant and concise, from a hardware standpoint. Thank you again.

Agreed - the 3v3 thing can be a bit of a pain if you've got a collection of Arduino 5v-friendly bits, but not insurmountable.

Big warning I'd make, though, is that the D1 has two revisions - the R1 (rarely described as such of course), and the R2.

You definitely want the R2. However, many ebay vendors are still selling R1's.

In my experience, the ESP8266 is fine with 5V, I have yet to burn one even with 5V on its pins.

> ESP8266 is fine with 5V

Yes and no. ESP8266 would typically survive 5V applied on any pin, and sometimes even sort-of work with 5V power applied (although with much higher power consumption and no WiFI).

But there is a catch. Pretty much all CMOS chips (ESP8266 inclided) have body diodes from each IO pin to power/ground. This means - you can't have voltage higher than VCC+0.6v or lower than GND-0.6v on any pin. So what happens when you have ESP8266 powered from 3.3v and connected to 5V I/O is - ESP will get (partially) powered via I/O pin. Depending on what 5V part is connected to that I/O, that might be bad for that part (excess of I/O sink current). And in extreme cases (5V I/O pin that can deliver high current, or ESP is in deep sleep), this will supply current into 3.3V VCC rail, bringing it up as high as 5 - 0.6 = 4.4v potentially. Which could be bad for anything else on that rail.

As a practical example - let's say we have ESP8266 powered by a switching supply with MP2307DN [1] chip delivering 3.3v, and connected to a 5v AVR. In normal operation, ESP takes ~70mA, which exceeds 40mA driving capability of AVR, so it's all good [2]. However once ESP8266 goes to deep sleep, all 40mA from AVR's I/O go via ESP's body diode back to MP2307DN switch, which usually would fail catastrophically and end up shorting input to output, supplying 12 (or whatever the input is) volts to ESP's VCC. Which is likely to fail as well, sending 12v further and frying the whole thing.

[1] MP2307DN is widely and cheaply available on "Mini360 DC-DC buck convertor" boards and it really doesn't like current being back-fed into its output

[2] Except I/O drive transistor in AVR is overloaded, which might or might not lead to its failure eventually.

I was somewhat surprised that ESP32 not only survived being powered from 5V, but worked somewhat reliably while so and I only noticed that the software issues I was debugging were caused by that from the smoke coming off the paper label on breakout module.

Ah, that's very informative, thank you.

>The chips were made popular by NodeMCU which uses Lua, but you can easily run Arduino or write plain C on the same hardware.

I'm pretty sure that its the work done to make these into $3 wifi arduinos that is what made them popular. That's why wemos literally sells one that is shaped like, and has the same header spacing as, an arduino uno.

MicroPython runs great on the ESP8266 too.

This. It's the cheapest option to start with MicroPython and it works perfectly.

Nice. The guy with the Swiss accent's channel is a very good start: https://www.youtube.com/channel/UCu7_D0o48KbfhpEohoP7YSQ

I am falling in love with wemos's breakout boards for ESP. For instance, this one: https://www.aliexpress.com/item/WeMos-D1-ESP-Wroom-02-ESP826...

This is an ESP8266 breakout/programmer for about ~$3: https://www.aliexpress.com/item/ESP8266-ESP12-ESP-12-WeMos-D...

Absolutely incredible stuff.

Ordered this one coming soon: https://www.aliexpress.com/item/WEMOS-WiFi-Bluetooth-Battery...

And in the realm of awesome breakouts that I'm excited for: https://www.aliexpress.com/item/2pcs-TTGO-LORA-SX1278-ESP32-...

There is some really incredible stuff coming out based on the ESP8266 and ESP32 right now. IMO completely blows all of the normal arduino stuff out of the water.

I believe that for the US market you are required to use the 915MHz ISM band LORA modules, the one you pointed to works in the 432MHz band.

I'm not sure about that, but adafruit also sells a 432mhz board in the US without any warnings: https://www.adafruit.com/product/3079

Wait, is that last one two ESP32 boards with LoRa and a screen for less than $20? If so, that's amazing, but it's too cheap and I don't see the ESP32.

Well that is what they're advertising, which is absolutely insane in my opinion. I ordered a few of them[1], so I'll let you know when they get here.

It looks like the ESP32 is on the back. Sparkfun also sells an ESP32 that comes in that package: https://www.sparkfun.com/products/13907

What's really interesting going on right now is that adafruit/sparkfun have become radioshack, and aliexpress has become my go to place to find interesting new stuff.

I will say that whenever I'm doing a commercial project[2], however, I still use the more expensive adafruit/fry's/genuine arduino boards.

[1]: I help run a hackerspace in Phoenix, and I do all sorts of maker workshops all over the world, so having a bunch of weird dev boards and parts and stuff is pretty important to me. If those don't end up working, it was worth the $40 to find out.

[2]: Part of my life is helping create one-off experiential advertising installations. Usually these things have a stack of arduinos in them controlling lights, sensors, motors, etc.

It (the ESP32) is right in the middle of the bottom view photo. The actual SX1278 is smaller, on the right. On the bottom, you have the SPI flash for the ESP32.

Ah, interesting, I thought the ESP32 had the same layout as the ESP8266 (processor + flash storage) so I got confused. I guess the ESP8266 storage is embedded in the chip. Very nice breakout, I'll have to look around for a 864 MHz one.

Yea, I was hoping to see it there on the comparison list. I guess it fails some criteria.

It fails the "only" criterion (it costs more than $2.20, whereas the author had a strict $1 cut-off precisely stating that a huge field opens up above that price range.)

Fom "the rules":

>While some projects that come across my desk are complex enough to require a hundreds-of-MHz microcontroller with all the bells and whistles, it’s amazing how many projects work great using nothing more than a $1 chip — so this is the only rule I established for the shoot-out.

>I wanted to explore the $1 pricing zone specifically because it’s the least amount of money you can spend on an MCU that’s still general-purpose enough to be widely useful in a diverse array of projects.

>Any cheaper, and you end up with 6- or 8-pin parts with only a few dozen bytes of RAM, no ADC, nor any peripherals other than a single timer and some GPIO.

>Any more expensive, and the field completely opens up to an overwhelming number of parts — all with heavily-specialized peripherals and connectivity options.

Of course, the ESP8266 is precisely this "hundreds of megahertz" chip (160 Mhz) with "heavily specialized connectivity options" and peripherals (wifi and, in the case of ESP8265, a full megabyte of flash memory). While all this is interesting, at the $2+ price there are "an overwhelming number of parts."

So the author chose $1 as a very hard cut-off.

It doesn't $2.20 since full modules are $1.50 or less : https://www.aliexpress.com/item/1Pcs-ESP8266-ESP-01-ESP01-Se...

ESP8266 is $1.4 in single chip quantities, <$1 in bulk

> I guess it fails some criteria.

> A new series that explores 21 different microcontrollers — all less than $1

The ESP8266 microcontroller chip is probably less than 1$ since we can find full esp modules for 1$50 or less...

Yep, enjoyed this one.

That’s a rather good article. I will digest that today.

I’m currently using Cypress’s PSoC line (4200M boards) for a couple of personal projects. The reconfigurable hardware and analogue parts actually kill a lot of external hardware. It’s pretty amazing and ridiculously cheap. Visual Studio is the IDE for this.


Note: don’t just jump into these if you think it’s just a better Arduino as the learning curve is extreme. You really have to know your stuff before you open the box.

PSoC is an underrated line of parts. Now that they've dropped the wacky 8051-alike used in the older models and switched to ARM, there's a lot more you can do with these things.

hope the development toolchain is better than it was 6 or 7 years ago... I wanted to look into PSoC but couldn't figure out how to blink an LED after a few hours of messing around with it, so I gave up. And I'm not a beginner; I've had 22 years of microcontroller experience.

It's still heavily dependent on the IDE, but at least you're not bound to the compilers that were used 6 or 7 years ago. The better compiler of the two was bought by Microchip and subsequently abandoned/crippled-on-purpose for the PSoC instruction set.

£8 is not even close to 'ridiculously cheap', compared to, say, Cortex-M0 STM32 boards for $1.5 with free shipping https://www.ebay.com/itm/1PCS-STM32F030F4P6-ARM-CORTEX-M0-Co...

Yeah you can indeed.

But that £8 includes next day courier delivery (which is free), a phone number you can actually call and talk to someone instantly, materials and tutorials on their web site and product support.

They do a slightly lesser dev board for £3 as well.

Hell I can order a £0.20 resistor and get it next day!

Perhaps Jay should have hosted the page on a microcontroller instead of a database; archive copy: https://web.archive.org/web/20171106070102/https://jaycarlso...

With 21 of these parts on my desk, that would have been a good idea. Thanks for linking to a cached version — I'm working to get my little blog on Cloudflare to handle the traffic.

I appreciate the kind words from everyone so far; it's been a huge learning opportunity, and I hope others can get inspired to grab one of these parts (especially one of the weirder ones) and do something cool with it.

While you are at it, here is how your little blog looks to those of us who browse with javascript off for security reasons:


Even though all the text content is present (this image is disabling CSS and scrolling down a little):


Requiring javascript for rendering what basic HTML already renders is not a very inviting or inclusive way to go with the blog.

Not your issue, but the current timeout Cloudflare page is saying that thanks to it's "Always Online™" technology, we can surf a snapshot of the site. But there is link or option to said snapshot :/

I would pay for a book version of this work, or at least a PDF that I could print. It would be the kind of book that I could really get into. Fantastic work.

I'd like to second that. I skimmed through this yesterday and about to board a long flight. Frantically caching :-p

it's HN's hug of death

I'm sure that doesn't exist. I've had my site in the front page several times and I never had a problem. I agree I'm a competent sysadm and there's a peak on visits often in a short period, but my server is not as optimised as it could be and it did just fine.

I think what we have here is a server or a web app poorly configured.

What percentage of websites would you think are cared for by a sysadmin at least as competent as yourself, who dedicated at least as much time as you did?

HN Managed to kill the uplink of my provider...

much appreciated, thanks!

> And even if it were properly executed, I think I reject the underlying goal of this strategy. The whole purpose of using an Arduino UNO form-factor is to support Arduino shields — yet I have never seen an Arduino shield on the desk of a professional engineer or advanced hobbyist. At least, not one plugged into one of these “Uno form-factor” dev boards.

I have to chime in. What's the point of using the UNO form factor if you don't support the shields, libraries or the environment? It makes completely no sense.

The code. The shields are pretty worthless, but the availability of libraries and example code is excellent.

Instead of working out all the fine details of I2C, I can call a well developed function that takes care of all that for me. Instead of spending days writing a graphics library, I can find an off the shelf GFX library that has more features/is faster/ etc

The ability to move quickly with well documented, prebuilt libraries is invaluable when you want to get something up and running ASAP.

Once you're ready to develop it, then you can go back, strip out everything that's not needed, rewrite things, etc.

That's the beauty of Arduino.

The problem is that there are a lot of Arduino form-factor mainboards from other manufacturers (like the one in the article) which have no code provided. But manufacturers cargo-cult into the form factor without realizing that code is the important thing.

Hint if you're going the no-shields route: Go for the arduino pro mini. It's the same thing in a different format, and a bunch cheaper.

I've had the best overall experience using an ATTINY85 [1]. It almost serves my purpose for every use case I've had in the past couple of years - Running steppers, basic home automation, wireless, etc.

If you buy them in bulk, you can get it down to less than $1 per MC. [2]

You can even install Arduino libs on it and the Arduino interface has quite good support for it as well.

Some of my projects with it include a DSLR camera slider [3], wireless home automation (turn off lights when I'm not in the room, communicate with my air-conditioner to maintain the room temperature using IR, etc.)

[1] http://www.microchip.com/wwwproducts/en/ATtiny85

[2] https://www.ebay.com/itm/5PCS-ATTINY85-20PU-IC-MCU-8BIT-8KB-...

[3] https://www.instagram.com/p/1AscllHDQ0/?taken-by=discovery.d...

Do you just use development boards with these? And which ones?

You don't really need a dev board for these, you can just stick them in a breadboard and go, they're already in a DIP package and don't really need any extra circuitry besides what you're going to connect them to. You can also program them using basically any other micro-controller you may have, or use a cheap USB programmer to do it, so they're pretty cheap to get started with (Though it's not exactly as user-friendly as plugging an Arduino into USB).

The AT Tiny can be programmed with an Arduino Uno, which is what I used. It's pretty easy. But there are also cheaper boards specifically for the AT Tiny.

The waybackmachine link didn't work for me, but this did:


"Remember websites" yeah they always had scaling problems unfortunately :(

The waybackmachine link didn't work for me either. Thanks for the new one.

I've made some network changes, and the site should be back up for most users — let me know if anyone is running into issues!

If I am sourcing a part, I usually start with an objective comparison search on a distributors web site (https://www.mouser.com/search/Refine.aspx?N=17176544&Ns=Pric...).

There's even lots of sub-dollar MCUs out there too. As the author notes, picking the best one depends a lot on what you need to do.

There's a lot that's not covered in a parametric search listing. In your link, picking a core doesn't tell you how good the peripherals are. (Digikey's parametric search [1] does give you a lot more information about what peripherals are available where Mouser doesn't even mention it). Clock frequency doesn't tell you how many cycles the instructions take. And none of that tells me anything about power consumption or performance in a typical application, or especially about the usability of the toolchains.

If answering "it depends on what you need to do" requires a lot of domain expertise to evaluate, there's definitely a place for summaries like this!

[1]: https://www.digikey.com/products/en/integrated-circuits-ics/...

["amazing", "\$1", "microcontroller"]. HN, you really know how to make me click a link within no more than 20 ms from seeing the front page.

Well at this point all I would like to get is a USB-powered linux in a card, with wifi, optionally with a screen capable enough to display 3 or 4 lines of text.

I mean raspberry is cool, cheap and everything, but I'd prefer something all integrated, as small as the raspberry pi zero, less fragile (meaning I can put in my pocket or bag, and still expect it to work), not necessarily with pins.

I don't know about what the demand is for micro-controllers, but as a consumer and a developer, having a wifi-capable portable micro computer would really be cool.

Does it already exist? Under $50?

I think that Linus is too heavy for a very cheap "CPU". If by Linux you mean "something easy to develop on", then most micro-controllers come nowadays with an Arduino compatible layer.

If you remove the Linux part from your wishlist, you can consider some "NodeMCU" boards on Chinese websites, eg: https://www.banggood.com/Wemos-NODEMCU-ESP8266-12F-WiFi-1_30... https://www.banggood.com/Wemos-TTGO-WiFi-Bluetooth-Battery-E...

Arduino-compatible layer is useful when you don't want to setup real IDE or your own build system for native toolchain. For ease of development it does not buy you that much over straight C for anything remotely non-trivial. On the other hand many small MCUs can run RTOSes with somewhat POSIX-ish APIs (particularly notable in this space is ESPxx, for which the official toolchain is port of FreeRTOS and probably nobody uses it as bare hardware)

Find a low end, low resolution, Android tablet or phone that can be rooted. There are many under $50.

Not quite, and for various reasons.

What would you want by way of input on such a device? I've been working on something like this based on TI OMAP CPUs, and the hardest thing (after a decent semi-open SoC) is getting a decent keyboard.

I think the N800 was probably the pinnacle of handheld Linux devices (or the Psion 5 series if you step outside of Linux). You could look at the Raspberry Pi handheld game console options out there, but ultimately there's little that can compete with a Pi Zero, battery pack and ILI9341 screen on price.

It's getting close. There are newer SoCs that are MMU capable and also contain enough RAM and Flash to run a small Linux instance off a single part...or a single part with some simple QSPI flash hung off of it. Renesas has the RZ line that can do this, but it will probably take up $30-$35 of your $50 budget.

We call those "smartphone."

Maybe is not the best topic to ask, but does anyone know good sources (websites, books, kits) for playing with and learning a bit more about microcontrollers and electronics? I would prefer structured sources (those that take newbies by hand) than unstructured ones..

I used to play a little bit with the nerdkits (http://www.nerdkits.com) and really enjoyed their approach but they seem to have gone out of business and their content has not been updated for some years..

Practical Electronics for Inventors, Fourth Edition by Scherz and Monk (1056 pages) ~$25

I've only used the 3rd edition, but I found it very accessible and well-written. I think the 4th edition has expanded content for microcontrollers and plan on getting it when I have the time to play around with electronics again.

What I liked about the book is that it provided information in a practical way so you could "just build something" without knowing all of the theory, but the theory was available when you wanted to increase your depth of understanding.

I admit the title is cheesy, but I could see this book being used to teach an introductory class on electronics. It also serves as a good reference entry point for topics/electronics where you're completely clueless.

I think there's a lot of fun to be had with electronics when you don't use a microcontroller. Breadboarding, analog components, maybe some digital logic circuitry... And if you use a microcontroller, either not putting a linux distro on it or getting one that is incapable of running linux... For finding structured sources, you can do pretty well by just picking a college, finding their computer engineering program, some classes that look interesting, and see what books they require then buy them or see if a library has them. https://www.amazon.com/Digital-Fundamentals-10th-Thomas-Floy... or https://www.amazon.com/Digital-Electronics-Practical-Approac... are fairly good for instance but there are many others and some more appropriate for whatever your real study goals are.

It's really important to have a specific goal in mind regardless of whether you prefer to learn how to solve it with structured or unstructured materials, and to have an initial idea of what level of detail you want to go in order to accomplish the goal. The lower level you want to learn the less up-to-date your resources have to be, our understanding of electricity hasn't fundamentally changed since Maxwell's equations. :) Something like "I want to turn on a smart light of this type when there is motion in this area, and turn it off after 5 minutes" is a nice goal. And you can accomplish it at many different levels of hackery, and learn very deeply if you want about each component of your solution (for instance there's the entire field of RF if you want to know how the antenna works).

One quick thing you can get into is assembling electronics kits. Granted it's not programming, design, or theory, but it's an interesting alternative that'll get you started without having to catch up on theory. All you need is the kit and a few basic tools, like a soldering iron, some tweezers and pliers.

There's a person (fairly active on reddit, I believe) who put together a youtube channel reviewing such kits. Sadly he stopped posting new videos years ago (bored and moved on?) Think he's an EE or something comparable for work, but, in either case take a look at some of his offerings: https://www.youtube.com/user/SUBLOOP/videos

The video that I got started with and caught my attention was his "Active Speakers" kit, part 2. They're entertaining, his soldering is just hypnotic, and it covered some troubleshooting you'd run into with electronics.

adafruit.com and sparkfun.com are two of my go-tos. Pretty strong community support.

Thanks for your input, I briefly checked those links and they seem to be stores and quite overwhelming in their range of products and tutorials. What I'm looking for is mostly project tutorials or books at a basic level, as in "how do I start?". For instance, the nerdkit had me build a temperature sensor from the most basic parts and display the temperature in a LCD (bundled with the kit).

Any other suggestions?

Edit: typos

Sorry, I should have been more specific. For AdaFruit, there are two (among many) options. A general "Learn" page (learn.adafruit.com) with all sorts of step-by-step projects using different microcontrollers. Most products pages will also have a list of projects and introductory pages (many with video). For example, the Raspberry Pi has this: www.adafruit.com/product/3055

Sparkfun has pretty much the same thing with a "learn" page (learn.sparkfun.com) and all sorts of tutorials. E.g. here's a list of tutorials/projects dealing with ATtiny variants, a microcontroller discussed in the original artical: https://learn.sparkfun.com/tutorials/tags/attiny

What is the minimum horsepower to build a WiFi KVM? The monitor part seems toughest; if it's possible to do so cheaply I don't care how fast it updates.

I plan on trying out this $12 ESP8266-based device which ships configured as a USB serial port -- I plan on using it as a serial console. It would be awesome if I could convince it to somehow act as a USB VGA-enough and see both the boot/BIOS screens and the OS GUI.


USB mouse and keyboard is already possible on ESP8266: https://github.com/cnlohr/espusb

As for VGA i think you are out of luck, or need a faster/specialized co-processor. VGA requires 3 analog inputs of at least ~30MHz, and an ESP8266 has one analog input in the low (I think I've seen 20) kHz range, so more than 1000 times too slow.

Thanks much for taking the time to share your expertise in answering my question!

You're welcome. I looked into it because it would make a pretty cool project and while pretty advanced, not impossible.

The cheapest analog-digital-converter chip I found is the TVP7002. Dealing with the digital pixel output is still way way too much data, but now it might be possible to scan the picture a few pixels each loop. The reasonable approach would be to process it in an FPGA or specialized chip and only deal with a compressed and scaled image in the ESP8266.

Can any of these be programmed with Rust?

Yes! Theoretically anything that Rust has support for (https://forge.rust-lang.org/platform-support.html) but I think most work has been put into ARM Cortex-M support recently. Especially Jorge Aparicio has worked to make embedded programming in Rust a joy (see https://japaric.github.io/discovery/ for an introduction). If you use STM32F MCUs you will probably have the lowest friction. I've heard of other people using the NXP Kinetis lineup as well. Do mind though that there are not many peripheral libraries yet. Currently I myself am fighting with getting USB to work. Of course you could still use the vendor provided C libraries and link against them if you don't want to go for 100% Rust.

The best part: You can use many of Rust's high level zero-cost abstractions. Just take a look at this example code which compiles to very efficient assembly: https://github.com/japaric/discovery/blob/116fe76491d661b5ee...

Seriously curious about this. If not these ones, what other microcontrollers have decent or better rust support? Is there a list somewhere? I'm keen to have more practical uses for my rust skills so I can enjoy using rust without having to find excuses to use it where I would be more productive with other languages.

Your sibling has some good links, but a decent way to think about it is, from hard to easy:

* does it have an LLVM backend?

* is it listed on the forge page?

* is it listed as having std support?

The farther you go down this list, the simpler it gets to use Rust for it.

Latest work has been on ARM boards and a ton of work on AVR, which brings 8/16 but support.

Not the cheapest perhaps, but I recently used Ambiq's Apollo for a project. It's an ultra low power ARM MCU. I found it very nice to use mainly because Ambiq only has two models at this point, which makes their libraries very clean.

The other advantage is that its I2C slave core operates autonomously- it provides a shared register space. It means that a master can write a bunch of stuff to the shared memory without waking up the CPU during each transaction (which usually involves clock stretching).

I'm not as much of an expert as the writer of this page, but this looks legit. The major $1 microcontrollers that I've worked with (Atmel series) as well as the ones that have a LOT of buzz recently (The ST STM32F0 and TI's MSP420) are all discussed and compared.

You mean TI's MSP430

Not in the list but I used Atmel AT89S51/52, built basic line tracking robot, pc controlled bot, relay driver, home automation etc


That website took forever to load at 100kbps. So long I cancelled and started with comments.

I know this is off topic but would love HN to show a page size besides each link so we know whether the link is even worth opening.

Completely off topic but does anyone know what the site is running and whether its a "theme"? I'm planning to write something technical and I am a huge fan on how the website is structured.

A quick look at the source suggests it's Wordpress with "TheGem" theme.

Awesome! Thank you!

Now if somebody from China can make a list of the cheap micros under 1-2 RMB, now that would be a nice list for super low cost stuff.. that I'd be very interested in...

Recently I was looking for a project that required a network of microcontroler and was looking for the cheapest mcu in around quantity 50. My requirements where pretty modest, I just needed 2 GPIO and 1 PWM ouput.

I ended up ordering the Attiny13A as that was the cheapest option in aliexpress/ebay with freeshipping in small quantities (around USD $0.3 a piece).

I would have loved to find something even cheaper!

There's a popular CPU in China meet your requirement: http://stcmcu.com/ but in Chinese

Any website where I can order a few for testing?

I think you can get 8051 parts for that.

Yea I'm hoping somebody can provide a list of various manufacturers and part names similar to the article..

My article includes the Holtek HT-66, the STCmicro STC8, the Nuvoton N76, and the ST STM8 — all hover in the 1-2 RMB range (especially when purchased in volume from within the mainland).

The STC8 and N76 parts are 8051, the other two are their own design. The HT-66 looks very much like a PIC16 part, and IDE and compiler are totally free.

The STM8 is probably the best-performing part in that price range, and has a free IDE and compiler.

My review includes pretty extensive discussion on the main page, plus separate reviews for all these parts — check it out and let me know if I need to clarify anything!

This is a great blog post but I'd also like to throw in that the STM line has a pretty great linux toolchain (official or not, I'm not sure).

I made a repository for the toolchain necessary to get STM boards working here: https://github.com/abraithwaite/STM32

Although it's outdated, the links at the bottom appear to link to updated tools which are presumably better :-)

Yeah, the STM8S003 is pretty hard to beat around $0.25, with excelent code-density, free IAR development and a very assembly-friendly architecture.

For that price I'd believe you can get only those without packaging

I will be Shenzhen in a few weeks. Will try to buy something for 1¥ :)

It's not just microcontrollers that are amazing: using a cheap phone can give you a screen, a battery, 3G and sensors.

It's not just micro-controllers that are amazing: using a cheap phone can give you a screen, a battery, 3G & sensors. reply

My compliments for fixing your link loading problem in short order.

Yep, I loved this one.

What's really amazing is that for less than $5 nowadays you can have a 1GHz+ quad core ARM Cortex-a53 with FPU and NEON support. I mean, sure, your entire device will be more than $5, and it'll be kinda power hungry at 3W or so running full tilt, but that's a pretty beefy chip for the price of a venti Starbucks latte, capable of running full Linux, with GPU, media encode/decode, etc, etc.

It is all a question of use case. This reply comes up all the time when I talk about how I use microcontrollers and what I use them for. For myself, microcontrollers offer me maximum control with minimum overhead. No OS, or maybe just some RTOS that does not really "boot" except for copying initial values for variables from Flash into RAM, being done in a fraction of a second. Switch it on, off it goes. Interfacing with SRAM and Flash without a driver.

You can do MCU based PCB designs. It gets harder when it comes to the mentioned Cortex-A. It will be harder to sample, say, 40 pieces of them. You're very much supposed (and better off) to buy boards like OrangePi or similar.

ESP designs, especially ESP32, are somewhat in between. Started off as a little documented blackbox with a RTOS interface it is now a much better (but absolutely not on par with Cortex-M designs) documented platform. However, part of it is still a proprietary code blob. They are beefy beasts, however, and when you need just that - well, it's a no-brainer. I just wish they were documented like STM32s plus ARM manuals and had a little more toolchain support. The price tag keeps me from complaining any louder.

When you don't really have hard constraints and are fine with a 5 second bootup, chose whatever fits your bill. When exact timing is an issue (and you don't want to go bare metal on the Cortex-A), when fast bootup is an issue, well - better look at MCUs.

Not gonna argue with that. I do use MCUs myself where appropriate. I like that they’re more hardware than software: flash the thing once and it will work every time from there on out. Very few moving parts, everything is very simple, power consumption is measured in milliwatts.

But it still blows my mind that the equivalent (a vast superset, if you consider the GPU and specialized coprocessors) of my workstation from the late 90s now costs less than $5.

> $5 nowadays you can have a 1GHz+ quad core ARM Cortex-a53 with FPU and NEON support.

And probably no realtime clock, or well-documented ADC / DAC.

Sometimes, all you gotta do is:

1. Measure a voltage from something (external temperature sensor: such as a Thermistor: a resistor whose resistance changes based on the temperature. Apply a constant current to a Thermistor, and you'll get voltage that varies with temperature)

2. Change the voltage somewhere else. (IE: ramp a motor up or down based on the temperature).

3. Do this from ~500 to 10,000 updates per second (ie: 500Hz to 10kHz / An update every 2ms to every 100 us).

Don't be fooled by CPU specs. They're actually rather unimportant in the microcontroller world. Good features to have are like... integrated OpAmps, ADCs, DACs, Timers, and other features that allow you to do job #1 and #2 better. Even an Arduino/ATMega runs at 20MHz, giving you 2000-cyles per 100-microseconds. And that's why Arduinos are so popular, because they have all the ADCs / Timers needed to do the job, and 20MHz is way faster than what most people need.

A more "premium" chip would have OpAmps, which will offer finer voltage control and more customization for the hardware engineer. I guarantee you: if you're doing hardware (aka: reading voltages and setting voltages), you will NEED a bunch of OpAmps on the board somewhere. So chips that come with integrated OpAmps can really cut down on external parts.

Most of these cheap parts go up to 100MHz (ie: 10,000 cycles per 100-microseconds), but really don't have a need to go beyond that. Besides, higher MHz means more power usage... and a lot of these uCs are designed to run on button-batteries for literally months (assuming you get the right amount of sleep). So power-efficiency severely trumps processor speed in their typical use case.


Anyway, consider this. If you have a 1GHz chip but your ADC converter only runs at 50kHz, then you practically can't do more than 50k updates per second. Because at best, your system is only able to read the voltage level once every 50kHz.

It takes a bit of time for voltages to settle down and make a decent measurement. I'd imagine that for most of these chips and systems, they're limited by peripherals and not by CPU power.

> or well-documented ADC / DAC.

Oh, they're well-documented alright, over these 4000 pages of PDFs from our various portals and manuals and peripheral standards and ARM standards and SDK code and...probably a few other places. So thoroughly documented you could never finish reading it all before the chip is obsolete!

site is down

Was it running the website?

Applications are open for YC Summer 2019

Guidelines | FAQ | Support | API | Security | Lists | Bookmarklet | Legal | Apply to YC | Contact