
I tried the Cheapest Arduino Alternative (that Nobody heard of)
video description
Date: 2024-03-10
Related videos

• TED-Ed
Comments and reviews: 20
mariushmedias
Silicon Labs EFM8BB10F8G (16-20 pin soic/qfn) is under 60 cents at some distributors, if you order 100 or more. Has more ram and space for code compared to Holtek chips.
Second suggestion (besides trying Risc-V) would be to find a PIC16F microcontroller under a dollar as one can usually easily switch to other part numbers in the same family for higher pin count when needed, and also programmerrs for these are now available for under 40-50 dollars and you can reuse the programmer with hundreds of controllers.
I would also like to mention the slightly outdated but very informating The amazing one dollar microcontroller by jay carlson where he compares and views and benchmarks multiple microcontrollers that were priced at around one dollar at the time of the article (a few years ago)
reply
Silicon Labs EFM8BB10F8G (16-20 pin soic/qfn) is under 60 cents at some distributors, if you order 100 or more. Has more ram and space for code compared to Holtek chips.
Second suggestion (besides trying Risc-V) would be to find a PIC16F microcontroller under a dollar as one can usually easily switch to other part numbers in the same family for higher pin count when needed, and also programmerrs for these are now available for under 40-50 dollars and you can reuse the programmer with hundreds of controllers.
I would also like to mention the slightly outdated but very informating The amazing one dollar microcontroller by jay carlson where he compares and views and benchmarks multiple microcontrollers that were priced at around one dollar at the time of the article (a few years ago)
reply
sgsax
While you spent some time learning the syntax to code these chips, the good news is you can create your own reusable wrapper libraries that are compatible with Arduino code and make future projects easier and faster to build.
Arduino was originally based on Atmel microcontrollers, which have had really nice opensource tools for a long time. You can easily build your own programmer for them as well. You can still buy these chips independently and use them in your projects.
Fun project and demonstration of the power of more generic microcontrollers. Thanks for sharing!
reply
While you spent some time learning the syntax to code these chips, the good news is you can create your own reusable wrapper libraries that are compatible with Arduino code and make future projects easier and faster to build.
Arduino was originally based on Atmel microcontrollers, which have had really nice opensource tools for a long time. You can easily build your own programmer for them as well. You can still buy these chips independently and use them in your projects.
Fun project and demonstration of the power of more generic microcontrollers. Thanks for sharing!
reply
elektron2kim666
Making pauses in code is a bit off. It's better to count and use a variable. Mode 1 is the first 20. 000 or whatever.
Main_loop:
If c40000 then
c=0
endif
Now you can run a clock or whatever on displays and whatnot in between.
if mode=1 then
blink(x, y, z)
endif
if mode=2 then
blink(x, y, z)
endif
if clocktime or secret_project then
a _bunch_of_code(x, y, z)
endif
goto main_loop (or your way of doing it, maybe while true)
This is to help yourself, not me.
reply
Making pauses in code is a bit off. It's better to count and use a variable. Mode 1 is the first 20. 000 or whatever.
Main_loop:
If c40000 then
c=0
endif
Now you can run a clock or whatever on displays and whatnot in between.
if mode=1 then
blink(x, y, z)
endif
if mode=2 then
blink(x, y, z)
endif
if clocktime or secret_project then
a _bunch_of_code(x, y, z)
endif
goto main_loop (or your way of doing it, maybe while true)
This is to help yourself, not me.
reply
ccliewinutube
I have been using Holtek MCU for decades. It was the most popular MCU for DIY and electronic enthusiasts before Arduino was launched. The downside of Holtek MCU is the price of their emulator. Holtek MCU is ideal for project that involve mass production, but not for end user who only need one or two MCU for their circuit design. And for the e-link emulator, a bare board version will only cost around USD20 if you can find it in Taobao. Hope this info will help for those who would like to know more about this MCU.
reply
I have been using Holtek MCU for decades. It was the most popular MCU for DIY and electronic enthusiasts before Arduino was launched. The downside of Holtek MCU is the price of their emulator. Holtek MCU is ideal for project that involve mass production, but not for end user who only need one or two MCU for their circuit design. And for the e-link emulator, a bare board version will only cost around USD20 if you can find it in Taobao. Hope this info will help for those who would like to know more about this MCU.
reply
user-cs8qq5vt4v
If you are dealing with a new chip the first thing you should do is to blink led, but the second should be a memory bridge (remote memory accesses through UART) to a PC.
If you have a bridge and python running, you can read and write any memory location of any chip with python doing all dirty job of output formating. You can do OOP with python just like in micropython because all scripts are running on PC side.
A bridge is just simple firmware than can read and write memory via UART.
reply
If you are dealing with a new chip the first thing you should do is to blink led, but the second should be a memory bridge (remote memory accesses through UART) to a PC.
If you have a bridge and python running, you can read and write any memory location of any chip with python doing all dirty job of output formating. You can do OOP with python just like in micropython because all scripts are running on PC side.
A bridge is just simple firmware than can read and write memory via UART.
reply
danman32
Is programming hardware interface protocol really proprietary
For I2C, could do it in software, much like it is available in Arduino when you want to use non-standard GPIO pins. Perhaps take a look at the Arduino library and adapt it for this MCU.
I've gone register level programming in Arduino to speed up an EEPROM programmef project that was a takeoff from one of Ben Eater's projects.
How about one of the PIC chips They're pretty popular for projects like this.
reply
Is programming hardware interface protocol really proprietary
For I2C, could do it in software, much like it is available in Arduino when you want to use non-standard GPIO pins. Perhaps take a look at the Arduino library and adapt it for this MCU.
I've gone register level programming in Arduino to speed up an EEPROM programmef project that was a takeoff from one of Ben Eater's projects.
How about one of the PIC chips They're pretty popular for projects like this.
reply
stanleyyyyyyyyyyy
Actually the i2c master is much easier to implement than a slave, you could easily do it via bit banging. That is the reason why most cheap controllers don't support it directly. Doing a slave via bit banging is much more difficult, sometimes even impossible on high level controllers running proper operating system. It is a pity that you gave up so quickly: ) otherwise a nice video considering you are not a software engineer. greetings from Slovakia!
reply
Actually the i2c master is much easier to implement than a slave, you could easily do it via bit banging. That is the reason why most cheap controllers don't support it directly. Doing a slave via bit banging is much more difficult, sometimes even impossible on high level controllers running proper operating system. It is a pity that you gave up so quickly: ) otherwise a nice video considering you are not a software engineer. greetings from Slovakia!
reply
greatscott
I have heard, but never tried of some really cheap ARM microcontrollers. They are new and extremely capable yet very cheap. And from what I also heard you can program them with any SWD even made from RPI pico (no dedicated programmer! (at least as much as I know. There are for example Cortex M0 from PUYA - PY32F002. It is just amazing how much they packed there and it is so cheap.
I would love to see some tutorial on how to get started with ARM.
reply
I have heard, but never tried of some really cheap ARM microcontrollers. They are new and extremely capable yet very cheap. And from what I also heard you can program them with any SWD even made from RPI pico (no dedicated programmer! (at least as much as I know. There are for example Cortex M0 from PUYA - PY32F002. It is just amazing how much they packed there and it is so cheap.
I would love to see some tutorial on how to get started with ARM.
reply
h3xen0
8 cent: PY32F002/PY32F003 from PUYA for microcontrollers with an ARM Cortex M0 core clocked at 24/32MHz.
PY32F002 20kB FLASH, 3kB RAM, SPI, USART, I2C, ADC, timer. nothing to complain about.
PY32F003 additionally DMA and a few more timers, there is also an additional memory selection.
It is an SWD interface that does not require a special exotic programmer.
Power supply 1. 7V. 5. 5V, TSSOP, to small QFNs or DFNs.
reply
8 cent: PY32F002/PY32F003 from PUYA for microcontrollers with an ARM Cortex M0 core clocked at 24/32MHz.
PY32F002 20kB FLASH, 3kB RAM, SPI, USART, I2C, ADC, timer. nothing to complain about.
PY32F003 additionally DMA and a few more timers, there is also an additional memory selection.
It is an SWD interface that does not require a special exotic programmer.
Power supply 1. 7V. 5. 5V, TSSOP, to small QFNs or DFNs.
reply
Kanken-jl7oe
for less you could've gotten an arm based PY32F002A from puya. which has an ADC, (secretely also has DMA because it's a 030 on the inside) and many other goodies, it also runs at a 24mhz base clock. that holtek mcu seems wildly outdated to be honest. If you want to get something as cheap as possible then you could just get a PMS150 from padauk but even these are kind of a pain to work with nowadays.
reply
for less you could've gotten an arm based PY32F002A from puya. which has an ADC, (secretely also has DMA because it's a 030 on the inside) and many other goodies, it also runs at a 24mhz base clock. that holtek mcu seems wildly outdated to be honest. If you want to get something as cheap as possible then you could just get a PMS150 from padauk but even these are kind of a pain to work with nowadays.
reply
PyroRob69
It seems you have spent more than $1. 80 x 14 in just time to figure out how to use the cheap’ MCU. You stated a couple times that it took half a day to chase down problems. Just get one of the cheap arduino compatible MCU’s, use the quality IDE, and pull from the huge library of code already written (some by you.
Seems like a lot of brain damage for nothing unless you just needed a challenge.
reply
It seems you have spent more than $1. 80 x 14 in just time to figure out how to use the cheap’ MCU. You stated a couple times that it took half a day to chase down problems. Just get one of the cheap arduino compatible MCU’s, use the quality IDE, and pull from the huge library of code already written (some by you.
Seems like a lot of brain damage for nothing unless you just needed a challenge.
reply
WhiteDieselShed
How fast can that distance sensor update and how accurate is it I had a project in mind for a height sensor under a vehicle that would need to work whether
it was in slow traffic or 70mph on the motorway. Could it detect a 1 / 25mm drop I know it would need to average the height as the suspension dips on the bumps etc.
but thought it may work reliable enough. Any thoughts Thanks.
reply
How fast can that distance sensor update and how accurate is it I had a project in mind for a height sensor under a vehicle that would need to work whether
it was in slow traffic or 70mph on the motorway. Could it detect a 1 / 25mm drop I know it would need to average the height as the suspension dips on the bumps etc.
but thought it may work reliable enough. Any thoughts Thanks.
reply
DragoEliteN
Embedded hardware engineer here.
w95 interface is mostly an industry standard. It wont lag and will run on any crappy pc anyone could have.
For an i2c - you can always make soft-i2c through bit-banging. Thats always worth the time spend, because it allows our clients to pay us once for making it possible, than to spend lots(20-40%) of money on every device they'll need.
reply
Embedded hardware engineer here.
w95 interface is mostly an industry standard. It wont lag and will run on any crappy pc anyone could have.
For an i2c - you can always make soft-i2c through bit-banging. Thats always worth the time spend, because it allows our clients to pay us once for making it possible, than to spend lots(20-40%) of money on every device they'll need.
reply
WizardUli
Stop using term Arduino microcontroller. There is no such thing. Arduino boards (even the official ones) use various dissimilar MCUs many times of completely utterly ridiculously dissimilar architectures.
E. g. Arduino UNO R3 uses Atmel AVR Atmega328p and R4 uses Renesas ARM Cortex M4 based RA4M1. Even the basic computation model of those architecture is different.
reply
Stop using term Arduino microcontroller. There is no such thing. Arduino boards (even the official ones) use various dissimilar MCUs many times of completely utterly ridiculously dissimilar architectures.
E. g. Arduino UNO R3 uses Atmel AVR Atmega328p and R4 uses Renesas ARM Cortex M4 based RA4M1. Even the basic computation model of those architecture is different.
reply
akiko009
Next time you load a Chinese IDE, may I suggest doing so in a virtual machine dedicated to the task. Just to keep anything infectious away from your working environment. (Not that I expect Chinese IDEs to intentionally to include malware, but sometimes their developers don't practice proper security themselves and pass on what's on their systems)
reply
Next time you load a Chinese IDE, may I suggest doing so in a virtual machine dedicated to the task. Just to keep anything infectious away from your working environment. (Not that I expect Chinese IDEs to intentionally to include malware, but sometimes their developers don't practice proper security themselves and pass on what's on their systems)
reply
KarlMiller
Great video! It is important to show failures sometimes to highlight the thinking and work involved with solving novel problems.
I also liked it because I came across the same family of controllers while adding wireless control to a toilet seat warmer recently, so I could turn it on as soon as someone walked toward the bathroom.
reply
Great video! It is important to show failures sometimes to highlight the thinking and work involved with solving novel problems.
I also liked it because I came across the same family of controllers while adding wireless control to a toilet seat warmer recently, so I could turn it on as soon as someone walked toward the bathroom.
reply
DemetryRomanowski
Why not just bitbang the I2C implementation, if you only have 1 i2c device it shouldn't be too hard to do. If you don't want to deal with that the ATTiny202 does everything you want with a price of $0. 47 USD, note the datasheet specs it has SPI and TWI but as stated in Microchips device doc TB3181 TWI is i2c compatible.
reply
Why not just bitbang the I2C implementation, if you only have 1 i2c device it shouldn't be too hard to do. If you don't want to deal with that the ATTiny202 does everything you want with a price of $0. 47 USD, note the datasheet specs it has SPI and TWI but as stated in Microchips device doc TB3181 TWI is i2c compatible.
reply
amriteshkr8
Try an attiny402.
Costs 0. 38 here, should be available in germany but price may vary.
Upto 20mhz5v
2x uart ports
1x i2c
1x spi
2x interrupts
4x pwms
5x gpio(all can do analog or digital readings)
Can use at once:
1 uart spi
1uart i2c
2 uart ports
5 gpios
Edit: added reasons.
reply
Try an attiny402.
Costs 0. 38 here, should be available in germany but price may vary.
Upto 20mhz5v
2x uart ports
1x i2c
1x spi
2x interrupts
4x pwms
5x gpio(all can do analog or digital readings)
Can use at once:
1 uart spi
1uart i2c
2 uart ports
5 gpios
Edit: added reasons.
reply
bigclivedotcom
It was so close to programming in raw assembly code that you might have been able to bit-bash your I2C functionality. Even on the smaller chip.
The watchdog was the first thing that came to mind when I saw the way the LED was behaving. Every time you move to a new microcontroller there's a bit of a learning curve.
reply
It was so close to programming in raw assembly code that you might have been able to bit-bash your I2C functionality. Even on the smaller chip.
The watchdog was the first thing that came to mind when I saw the way the LED was behaving. Every time you move to a new microcontroller there's a bit of a learning curve.
reply
apruszko
Did you try to implement i2c master in bit bang fashion (master decides when SDA/SCL goes high when goes low, when send start condition on pair of signal, when receive an ack, ) I made this way on all MCU like c51 In early days when c51 does not support any kind of i2c buses. Btw thanks that show me new type of MCU
reply
Did you try to implement i2c master in bit bang fashion (master decides when SDA/SCL goes high when goes low, when send start condition on pair of signal, when receive an ack, ) I made this way on all MCU like c51 In early days when c51 does not support any kind of i2c buses. Btw thanks that show me new type of MCU
reply
Add a review, comment
Other channel videos














