The Amazing $1 Microcontroller (2017)
jaycarlson.net
jaycarlson.net
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.
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....
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...
I'm saying: the power consumtion of an LED seems minimal compared to the power consumption of the motor to move them up and down.
For powering projects, it depends - most projects I do can be plugged into a laptop or into the wall - I have a programmable light array that is the main project I do with the kids. For other portable projects, I might use 18650s, might use coin cells, might just use AAs. This is a big topic and I’ve been meaning to write this up in detail.
Thanks for the questions! Sorry it took me until now to respond.
>> yet, vastly more powerful
What's sorts of things can you now do with this setup?
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.
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
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..
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?
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.
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
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.
I'd say you need to include other safety circuitry, as well as proper PCB design, to make sure it doesn't start a fire.
If you don't know what you're doing, don't rely on random stuff from AliExpress etc to be grid safe, and don't try to make stuff that connects to the grid yourself.
If you do not know what you're doing, for stuff like this I'd go with say Fibaro Z-Wave stuff or similar devices which have built-in power monitors, and can interface with Home Assistant or similar.
MEE hobbyists, disregard.
I won't touch electrical on my house and will happily contract it out to a license+bonded electrician for the exact same reason.
That said really cool project and Kudos for tacking it, just make sure your smoke detector is working :).
Even theoretically, the only way a relay could catch fire if the coil inside overheats or if you pass very high voltages to the coil. But, with a well designed circuit, it should be fine.
[1] https://www.yoctopuce.com/EN/products/category/usb-electrica...
Having said that, you can always buy "modules" from Siemens, Honeywell, etc. Get your circuits audited by someone with more experience, in particular by an experienced electrical engineer before using it live.
Have multiple levels of fail-safe, fuses, fire retardant casings, what not. Just think of every possible worse-case scenario before you do it.
After all, electricity is no joke and can literally kill you.
I'd be curious of how do you update these devices, did you get OTA to work through an nRF24? did you need some external eeprom for that?
There are some little tools that make this easy: https://github.com/bemasher/rtlamr
You'll need to do a little detective work to separate yours out from the neighbors' but it's not hard.
For my house, I can also read water usage and natural gas the same way by alternating through the relevant frequencies.
This results in a safe, reliable and simple monitoring system.
On a related note, as to microcontroller choices: having done quite a bit of work with MSP430 and various NXP Kinetis chips, I am very, very tired of crappy software engineering practices, monstrous IDEs which are all a reworked version of Eclipse, bad libraries and frameworks which change direction seemingly every month. So I decided to stick with the Nordic Semiconductor chips (mostly nRF52832 and 52840 these days). Yes, they are more expensive per chip. But I don't use hundreds of them, and the savings in my time are huge: their SDKs are nice, you don't have to use their IDEs, you can stick to gcc and Makefiles, and it's overall a decent experience.
In general, while I really like the article series, I don't think the price of a microcontroller matters much in hobby usage. It's very important in commercial designs, but at home where you will never use more than 10 — who cares? It's the overall development experience that matters.
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?
Regardless, I find the minimalism of the ATtinies interesting too, but haven't made the plunge yet.
$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.
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=3...
https://www.instructables.com/id/NRF24L01-With-ATtiny85-3-Pi...
Now I have up to 20 extra gpio for 0.5$ or so. This is not very hard.
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.
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.
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.
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.
Then you can sell your hours over and over again.
Do you have any blog posts showcasing your project?
>Do you have any blog posts showcasing your project?
Started writing today. Haha. I will share it on HN once done.
You might call that an upside!
- 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.
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.
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?"...
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.
- Will the board short if it happens to collect moisture, oil, dust, or lint? What if a bug is attracted to it? Will I even monitor the condition of the board?
- Will the traces and relays heat up if I accidentally draw too much current through them? Will they degrade over time?
- Is there a chance that vibration could loosen the board and make unintentional connections?
I decided I probably could never answer these questions well enough to satisfy an insurance company. It doesn't matter that I have plenty of experience with line voltage; what matters is that I am not a licensed electrician. Therefore, at home, I only experiment with low voltage and low current, delegating all line voltage to UL listed devices.
A toy, in other words. It might be good enough to get a rough idea what eats more or less and when, but it'll never match the utility power meter which is what you're paying by.
cdrc: I rewire my houses myself, because those licensed loons can't be trusted with a 12V light bulb. At least that way _I_ am sure it won't blow up or burn or whatever.
Still, inductive current measurement with the sizes of the clamps they show and typical currents they're measuring isn't accurate at all. Not even considering that voltage measuremens via a wall wart would depend on what load is currently sharing the same wiring.
This might be my bias since I design similar stuff for solar offgrid, where a percent or ten off are that much in capex divided by battery lifetime, then multiplied by battery cost. It bites.
I don't trust inductive clamps at low currents. I would never trust measuring voltage on the same line as a load.
Hall sensors or current shunts; voltage dividers - all driving MCU ADC channels via optoisolated opamps. Everything measured as near to the source as possible. Otherwise you're getting nearly worthless data.
That's actually not correct. Clamps / current transformers are totally fine.
The flip side of that is the risk of a geek installing a power monitor without permits pales in comparison to someone plugging a 1500 Watt wall heater an an ancient wall outlet.
And probably deny your claim and coverage (and probably cancel your policy)."
I'm skeptical that an insurance company will be able to determine exactly what part you used and if it was UL listed unless you yourself tell them
If it's an electrical fire and they find modifications to the electrical wiring the chances of getting the insurance money are slim. Unless those modifications are explicitly covered by the insurance.
Given the kind of exposure insurance companies have they are willing to invest a lot in fighting the payout. It's their business model.
Can you cite any firsthand account of this sort of thing happening somewhere in the US? Given the ease with which people can reach millions of people with their tale of woe/outrage the fact that such stories are not readily available on social media makes me think this is mostly urban legend.
There's no need to cite firsthand accounts, you will find this in your own insurance contract. Insurance works pretty much the same everywhere, unauthorized modifications (especially to critical systems) usually invalidate any insurance claim when they can be linked to the incident. [0] Electrical wiring, plumbing, structure of the building, safety or security systems, etc. And it makes perfect sense if you think about it.
[0] http://www.insurancequotes.org/renters/3-major-diy-mistakes-...
Here is a link to a sample Homeowner's policy: https://www.iii.org/sites/default/files/docs/pdf/HO3_sample....
Exclusion B on page 12 is probably the relevant section. It excludes loss due to "Faulty, inadequate or defective:... workmanship, re- pair, construction, renovation, remodeling,..." but also contains an "ensuing loss" exception.
Here is an article about that: https://www.irmi.com/articles/expert-commentary/ensuing-loss...
> A classic example [of an ensuing loss exception] is if faulty repair resulted in improper wiring and the improper wiring caused a fire. Almost every insurer would pay for the fire damage, but not for the repair of the improper wiring.
1) The insurance company will more often than not sue the party responsible for the faulty workmanship that triggered the incident to recover the money (I've seen this happen). In this case the owner is that party.
2) One real example is enough to show it's not a legend and you provided it yourself:
> Some courts have upheld this rather cramped reading of the exclusion, while others construe it properly and require insurers to pay for the water damage
Since it's upheld in court I find your statement that it's an urban legend pretty confusing. It's like showing a picture of the night sky to prove the Sun is a myth.
YMMV of course, you should read your own contract to see what's stipulated and how comprehensive it is, and case law in your jurisdiction to see if courts would rule in your favor. But better be safe and start from the assumption that the "urban legend" is real since courts support it. It's the kind of legend that might cost you money.
Another? Didn't we clear this one already above when your link showed courts upheld the "legend"? Are you contradicting me or the courts? Feels like you're no longer looking for any evidence, just grasping at straws.
Plenty of resources that tell you that it's perfectly possible to get no payout (depends on your contract of course)[0][1]. Or they will pay out but capped to a low figure [3]. Again, read your contract and decide what applies to you, pray there's no fineprint to screw you over.
[0] https://www.boss.info/us/consumer_warning/
> unauthorized modification of electrical wiring may void your homeowners fire insurance policy
[1] https://www.quora.com/Is-it-illegal-to-do-electrical-tasks-w...
> Most jurisdictions require a permit to be pulled for most electrical work
[3] https://www.reddit.com/r/HomeImprovement/comments/7vwe23/doe...
P.S. No, I do not know any cases where the owner was sued but I do know many cases where the insurance company payed out and then sued the company that did the faulty repairs to recover the entire payout. I also know one case where a faulty repair done by the owner caused a fire that injured the tenant - the owner was found guilty of recklessness/gross negligence (no idea about the insurance in that case).
First-party claims, absolutely. Insurers want to pay when they are liable, and they don't want to pay when they are not. Your contract defines that, and your contract is written in plain English.
Insurers aren't out to get you, and the insurance industry doesn't rely on shafting people to make money. When you purchase insurance your policy is priced according to the exposure it creates, but a lot of people mistakenly assume that the insurer's profit comes from premium payments. It often doesn't. From what I have read, insurers are generally happy to break even on premiums vs. payouts. Their profit comes from investing the float and earning a return on those investments.
Related, I think that most people don't understand how tightly regulated insurance is, and how much it can suck for an insurer to improperly deny a claim. It creates huge legal and regulatory exposure for the insurer.
Indeed they are not. They are out to maximize profit either by not paying out when possible (sometimes only if forced by the court), or by paying out and recovering the money from the party to blame for the damage (in this case also the owner). And as the links provided below show, many courts see it their way and consider that damage cause by faulty workmanship is not covered by insurance.
I've done my part, the court supporting my claim shows it's as real as it gets. If you want to support your claim that it's an urban legend all you have to do is show that this never actually happened.
https://www.robinskaplan.com/~/media/pdfs/uncrackable%20cons...
Can you point me to an instance of this actually happening? I see this warning given all the time but have to date never found an instance where someone's claim was denied for these sorts of reasons.
My point is, can you link to a tutorial? I'm a newb, but I'm a fairly competent full-stack developer.
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...)
[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.
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:
Great value - program them as if they were an arduino
The D1 Mini actually has it's own shield format, and several shields are available. Even experienced people will find value in the ability to just plug in a display, or other device and use already available libraries. Maybe not great for production work, but great for prototyping and learning.
I think the big downfall with any ESP8266 board compared to others is going to be power consumption, even with WiFi off. So anyone not plugging theirs into a wall should do some research in that area.
[0] https://www.sparkfun.com/products/13664 [1] https://www.arduino.cc/en/Reference/RTC
edit: Oh sorry I missed the "with wifi" in your post. One nice thing about the ESP8266 is that lots of people use it -- hopefully that means you can find details on how to run it in low power modes.
If you don't need actual WiFi, and instead just need wireless communication, there are other lower power modules you can use like the nrf24l01, LoRa, and other generic "Wireless Tranceivers". If you need them to have internet access, you can create a gateway which the remote modules communicate with, then have a ESP8266 plugged into the wall to proxy the requests.
Does there exist a similar board with an ESP32?
It seems like small power-efficient microcontrollers have made enormous progress over the past decade, and we have an opportunity for the PC revolution all over again. The ESP32 is a little bit power-hungry, but it's also a proper CPU; it has two 240MHz cores, a few hundred kilobytes of RAM, an extra low-power core that can wake the main system up from sleep, and an MPU that can keep track of 8 process IDs per core including 2 privileged ones. People used to make do with less. It also has WiFi and Bluetooth and these days you can even write programs for it in Python.
I'd love to see more people thinking about the problems in their lives with relation to a $20 bin of modern parts. Sensors, displays, and actuators have made similar progress, and the possibilities are endless. But the pool of people trying to realize them is finite and way too small.
I set up a thermal sensor that updates a Parse (remember them!) clone. Working well but sometimes it just stops updating, not sure if it is the device or the Parse clone's fault or a bit of both. But it works nicely for a day or so at a time.
Just a reminder things might not go smoothly with these devices, they are tricky to debug if they crash. When you are communicating via http the apis are not as nice as I am used to on the desktop.
- 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.
https://lcsc.com/product-detail/PADAUK_PADAUK-Tech-PMS150C_C...
There are several discussions about them at eevblog, with many people having success. It's probably the best place to get information in English.
I will say that for the particular one that OP linked above, this does seem the case since the datasheet mentions "ll the 64 bytes data memory of PMS150C can be accessed by indirect access mechanism."
Harvard doesn't specify if you need an indirect access mechanism, plenty of HV computers can access their code memory fairly normally (either by using a special bit in the bus or opcode or mapping it into a unused section of normal address space). Harvard simply means that Code and Data come from a separate bus and in most cases that means separate devices.
If your MCU has two seperate specs for Flash/EEPROM as Data and Program Memory, then it's 100% Harvard. And that's basically most of them.
For sure, my experience has probably tainted my outlook. I have the most experience with Renesas MCU's and for example on them, I can surely run programs straight from the RAM, and depending what you're doing, you might sometimes be forced to do so. I worked with Cortex M also, and they're flat address space too.
I did check out the specs for Atmega MCU's and it seems those, as you described have different address spaces for data and code areas. What I want to say, I guess is that you can have a huge variety of options and architectural approaches for MCU's.
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.
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.
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.
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.
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.
> 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.
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?
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.
https://www.slideshare.net/Andriblovers/8051-instruction-set...
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
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
https://hackaday.com/2019/04/26/making-a-three-cent-microcon...
[0] http://software-dl.ti.com/msp430/msp430_public_sw/mcu/msp430... [1] http://www.ti.com/tool/MSP430-FLASHER [2] http://www.simplyembedded.org/tutorials/
This will be my new, first, go-to article, if I begin any new projects involving microcontrollers in the future...
I would actually be curious how these controllers compare to a $1 chip.
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.
That said, their IDE sucks (well, every manufacturer-provided IDE sucks, but whatever). Life is way easier with a couple makefiles and Ozone.
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!)
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-Ro...
Touch 15$ - https://www.amazon.com/Elegoo-EL-SM-004-Inches-Technical-Ard...
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.
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.
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 [1] https://www.digikey.com/product-detail/en/renesas-electronic...
https://ameridroid.com/search?q=vocore*&type=article,page,pr...
One of the few i will be consulting regularly.
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.
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?
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.
PS: I buy most of my electronics from mouser or if its a hobbyist pre-assembled item, sparkfun/adafruit. I am just a hobbyist, though.
In any case, good luck.
It's a comparison of a load of cheap micro controllers. How do you expect to use 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.