Live data from Hacker News

The Amazing $1 Microcontroller (2017)

jaycarlson.net

171–180 of 199 posts

Re: The Amazing $1 Microcontroller (2017)

#171
post #118
post #23

Earlier quoted context omitted.

As 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?

If your meter broadcasts your household energy usage, you may be able to use a ~$20 SDR dongle hooked up to a Raspberry Pi to read the kWh of the whole house several times per minute. 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 nat…

I've been considering getting an sdr, I think you've just pushed me over the edge - thanks! The dream however would be per outlet (or circuit) monitoring. Setting up alerts if wife leaves the hair straightener plugged in, fan left on, etc.

Re: The Amazing $1 Microcontroller (2017)

#172
post #8

My 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…

How 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.

I'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.

Re: The Amazing $1 Microcontroller (2017)

#173

Earlier quoted context omitted.

I actually prefer the Wemos D1 Mini. The D1 you linked has the same header layout as the Arduino, which might confuse a lot of people that you can use Arduino shields. Some of them might work, but probably not without modifying the libraries for them. 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…

I just got into the micro controller world a few days ago and it's overwhelming how many options there are! Between the pi, the Arduino, the ESP8266, Wemos ans so so many more which all come in so many flavors it's really tricky to the "ideal" one for a beginner like myself. The project I have in mind would require to work on batteries as opposed to plugin it into a well. It sounds like you're suggesting that anythin…

There are a lot of people who've shown how to use the ESP8266 powered off batteries for a long period of time. This [1] references a few and contains another itself. But they're not running all the time, it involves going in to deep sleep, and waking up very seldom.

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.

[1] https://www.youtube.com/watch?v=I3lJWcRSlUA

Re: The Amazing $1 Microcontroller (2017)

#174
post #49

Earlier quoted context omitted.

Sure. 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…

> You also need to include fuses and other safety circuitry to ensure it doesn't exceed that threshold your microcontroller can accept. 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.…

Of course, that goes without saying, to be clear, I'm not advocating buying random off the shelf parts from AliBaba. I recommend doing proper research and getting certified safe parts for mains and I also agree not to play with the mains if you don't know what you're doing, it is far from a hobbyist thing and the only reason I did this is because I have a background in electrical and electronics.

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.

Re: The Amazing $1 Microcontroller (2017)

#175

Earlier quoted context omitted.

My 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 o…

I wrote a firmware that lets me turn any attiny into a gpio-to-i2c and supports in-place-upgrade also over i2c. Now I have up to 20 extra gpio for 0.5$ or so. This is not very hard.

The thing with this kind of setup is that it almost always works out cheaper to just buy a microcontroller with more pins. For example, you can easily get hold of 48 pin Cortex M0 parts for under $1.

Re: The Amazing $1 Microcontroller (2017)

#176
post #47

I 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 b…

I actually prefer the Wemos D1 Mini. The D1 you linked has the same header layout as the Arduino, which might confuse a lot of people that you can use Arduino shields. Some of them might work, but probably not without modifying the libraries for them. 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…

The esp8266 has a deep sleep mode that can go down below 1 micro amp IIRC

Re: The Amazing $1 Microcontroller (2017)

#177
post #147
post #143

Anybody 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.

Have you seen the VoCore2? Ameridroid has them in stock. https://vocore.io/v2.html

Oh wow that's pretty awesome.

Re: The Amazing $1 Microcontroller (2017)

#178

I 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?

I'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...

Re: The Amazing $1 Microcontroller (2017)

#179
post #147
post #143

Anybody 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.

Have you seen the VoCore2? Ameridroid has them in stock. https://vocore.io/v2.html

VoCore store at ameriDroid.com:

https://ameridroid.com/search?q=vocore*&type=article,page,pr...

Re: The Amazing $1 Microcontroller (2017)

#180
post #101

I'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 ca…

Eight bit micros are the most fun.
Post reply on HN