20 ms·
The Amazing $1 Microcontroller (2017)
- deleted 8y ago[deleted]
- neya 8y agoMy favorite is the ATTINY 85. It's so cheap and yet, it can do almost most of the things you can do an Arduino. And yes, you can program it using the Arduino IDE as well. Last year, I started out to digitalize my entire house with these tiny ATTINY 85 chips and with some nrF wireless chips. It has worked really well for me and I'm able to control and monitor any power port in my house as well as my mains. The overall setup still costed less than a Nest, yet, vastly more powerful. Of course, the downside is you need to write code, have a running server to control it on the cloud. But, no problem for me as I'm a (Google Cloud) consultant and this is what I do for a living. I use Google Cloud's IAP with AppEngine (I may switch to cloud run now, since it's cheaper tho) and I have a private REST server running that I can access from my own Android app. The whole thing took me a year to finish, but that's because I worked on it maybe once or twice a week in the weekends and didn't focus on it much. But, my effort has paid off and it's amazing to me that what is possible with just a dollar investment.
- stevetodd 8y agoDo you have any write ups or code on this to share?
- praveenster 8y agoThis sounds really interesting and is something I’ve been meaning to do for my house as well. Do you have a blog post with the details or a github page?
- kickscondor 8y agoTotally with you. The tiny original Digispark (with the USB traces on the board itself) is my fave - I use them for teaching school clubs and personal projects/gifts. If I need to go beyond that, it usually means straight to the ESP8266 or ESP32. But that's pretty rare. (With you on the nRFs, too!)
- penagwin 8y agoHow do you like the nRFs? I've been all over the ESP8266/ESP32 since it came out, they're crazily versatile chips! I've been interested in Lora/nRF/LoraWAN for some of my low-power further range projects. I'm just curious as to how they compare to the ESP's. Also, how do you power your projects? I'm considering buying 6+ usb bricks, but I'm skeptical of non-brand name ones, and brand name bricks are expensive. After watching BigClive though I'm sure I trust any non-brand name ones....
- danieldk 8y agoHow often do you want to send/receive data? I experimented with a Wemos D1 Mini and a pack of 4 rechargeable NiMH batteries (LiPo batteries seem like playing with fire, literally). In deep sleep the power consumption is very low, I measured something close to the 20uA from the spec sheet.
- penagwin 8y agoYeah from what I've seen you can desolder the status LED to lower the current even more. With the ESP32's you can use the lower power processor as well. I want to automate my blinds, which is kinda annoying as that means ~6 different, "high up" spots in high visibility areas, and obvious motors mean "high power" (compared to micro amps). I'm really not sure how to approach this one yet...
- blhack 8y agoDon't you have to run power to the blinds to run the motor to move them up and down anyway?
- dhruvkar 8y agoSounds fascinating! >> yet, vastly more powerful What's sorts of things can you now do with this setup?
- neya 8y ago#1 is my privacy. I don't trust anyone else with my privacy. I can do some stuff like turn on AV receivers and program them to do something automatically, like switch to movie mode if I stay in the room for 2 minutes (just an example) for example because each of my power outlet has an IR transceiver. Though I don't use them much, they have a lot of utility. The reason I don't use them much now is I upgraded my receiver and now I need to re-program the IR transceiver with the commands from the AV unit's remote. With Google cloud, you can write your own Siri-like interface, so you can talk to any power outlets you want, which is my next milestone. Stuff like this would normally require different vendors to operate together (Eg. Nest + SIRI + Homekit) but because this is my own platform, I can do whatever I want.
- penagwin 8y agoWhat's your experience with running your server non-locally? Not judging, just curious as usually those that DIY their home automations are also into homelab stuff and setup a spare laptop or something for the server. Derp - You're a cloud consultant, oh okay haha. I'm guessing your home ISP network is pretty reliable then? I'm stuck on con-cast so unfortunetly I have to be prepared for occasional high-packet loss/no internet situations. They're fairly rare, but I want to make sure my lights can be controlled 24/7
- neya 8y agoIt depends on your requirements. I don't need to constantly monitor what my voltage values are. I just want stuff to happen when I send a REST API call. So, I'm not too bothered about latency. I just need to know if there's an outage or overvoltage, or short circuit, etc..
- so_tired 8y agoThis is such a great setup. Maybe if we just put 10 of these mini-controllers in each home, we can cover the majority of electricity consumption, and get demand flexibility the cheap way (instead of fitting each home with an expensive smart meter). (Obviously the cloud/app parts will have to be centralized with consumer opt-in and preferences etc..) Have u thought about this ? Has this approach been explored ? great project..
- HeyLaughingBoy 8y agoThere's a world of difference between a hobby project and a large-scale production item. The CPU in the smart meter likely isn't much more powerful than an ATTiny. By the time you've scaled this project up to meet the needs of the electric company, the cost is likely comparable to what they already have. BOM (Bill Of Materials) cost is rarely the limiting factor on commercial products. The selling price of most devices is usually a large multiple of the cost of components.
- penagwin 8y agoI'm curious, is this a common problem? At least here in Michigan, our electric company essentially replaced all meters with smart meters for free, unless you choose to opt-out. Power-measuring outlets do exist, Belkin has one under the WEMO brand for example. It's just that it generally makes far more sense (for the electric company) to put the meter in one spot, instead of every outlet. You still have to have the mini-controllers communicate with the power company though, so I'm not sure what problem you'd be solving?
- mikepurvis 8y agoThere's also Sense, which monitors for the distinct waveforms of your big inductive loads— washer, fridge, A/C, etc. I don't have one yet, but my colleague who does absolutely swears by it. Allegedly you basically get whole-home monitoring with a single tap at the panel: https://sense.com/ https://sense.com/
- 83 8y agoAs someone building up some home automation I'd love to know how you are monitoring and controlling power. Remote power strips? Replacement outlets? Something diy?
- neya 8y agoSure. Power monitoring is tricky. Rest are simple. Power monitoring involves converting the mains voltage to DC that is almost proportional to the mains voltage. Then you would rectify it and downsize it and get it to a voltage level that whatever power management IC you use can accept. You also need to include fuses and other safety circuitry to ensure it doesn't exceed that threshold your microcontroller can accept. For example, if my uC works based off just 5 volts, I want to make sure I downsize my 120VAC to just 2.5V but still proportional, this means, when there is a spike, my uC can take a hit upto 5 volts, but that means my actual power supply has a spike of 100%, which means I'm getting 240VAC on a 120VAC outlet (which has never happened so far). Then, for the actual turning on or off of switches itself, I just use relays and some relay/motor coil ICs to control them. Sorry I don't remember exactly as this was a year ago and this system is lying inside my wall. So I need to remove the switchboard (and use a lens) to find out the numbers. But then, you can always google for "Power management / mains voltage IC", you can find even ready made modules on eBay. The tricky part is component layout since you are dealing with high voltage, it can form arcs: https://www.youtube.com/watch?v=MAlyEMQxTN0 https://www.youtube.com/watch?v=MAlyEMQxTN0 Not as powerful, but still a smaller version of those arcs. So, you want to use well rated components with decent thresholds. Eg. Don't use a low power relay, cheap capacitors, etc. All of this is then passed on through uCs(ATTINY 85 + other uCs in the circuit) to some nrF wireless modules I bought in bulk on AliBaba through my uC To be clear, each switchboard housing contains - a couple of relays, uCs, nRF modules, temperature and humidity sensors and some infrared sensors (I don't use them anymore). I believe they also have overvoltage protection and short circuit protection in built (because of an IC I use). It will simply turn the relay off in the event of a spike or short circuit. BTW, AliBaba is the cheapest. Don't buy from AliExpress, it's usually plagued with dropshippers (god, I hate them so much) who just keep hefty margins off a factory somewhere that you can find on AliBaba. Other alternatives, but still under AliBaba group: 1688.com, tmall.com If you think about it, in cloud lingo, we would call this architecture as "micro services" except that there's one big monolith which is my mains module run by an old laptop motherboard. (Sony Vaio FZ series) This nrF module talks to a an old laptop motherboard through serial, that passes information to a REST API. This laptop motherboard is located where usually all the mains connections go in. One thing I didn't use on purpose is smart trippers/circuit breakers. Sure, they're smart, but you're relying on someone else for security while also giving away your power usage consumption data. Besides, if a circuit breaker goes off, you want to know why it happened before turning it on, so I find it pointless to make them be able to turn on automatically or from your phone when I can just walk to my mains box and turn it on myself. The REST API is built with Phoenix/Elixir, and is hosted on Google Cloud AppEngine. I haven't had any downtime so far (yet) and is blazing fast. Like I said, I'm a Google Cloud consultant, so this is what I do for a living. You may have luck doing the same with AWS/DigitalOcean. Just use something you know well. And don't ever get into doing devops for this kind of thing. It's more critical than you think. So, don't make choices like try to save up on the servers by running your own instance on a DO droplet for 5 bucks a month. Sure, you saved up some cash, but the devops it takes you will cost you more. More importantly, if some hacker gets in, you're doomed! Once, when I was in my house, the lights and TV suddenly started turning on and off in the hall room. This was right after I came back from watching Insidious and it was really scary. Then I found out, it happened because there was a really fat mouse on the motherboard (don't know how it got there) walking around the jumper wires. Haha! Hope this helps, sorry I will try to update with specifics maybe in a separate blog post here.
- danieldk 8y agoMy favorite is the ATTINY 85. It's so cheap and yet, it can do almost most of the things you can do an Arduino. And yes, you can program it using the Arduino IDE as well. How do you deal with the small number of pins? The NRF24L01+ uses SPI, which requires 4 pins. There are some guides on how to hook up an NRF with 3 pins. I think that only leaves 3 pins (besides VCC and GND)? The ATtiny seems to be very attractive otherwise, because it works across a relatively large voltage range and does not use a lot of power. Did you consider the ATtiny84, which has double the GPIO pins?
- penagwin 8y agoI have no clue what your project is, but a lot of us like the ESP8266/ESP32 which are ~2$ and ~5 per module, or around double with their dev kits. Get's you lots of GPIO + wifi.
- danieldk 8y agoI do like them, I have a supply of Wemos D1 Minis ;). I also like the Robotdyn Blue Pill (STM32, fun for playing with Rust). Regardless, I find the minimalism of the ATtinies interesting too, but haven't made the plunge yet.
- ChickeNES 8y ago> Robotdyn Blue Pill (STM32, fun for playing with Rust). $3.49 is great, nice find. Hopefully now that Espressif has unveiled their fork of LLVM you (as well as myself :P) will be able to use Rust on the ESP chips soon enough.
- unwind 8y agoFor regular STM32F103C8T6 blue pills, of course there are lots of sellers on AliExpress that go lower. The lowest right now [1] is listing them for $1.53. That said, it's really confusing how much flash memory are on these. The community seems to find that they list as 64 KB, but in reality ST has been shipping the part with 128 KB without saying. I have two black pills (slightly different board, same MCU) but the one I tested only has 64 KB. :( 1: https://www.aliexpress.com/item/32839140960.html?productId=32839140960&productSubject=STM32F103C8T6-ARM-STM32-Minimum-System-Development-Board-Module-DIY-KIT&spm=2114.search0104.3.1.50e44caaZiIJL5&ws_ab_test=searchweb0_0,searchweb201602_10_10065_10068_319_10059_10884_317_10887_10696_321_322_10084_453_10083_454_10103_10618_10307_10820_10301_10821_10303_537_536,searchweb201603_52,ppcSwitch_0&algo_expid=79e6ec26-5106-483c-8f45-30fe7203b30a-0&algo_pvid=79e6ec26-5106-483c-8f45-30fe7203b30a&transAbTest=ae803_3 https://www.aliexpress.com/item/32839140960.html?productId=3...
- yeahitslikethat 8y agoI'm doing the same thing now. I bet your people think you're as crazy as my people think of me. My other friends are spending thousands of dollars retrofitting lighting and everything when they could spend a fraction and write some code. And learn a skill. And not have their privacy invaded. And have more money they always complain about not having enough of.
- neya 8y ago> I bet your people think you're as crazy as my people think of me. For one year, it was constant annoying discouragement. Then, once we had this party in my house and I showed it off to everyone and they finally realized its worth. To me, the privacy factor is alone worth doing this project.
- yeahitslikethat 8y agoMe too. A neat part of it is being able to share what I've built and get and feel the appreciation for what I've done. It's not like that in my software life. Like databases are not as... neat to most people but everyone can appreciate something they can see and touch and control.
- voltagex_ 8y agoWhat's your hourly rate? I've got a Google Home and LIFX bulbs, but I've also spent hundreds and hundreds of hours learning, tinkering and coding. I can do this because I'm single and am lucky enough to have a lot of free time. If I was doing it again, I'd stick with the LIFX bulbs and use the hundreds of hours doing something that would earn me some money.
- yeahitslikethat 8y agoInvest those extra hours inventing something! :) Then you can sell your hours over and over again.
- nerfhammer 8y agoI've been using the attiny84, iirc attiny85 doesn't support the lowest of the low power modes
- tmaly 8y agoWhat does your programming environment look like for programming these chips? Do you have any blog posts showcasing your project?
- neya 8y agoJust Arduino. >Do you have any blog posts showcasing your project? Started writing today. Haha. I will share it on HN once done.
- saagarjha 8y ago> the downside is you need to write code You might call that an upside!
- merpnderp 8y agoHow are you switching mains power safely? I looked into it, but gave up when I realized I'd have to install a rectifier in the wall which just seemed like a fire waiting to happen.
- lstodd 8y agoThere are basically two options: - learn how to and design a PCB with relays or FETs or whatever, following all the best practices for it to not catch fire. - buy off-the-shelf rail-mounted relays/contactors, then design a driving circuit that will be all low voltage. Assembling it all on a breadboard won't cut it (as in will blow up sooner or later), that's for sure.
- wrycoder 8y agoI use these blocks from Sparkfun: Solid State Relay - 40A (3-32V DC Input) They have four screw terminals - two for 3VDC to control and two for 24V - 380V AC for the load. They have the CE certification. I bolt them down inside a NEMA enclosure and use standard residential wiring techniques (buy a book or two!) to wire them to standard outlets, where I plug in the load. The controller (Arduino etc.) is typically mounted in a small plastic box outside the NEMA enclosure with a terminal strip to attach sensors and so forth. It's powered by a wall wart. This approach meets code and is perfectly safe. For level of competence needed - you should be capable of doing residential electrical wiring. That's a useful skill to learn.
- mopsi 8y agoYou can use smart plugs like Sonoff S20[1] and flash your own firmware. They have the widely used ESP8266 inside. I use ESPurna[2] on them, which has many common integrations built-in (Alexa, MQTT, etc) and is very easy to extend further. [1] https://www.itead.cc/smart-socket.html https://www.itead.cc/smart-socket.html [2] https://github.com/xoseperez/espurna https://github.com/xoseperez/espurna
- 83 8y agoI've been looking into this as well since the time/risk/insurance issues of diy are kind of putting me off. The Functional Devices RIB (Relay In a Box) devices for ~$10 look pretty slick, only downside is 12v control signal. I ordered a couple to play with but haven't had time to install them yet.
- cr0sh 8y agoAre you in the United States? I'm just curious how your homeowner's insurance feels about this? That is, will they still pay out for a claim should something happen, and they determine your modifications were at fault? Because if the adjuster or whomever does find you have such modifications - they -will- blame those. And probably deny your claim and coverage (and probably cancel your policy). At least that would likely be your experience if you live in the United States. I've often thought that having such a system would be fun, but the potential downside should anything go wrong has put a damper on it (even if whatever happened was not related to your modifications - they will blame it on them, just to get out of the claim). The only "inexpensive" way around it is to use UL listed interfaces made by a third party, then interface with those. But there, you don't usually get everything you want. Of course at that point, the insurance company might just shift the burden on you to "So, did you have this done by a licensed electrician? Where is your inspection report?"...
- mylons 8y agodoes insurance feel the same way about a Nest and other commercial devices that are already available?
- asteli 8y agoA homebrew device with some IGBTs controlling main voltages, controlled by an Arduino, is vastly different from a commercial product that has to pass UL/Intertek/TUV certification (not to mention FCC EMC compliance). Those certifications exist specifically to protect consumers from devices that will burn their house down. This isn't to say that I would discourage a hobbyist from building their home automation controls. I would strongly recommend learning about designing electronics for mains voltage (creepage and clearance, grounding strategy, fuses and other circuit protection, types of transformers and how they're built (double insulated?), capacitor voltage rating|derating, ripple current ratings, lifetime vs. temperature, etc. You can be a hobbyist and design things well, just be thorough when it's something that can set you and everything you love on fire if you do it wrong.
- 8y ago
- amingilani 8y agoWhat? How? Explain please. I've been interested in this for a while, and I know how cheap the ATTINY85 is but I just started experimenting with the Arduino, and just got a relay to switch on/off. Still learning how to get the ArduoCAM to work, and how I can transmit images over WiFi. My point is, can you link to a tutorial? I'm a newb, but I'm a fairly competent full-stack developer.
- ahirjay3979 8y agoHow to use this
- benj111 8y agoWhat do you mean? It's a comparison of a load of cheap micro controllers. How do you expect to use it?
- defterGoose 8y agoHow is babby formed?
- jokoon 8y agoThose usually can't even run a linux kernel, so you directly compile your program in C, you run it and that's it. It's very light on power, which mean can be turned all day without worry. To be honest I don't know how I would use this, because it's really really minimalist, doesn't have wifi, not enough memory to run a lightweight webserver, too slow to run a python interpreter... I wish there was something in-between a micro controller and the raspberry pi, so I can just run a minimalist webserver with some SSH, no usb plugs, only wifi. The raspberry also must also explicitly sets the SD card as read only, because it has a limited lifespan. The rpi is cool, but I wish there was a cheap, entirely open smartphone, that should be the next step... I guess there is a market for it, geeks would really buy it. I'm not a fan of building android apps, and most smartphone specs are way too fast and expensive for what I would do with them.
- pinewurst 8y agoThis is great but it should be noted that it dates from 2017.
- dang 8y agoOK, added. Thanks!
- jhallenworld 8y agoIt's missing the below 5 cents microcontrollers: https://lcsc.com/product-detail/PADAUK_PADAUK-Tech-PMS150C_C129127.html https://lcsc.com/product-detail/PADAUK_PADAUK-Tech-PMS150C_C...
- sgt 8y agoHow is the documentation on those?
- louky 8y agoNot great, Dave from EEVblog did a few videos on them and how to use them. I think they're all OTP https://www.youtube.com/watch?v=Rixo78hv_lw https://www.youtube.com/watch?v=Rixo78hv_lw
- cstuder 8y agoOTP = One-time programmable
- coupdejarnac 8y agoFine if you can read Chinese. There are several discussions about them at eevblog, with many people having success. It's probably the best place to get information in English.
- mrb 8y agoThe datasheet covers hardware + software (instruction encoding, I/O registers) and it's all in english here: https://datasheet.lcsc.com/szlcsc/PADAUK-Tech-PMS150C_C129127.pdf https://datasheet.lcsc.com/szlcsc/PADAUK-Tech-PMS150C_C12912...
- jdietrich 8y agoSurprisingly acceptable. The datasheets are reasonably legible and there's a weird but perfectly usable SDK. Padauk clearly don't care about the hobbyist market or more specialised applications that require certification or long-term availability, but their offering seems like an entirely reasonable choice for low-cost, mass-market products.
- sgt 8y agoI like MSP430 a lot but the tooling leaves a bit to be desired. Maybe that's been improved upon recently by TI but a few years back you were left with few choices other than installing some kind of IDE on Windows.
- rhodysurf 8y agoYou can use open sourced MSP-GCC developed by RedHat now and it makes things a bit better and more flexible about how you want to develop
- pmorici 8y agoTI distributes a pre-compiled version of GCC [0] for the MSP430 along with a command line MSP-flasher [1] utility for flashing code to the device. It all works really well on Linux. I haven't had to touch any of their windows tools. It can be slightly confusing getting started because there are 101 different ways to develop and compilers you could use so you have to wade though examples that may not be applicable to your chosen development environment. Once you get past that it isn't hard. I really like the tutorial series on simplyembeded [2] they to a great job of covering the MSP430 basics. [0] http://software-dl.ti.com/msp430/msp430_public_sw/mcu/msp430/MSPGCC/latest/index_FDS.html http://software-dl.ti.com/msp430/msp430_public_sw/mcu/msp430... [1] http://www.ti.com/tool/MSP430-FLASHER http://www.ti.com/tool/MSP430-FLASHER [2] http://www.simplyembedded.org/tutorials/ http://www.simplyembedded.org/tutorials/
- peter_d_sherman 8y agoAmazing article! (I was utterly unaware that this amount of choice and selection of microcontrollers exist, much less at this price point(!) -- before having read this article... you put a lot of work into this article and it shows.) This will be my new, first, go-to article, if I begin any new projects involving microcontrollers in the future...
- SlowRobotAhead 8y agoThe writer was on an episode of Embedded.fm podcast awhile back, one of the rare ones where they really get into embedded in detail. Good episode, I recommend it. Two take-aways were that he just loved the Silicon Labs EFM series, which is a modern set of peripherals wrapped around an absolutely outdated 8051. For the most part micros are just moving things from one peripheral to another and that can work out just fine. It's nice SI used SWD/JTAG as the debug peripheral so you can program it along side all the ARM parts you're actually going to use. And two... Having used almost everything on this list. I'm going to chose the ARM M0/M0+ 10 times out of 10 anymore. Maybe I prefer STM's peripherals to Atmel's event-eccentric, or whatever. I just can't honestly see starting a new project today on 8051, PIC16/24, AVR etc. Maybe it's what you're used to. Or maybe for someone making landfill-ready toys with razor thin margins, but I'm glad that's not me.
- voltagex_ 8y ago>8051 TI is still pumping out Zigbee boards based on it. I had to dig through documentation and tick a box saying I wasn't going to make missiles just to figure out what I needed to program it. I'm kinda curious about 8051 chips. They're absolutely everywhere, although maybe now the Espressif chips are taking over.
- SlowRobotAhead 8y ago8051 is OLD, Espressif is far newer. I like the amount of support that ESP gets but would personally never use it because I told trust Chinese networking chips. The 8051 makes absolutely no sense to anyone - except when you consider the extreme low cost. In the example of the SiLabs parts, they took the modern peripherals from their ARM chips and plopped them down to a 8051 core. Some times that will work great, but if you are doing any “real work” (preocessing) on chip just go with ARM. But, he, sometimes you need to toggle some LEDs and write something out over SPI.
- childintime 8y agoThe Renesas RX200 family would be a nice addition to the list. I'm curious how it fares against the ARM competition. The most amazing ESP8266 also reached $1 in volume, but isn't really comparable to other MCU's, with very few pins and a crippled ADC.
- SlowRobotAhead 8y ago>The Renesas RX200 family would be a nice addition to the list. Can you show where you're finding RX200s for under a dollar? Because... I was interested having never seen almost anything from Renesas near what I would consider a good deal. I can't seem to find anything even close [0] this being the cheapest RX200 chip I could find at $1.70 @ 5k [1] [0] https://www.digikey.com/products/en?dc=49904 https://www.digikey.com/products/en?dc=49904 [1] https://www.digikey.com/product-detail/en/renesas-electronics-america/R5F523T5ADFL-30/R5F523T5ADFL-30-ND/5719859 https://www.digikey.com/product-detail/en/renesas-electronic...
- childintime 8y agoFYI we buy the RX231 with USB below $1 (in volumes well above 5k). You're right that Renesas doesn't compete in online stores, they don't even try.
- tombert 8y agoI very recently started getting into microcontroller programming, and have subsequently purchased a plethora of different ESP chips on Banggood for roughly $3-8 a pop (though all of them have WiFi built in, and a few even came with cameras). I would actually be curious how these controllers compare to a $1 chip.
- krm01 8y agoWhat I really would like to see is some more competition and price drops in displays. These microcontrollers are awesome and I love building small hardware projects. But the output systems are usually pricey. If color (ideally touch) displays can be made available for $5-$7. That would open up a flood gate of opportunities.
- penagwin 8y agoOne of the most common outputs is relays, thankfully those are pretty cheap. Displays are getting close your price which is great. Depending on what you're doing you may want to consider purchasing something like a kindle fire for 50$ though and rooting it. Or even a pre-paid "smartphone" for under that much. Then use a microcontroller with it for GPIO. Non-touch 11$ - https://www.amazon.com/MakerFocus-128x128-Picture-Graphic-Routines/dp/B07B4BDWCL/ https://www.amazon.com/MakerFocus-128x128-Picture-Graphic-Ro... Touch 15$ - https://www.amazon.com/Elegoo-EL-SM-004-Inches-Technical-Arduino/dp/B01EUVJYME/ https://www.amazon.com/Elegoo-EL-SM-004-Inches-Technical-Ard...
- leggomylibro 8y agoColor displays are available for $5-7, although they are usually only 2-4" diagonally with up to 240x320 pixels at 16-18 bits of color per pixel. But it definitely did open up a flood gate of opportunity. You see ILI9341 and ST7735 TFT displays all over the place, even if they're a little too small for large pieces of equipment. Not to mention the explosion in cheap individually-addressable color LEDs and drone-driven advances in small DC motors. It's fantastic, you can pretty much just plug electronics together like Lego bricks at this point.
- snvzz 8y agoObligatory mention of ESP32. It might not be $1 but it's definitely worth being aware of.
- penagwin 8y agoAnd the ESP8266. Not as fancy but it's half the price. I love both the ESP8266 and the ESP32 a ton. They really made wifi projects "cheap" for entry-hobbyists instead of some 70USD wifi shield.
- altmind 8y agoYes, esp seems to be a great choice in 2019 - more IO, more ram, wifi. Digikey prices for esp8266 start at $ 1.85 https://www.digikey.com/products/en/rf-if-and-rfid/rf-transceiver-ics/879?k=esp8266 https://www.digikey.com/products/en/rf-if-and-rfid/rf-transc... , modules are a dollar more https://www.digikey.com/products/en/rf-if-and-rfid/rf-transceiver-modules/872?FV=ffe00368&quantity=0&ColumnSort=1000011&page=1&k=esp8266&pageSize=25 https://www.digikey.com/products/en/rf-if-and-rfid/rf-transc...
- techwolf 8y agoI picked up a few ESP01 boards from Aliexpress recently, they're less than $1.50 each. They only have two GPIO pins accessible (and one needs a pull-up resistor to make the ESP8266 boot properly) but for toggling a relay or reading a simple sensor over wifi they're hard to beat. They're even powerful enough to run a basic HTTP server to handle a light web interface for the GPIO.
- hackyhawk 8y agoAh yes, the tape-over-LED April Fools Joke
- sbradford26 8y agoI started learning embedded programming on ATMELs and to this day they are still my favorite. Solid documentation and pretty good command line tools when you don't want to use an IDE. Also you can find them sometimes in a dip package which is handy for prototyping.
- blhack 8y agoI feel obligated to mention in every one of these threads the wemos D1. I actually have a tough time explaining just how incredible this board is. You can program it in the Arduino environment, meaning if you are doing any hobby electronics, you're probably already really familiar with the programming modalities. It comes with a programmer, and power regulator. No fussing with anything like you might have to with a bare ESP8266. It also has WiFi. It is the magic internet of things that I swear everybody was dreaming about 5 years ago. Go buy 10 of them. They're my favorite favorite favorite general purpose dev board right now, and actually they're so cheap that I have no problem putting them into "finished products"[1]. Here they are for about $3: (https://www.aliexpress.com/item/ESP8266-ESP-12F-CH340-CH340G-V2-1-0-WIFI-Expansion-Board-Module-Based-ESP8266-Micro-USB/32963411851.html?spm=2114.search0104.3.3.226f11cc81cPtk&ws_ab_test=searchweb0_0,searchweb201602_6_10065_10130_10068_10890_10547_319_10546_317_10548_10545_10696_453_10084_454_10083_10618_10307_537_536_10059_10884_10887_321_322_10103,searchweb201603_52,ppcSwitch_0&algo_expid=a10ec08c-7bb2-4299-a8eb-79e1f5bc42ad-0&algo_pvid=a10ec08c-7bb2-4299-a8eb-79e1f5bc42ad https://www.aliexpress.com/item/ESP8266-ESP-12F-CH340-CH340G...) [1]: I build custom/one-off large scale installation pieces and hardware prototypes. Almost every single one of them has an arduino-ish device in it somewhere.
- sickrumbear 8y agothis looks really cool! any project write-ups online that show how it can/ is being used?
- Rebelgecko 8y agoIf you search for "ESP8266" (especially on a website like hackaday.com) you will see a lot of projects using these boards or very similar ones. You can also look up the ESP32, which is the big brother of the ESP-8266 with Bluetooth LE, more CPUs, and some other cool features.
- stevekemp 8y agoMultiple projects posted if you search my practical project involves polling a remote API to display tram departures https://steve.fi/Hardware/helsinki-tram-times/ https://steve.fi/Hardware/helsinki-tram-times/ But you also find out about constraints too. Driving an epaper display without running out of RAM was a fun challenge: https://steve.fi/Hardware/d1-epaper/ https://steve.fi/Hardware/d1-epaper/
- Darkphibre 8y agoOh, I really like his analysis on "Parametric Reach" for the various architectures: > If you want to commit to a single architecture, it’s important to know which one gives you the most headroom to move up. I created a fictious “times better” score by comparing the the part tested with the best part available in the same ecosystem — this usually means fairly comparable peripheral programming, along with identical development tools. I multiplied the core speed, package size, flash, and RAM capacities together, ratioed the two parts, and then took the quartic root. Essentially, if every parameter is double, it is considered “2.0 x” as powerful.
- iheartpotatoes 8y agoHe should have used the geometric mean, that's exactly what it is designed for.
- teraflop 8y agoMultiplying four values together and taking their fourth root is the geometric mean.
- iheartpotatoes 8y agoAaaand its too late for me to delete my post.
- FrojoS 8y agoFor those who needs something more beefy, check out https://www.nxp.com/support/developer-resources/evaluation-and-development-boards/freedom-development-boards/mcu-boards/freedom-development-platform-for-kinetis-k66-k65-and-k26-mcus:FRDM-K66F https://www.nxp.com/support/developer-resources/evaluation-a... They are about 60 USD per board, though if you want only the chip for a final product, it will become much cheaper. We use these development boards in combination with freeRTOS (bare C based) for lots of projects in our lab that require high sampling rates (e.g. 8 analog sensor readings at 1 kHz) motor control loops etc. There is a very good blog on these chips at mcuoneclipse.com
- danimal88 8y agoThis is really missing the ESP8266 imho
- roland35 8y agoThis is a great round up of cheap microcontrollers - I would love to take that approach of "scoring" peripherals to be able to compare various vendor's offerings up and down the lineups! As of right now it is hard to compare families at the start of a project, most of the time we just go with what we are comfortable with (and haven't been burned by in the last project!)
- OrgNet 8y agoI love my D1 Minis/ESP8266 that include wifi... got them for about $2 each and they can be programmed using USB (or even wirelessly).
- iheartpotatoes 8y agoHaving used half the IDE's this person outlined, I really really really really wish every single one had a "write Makefile" option. Maybe 1/4 or the IDEs I use do that successfully. I always end up using GDB for debugging, and then the IDE for asm-level tweaking (well, I don't do the tweaking, someone smarter than me does :), but I can do 90% of my work in GDB). In the "real world" IAR Embedded Workshop is the hands-down winner (licenses are $$$$$$), which is unfortunate because despite being so mature it is awfully clunky.
- imagiko 8y agoAgree so much. Every project I run, I start off working with the available IDE (Keil, Eclipse) that the manufacturer likes and then take the effort of writing a Makefile for it. Absolutely hate dealing with IDEs and their buried settings! Terminal, code editor and gdb FTW :)
- feistypharit 8y agoYou actually can use make instead of the Arduino IDE many times. For the ESP, check out https://github.com/plerup/makeEspArduino https://github.com/plerup/makeEspArduino. It works reasonably well.
- iheartpotatoes 8y agoYeah, I didn't know that existed but I created my own make environment a while back. My arduinos have been gathering dust for about 5 years, ever since I discovered the ST nucleo64 line ... 80MHz, 1M flash, 256K sram, 4 UARTs, 4 SPI, 4 I2C, 20+ GPIO, 4 ADCs for under US$15 ... I pretty much stopped using Arduino everything.
- chillingeffect 8y agoMe, too. But now that I've found the Teensy 3.6, it's my new goto. It's too expensive, but it has all the power. Also, I've been doing embedded for over 20 years and I'm starting to appreciate the simplicity of Arduino. It does get most of the job done. And when I had to modify the drivres, I was able to write completely low-level code. Only walls I've run into are tweaking the linker file. I haven't been able to locate that :( https://www.pjrc.com/store/teensy36.html https://www.pjrc.com/store/teensy36.html
- spacedog11 8y agoThe title is misleading because only the chip by itself costs $1. If you buy the microcontroller( chip + peripherals), it costs more than $1. For example MSP430: https://www.mouser.com/ProductDetail/Texas-Instruments/MSP-EXP430G2?qs=CLImetaeaXWH2pYG%252BA%252B4Vw%3D%3D https://www.mouser.com/ProductDetail/Texas-Instruments/MSP-E...
- sand500 8y agoYeah, I probably wouldn't be concerned about the cost of the actual chip but rather the cost of w/e dev board I would need for my hobbyist project. Maybe the complexity of wiring everything up if I were to put the microcontroller on a custom designed PCB.
- patrickyeon 8y ago"Microcontroller" refers to everything on the chip (usually, we would talk about it having a "core" roughly akin to memory + ALU + such, and "peripherals" which are on-chip dedicated hardware that migh be eg. I2C or USB communications, timers, ADCs, etc). What you're linking to we would call a "development board" (dev board), "demo board", "eval(uation) kit". I don't consider the title misleading, as the article is aimed at the people who are designing their own (hobbyist probably, but not exclusively) boards, and will be integrating the chip, not a dev board, into their project.
- boomlinde 8y agoThat's not what microcontroller means.
- deleted 8y ago[deleted]
- MagicPropmaker 8y agoI like the Pic16 because you need very little external circuitry other than the chip to get a computer running.
- setquk 8y agoI'm playing with the PIC10F320 at the moment. Minimalism is fun. $0.50 in 1 off quantities. 6-pin SOT-23 package. 16MHz. 0.5K of program space. 64 bytes of RAM. Waveform generator. ADC. Timers. PWM and the coolest thing a configurable logic cell which works while the CPU is asleep. I've got a semi-working morse iambic keyer in that and it uses 40uA of current running flat out. I'm working on sleeps now. I reckon I can get it down to 100nA average based on the wake time and 20nA sleep current. I can't actually measure down that low even with my 5.5 digit HP 3478A
- cushychicken 8y agoEight bit micros are the most fun.
- scrape_it 8y agois it possible to somehow buy this off-line in person in mass quantities? seems like it takes ages to ship from alibaba, also I'm afraid of the Chinese government tapping my phone (as I suspect happened on WeChat I foolishly installed, literally seduced by this Chinese chick who claims she's in Vancouver but then doesn't know where Surrey is???? red flags) potentially, so I want to tinker with these interesting DIY projects and get started with soldering and PCB etc., but I always can't be at complete comfort (I am well aware and conscious of the fact that my privacy standards are in the extremes), knowing what I read on HN all the time, maybe it's a good time to take a break. So I would really love it if somebody could sell me large bulk of various stuff like this that you could literally get from Alibaba in some vain hope that some wholesale buyer/middle man can make a premium off this paranoia, I'd gladly pay $3~$4 for this if it meant that somebody bought like a million of these for $10,000, and then sold me a chunk of that (at a markup of course which I'm more than happy to pay for the same reason people use VPN and Incognito or Tor), why not for electronics? tl;dr: Looking for somebody to start a wholesale brick and mortar business based on DIY electronic parts like this so I can pay with cash to escape suspected foreign state surveillance. Imagine a younger, ambitious, slightly politically sensitive you from the past, expressed a common consensus held by a specific group of like minded peers who believed that a certain country Brad Pitt made famous in the 90s should be free to exercise their political, religious and cultural will against an aggressor state, those things suddenly attract the wrath of peers from that said aggressor state, who think very differently from us, things escalated and I'm still to this day freaked out and feel tense when I hear people speaking the official language of said aggressor state. Call me disturbed, paranoid, I don't care, you weren't there man, you weren't there when the Charlies flanked us and got embassy involved. What is this...People's Republic of Vancouver?
- patrickyeon 8y agoPretty near all of this stuff is available from North American distributors, Adafruit/Sparkfun for more hobbyist-minded stuff, Digikey/Mouser/Newark for industry. Adafruit takes bitcoin if you're that paranoid. You're going to have a hard time getting along in the current world, especially in electronics, if anything Chinese sets you on edge though. I'm trying to be gentle, and I know you didn't ask for advice, but consider some counseling if you're "freaked out and feel tense when [you] hear Chinese people talking in Mandarin". Sounds like you're dealing with some history that you could afford to talk to somebody about.
- bborud 8y agoIf you work with multiple kinds of Microcontrollers I think you'd appreciate the Platformio.org project.
- ChuckMcM 8y agoThis was well done. As I have mentioned in the past, my discussions with people at Microchip and Motorola have conceded that with modern process technology the cost of the silicon is insignificant compared to the cost of packaging and testing. As a result you get to about $1/chip in singles as the low price cut-off but you can put an 8 bit, 16 bit, or 32 bit processor in there and it doesn't change the cost. It can cost more if you add a lot more FLASH or RAM. That takes up silicon real estate and is longer to test so it can reach the point where the dice is once again a meaningful contributor to the cost.
- patrickyeon 8y agoI guess that makes sense, and it's not a particularly new phenomenon. The MOS 6507 (used in the Atari 2600) was mostly the same silicon as the 6502 (as used in Apple II and many other places), but cheaper because it was in a smaller package.
- copperx 8y agoI would love to see a comparison of instruction sets for assembly programming. Sure, only a few people are going to program in asm, but a microcontroller is the best way to play with it. The MSP430 instruction set is somewhat friendly, but I long for the days of the Motorola MC68hc11. That was a beautiful instruction set, especially for teaching. Does anybody know how these chips fare for raw assembly programming?
- wiml 8y agoThe AVR instruction set is reasonably nice for hand-coding (and has a more modern feel to it than the 'HC11, which may be relevant if you're using it as a teaching example). I haven't used PICs since the PIC14 days; it was a painfully minimalist ISA like the 6502; the newer PICs are better, I gather. The ARM set isn't unpleasant but it's definitely a modern set designed as a compiler target rather than for hand coding, and most ARM chips are large enough there's no real reason not to use a compiler for almost all the code.
- hajile 8y agoI'd guess that 8051 is the easiest. I suspect that a huge percent of 8051 is still hand-coded assembly. It has an accumulator architecture and the instructions were made with hand-coding in mind (plus, there's not very many of them). I remember it being pretty easy to learn, but that was a long time ago. To me, RISC assembly tends to be quite a bit more complicated to write by hand. https://www.slideshare.net/Andriblovers/8051-instruction-set-12522439 https://www.slideshare.net/Andriblovers/8051-instruction-set...
- zw123456 8y agoExcellent work. The next time I am doing a project where I get to choose which MCU to use I have this write up book marked.
- ryukoposting 8y agoThose Infineon chips are incredible for how inexpensive they are. I've worked with an XMC1400 at work (another one of their M0-based offerings) and it was insane how sophisticated the peripherals on those things are, despite being a dirt cheap part. That said, their IDE sucks (well, every manufacturer-provided IDE sucks, but whatever). Life is way easier with a couple makefiles and Ozone.
- pizza 8y agoAnybody know any awesome cheap Raspberry Pi Zero W alternatives? Primarily looking for something ultra cheap, tiny form factor, not especially power-hungry, able to run not-too-weird flavors of linux, and preferably with (wireless) networking.
- ebcode 8y agoHave you seen the VoCore2? Ameridroid has them in stock. https://vocore.io/v2.html https://vocore.io/v2.html
- pizza 8y agoOh wow that's pretty awesome.
- ameridroid 8y agoVoCore store at ameriDroid.com: https://ameridroid.com/search?q=vocore*&type=article,page,product https://ameridroid.com/search?q=vocore*&type=article,page,pr...
- rramadass 8y agoExcellent article! Thank you. One of the few i will be consulting regularly.
- ThePhysicist 8y agoIt is really mind-bogging how fast processors are these days. A few days ago I read the marketing copy for the iPad Pro on the Apple website, where they said that their neural processor can perform more than five trillion operations per second. Initially I thought they translated it wrong from English to German (one trillion is "eine Billion" in German), but I rechecked it and it seems correct and actually makes sense for a highly parallel architecture that runs at a few GHz per second. Granted it costs more than $1 (though the production cost without factoring in R&D might actually be in that range) but it's still amazing that you can just carry such a thing around in your pocket.
- tronko 8y agoStupid question, would it have some sense to use a big array of these microcontrollers to create an actual chip neural network?
- jononor 8y agoWould only make sense as an art project, imo. If you want to run neural networks on micro-controllers, one ARM Cortex M4F (or M7/H7) will get you pretty far. Audio Classification with tens of classes, as well as low-resolution image classification.
- candiodari 8y agoAnyone know a good microcontroller with at least 3 DACs ?
- unwind 8y agoDid you look in the STM32 line? The first I found was the STM32F3x4 line [1], they have up to 3 DACs with 12-bit precsion it sounds like. Not sure about pricing, a quick Digikey search shows the STM32F334C4T6 listing at $3.72 in singles. ST has development boards too, didn't price those.
- candiodari 8y agoI think you may have forgotten the actual link.
- MrBuddyCasino 8y agoOne Dollar? Pah! I present to you the Padauk PMS150C three cent MCU. Its just one-time programmable, so better get it right the first time. https://hackaday.com/2019/04/26/making-a-three-cent-microcontroller-useful/ https://hackaday.com/2019/04/26/making-a-three-cent-microcon...
- xondono 8y agomy takes from my +10 years on this sector: - Unless you are building something with high volumes (or something trivially easy), development costs are going to be your biggest expense by far, specially firmware/software. - Using cheap parts is nice, and if you come from the DIY world you will know many such parts. If you are going to build something commercially, avoid those things like the plague, because they will become the biggest sinkhole of technological debt. - Software/Apps behave like high-risk investments (natural monopolies, zero-or-nothing situations, low initial costs), electronics behaves more like long term investments (high initial costs, high development path dependency). It's way more profitable to have a product you barely have to touch (but sells well), than several that need constant modifications. Which leads me to some tips: - There's not much sense in 8 bit / 16 bit microcontrollers for most projects nowadays. Don't fear going to 32 bit. - MIPS/AVR are nice, but if you are building something that is not a one-off (or you plan to build on the product), go with ARM (for now). - Build your PoC and prototypes on manufacturer libraries, but once you have the resources for it, well-thought and tailored libraries will make your life easier. - When working on libraries, don't write them directly from the datasheet. Go for the family references, target the whole family instead of a single chip. - Before chosing any component, specially the ones that are hard to replace, price is secondary at best. Availability is way more important. - If you are willing to take some risk, look at Rust for embedded. The language is still 'young' and there's a lot of stuff that needs to settle down, but man, does it look good.
- d21d3q 8y agoAnd for PoC pick one with more memory - e.g. you can find chip (like stm32f0x1) with same pinout, peripherals - you can optimize that later, and don't worry about it while using fat libraries.