Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

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



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?


For household energy usage monitoring, I installed an off-the-shelf DIN rail power meter with LEDs. I ignore the meter readout, but the LEDs give off a brief flash every Wh or so (don't remember the scale, but it was precise enough) — these flashes are processed by three phototransistors hooked up directly to I/O pins of a microcontroller, generating interrupts.

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.


Nordic seem to have the best understanding of what actually makes life easier for embedded software, which is really nice. Most other vendors seem to have done a lot of work to try and make things 'easy' but don't quite seem to have understood the goal.


I might be misreading your post, but there's nothing stopping you from using a gcc+make+$EDITOR workflow with the Kinetis or MSP430 chips either. I've done both, it's not even painful. (Admittedly I haven't worked with MSP430s in about a decade, maybe the situation has changed, but it seems unlikely.)


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 natural gas the same way by alternating through the relevant frequencies.


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.


You can get them in allicdata https://www.allicdata.com/products.html


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


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

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.


There are also cheap-ish USB devices that can do that [1] that you can stick in a raspberry pi and control with pretty much any language including python. For someone who shouldn’t be trusted with high voltage like me that’s the right level of tinkering.

[1] https://www.yoctopuce.com/EN/products/category/usb-electrica...


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.


I would be terrified of any kind of relay there. I had a few relays fail on my furnace such that they burned a 1" diameter hole in the PCB.


watermelon0 has the correct answer: [most] hobbyists should stick 100% to low-voltage low-current applications and use off the shelf certified hardware whene interfacing with high-voltage (i.e. mains) power.

MEE hobbyists, disregard.


Even with a MEE your Homeowner's policy may deny a claim due to non-UL listed components installed along the mains.

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 :).


If you have a device drawing high current, you would probably use a contactor (high-power relay), and then you can use low current (or even low voltage) relay/triac to drive the contactor from your circuit.


High power relays with safety certifications are typically used in mains boxes available commercially. In fact, I'm using the ones from my old mains box.

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.


I prefer having the REST API running on a raspberry pi or a local server, that can proxy things to Google Cloud and back, just because in case something happens to the internet connection, your house is bricked, by having a local instance your system does not rely on your ISP for speed and availability.

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?


Can you buy single items on AliBaba? I've been buying from AliExpress a lot because of the convenience, I didn't know you could do the same on the main site?


Are 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?"...


I agree. I bought a little relay board a few years ago to get started on a project for controlling line voltage, but then I started to think:

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


I went with a IotaWatt for measuring my home energy usage. It is based on the ESP8266 and is completely opensource hardware and software. You retain control of your data or you send to an external server.

https://iotawatt.com/


It doesn't measure voltage and thus can't measure true energy consumption = power, only currents. It then must estimate power based on some preset voltage. Not to mention those clamps can't have precision or time resolution for truly interesting stuff.

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.


The IoTaWatt does measure voltage. You plug in a calibrated AC wall wort as well as the DC USB power supply.


Well, sorry, then. Missed that bit on their site.

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.


> Not to mention those clamps can't have precision or time resolution for truly interesting stuff.

That's actually not correct. Clamps / current transformers are totally fine.


Then you haven't taken into account noise building up in every half inch of a cable that leads from the clamp to the instr-amp. Or do you advocate clamps with built-in ADCs? No objection then, as long as the wires carry digital signal but for the fact that this would cost so much it isn't funny. One might as well stick to off-the-shelf PLC-style rail-mounted IO modules and shunts/transformers then.


In the US the home owners policy like auto insurance isn't to protect the home owner. It's to protect the bank holding the mortgage.

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.


"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)."

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 an incident occurs and they identify additional components connected to the "trigger" you'd have to provide the whole "paper trail" for every single bit of your setup and show that it's above board: were the components certified for the use, were they installed by authorized personnel, were they operated properly, was the code you wrote for it to blame, etc. If you handled all the implementation yourself then it's hard to pass the responsibility along. While not impossible, it's still a high bar. And you wouldn't be in the best position to fight.

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.


> you'd have to provide the whole "paper trail" for every single bit of your setup

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.


Not sure I understand, you think it's an urban legend that an insurance company will do what it can to avoid a payout especially when the incident involves unauthorized modifications to the electrical wiring of the house, which ended up triggering a fire?

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


I believe it is an urban legend that homeowner's insurance claims (specifically fire damage to structure or other contents) are being denied with any frequency because a 'homebrew' contraption was present in the home, adjacent to the start of the fire, or even the source of ignition.

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.


Two things to consider:

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.


Are you saying you know of an instance where an insurance company sued their own customer for accidentally burning down their own house? I'd like to know more about the particulars because that sounds like another urban legend.


> that sounds like another urban legend

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


> "you think it's an urban legend that an insurance company will do what it can to avoid a payout"

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.


> Insurers aren't out to get you

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.


The relevant court decision in that link related to faulty construction resulting in water incursion over months/years. I don't see how that is at all analogous to the scenario we have been discussing (DIY smart outlet malfunctions, house burns down).

https://www.robinskaplan.com/~/media/pdfs/uncrackable%20cons...


They don't need to. They'll just claim it was and you'll have to take them to court if you want to counter-claim that.


> And probably deny your claim and coverage (and probably cancel your policy).

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.


does insurance feel the same way about a Nest and other commercial devices that are already available?


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


Here's a recent example where a guy designed an RF system (at 315 MHz) and it prevented garage doors opening in his neighborhood. He's described as an "electronics enthusiast". Thankfully, no one was hurt with this electronics misadventure. http://www.arrl.org/news/view/hams-help-trace-mystery-signal...


I'm not in the US, so maybe that's a consideration for these type of projects.


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


I did consider the ATTINY 84, in fact it was the 84 was the one I wanted to order. But due to a mistake, I had ordered the 85 instead. So, when they arrived, I didn't really feel like waiting another week to get working on this project, so I found an online hack/article that allowed me to use the 85s with just 3 pins. I can't remember exactly (it was a year ago), but something similar to this I guess:

https://www.instructables.com/id/NRF24L01-With-ATtiny85-3-Pi...


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


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


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


For 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=3...


But the RobotDyn Blue Pill has the correct USB resistor values. Also, a lot of unnamed Blue Pills come with bad voltage regulators. My time is worth the extra $2 ;).


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.


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


What? 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.


What'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


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


What does your programming environment look like for programming these chips?

Do you have any blog posts showcasing your project?


Just Arduino.

>Do you have any blog posts showcasing your project?

Started writing today. Haha. I will share it on HN once done.


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


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


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


There'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/


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


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


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


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


Invest those extra hours inventing something! :)

Then you can sell your hours over and over again.


Totally 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!)


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


I can’t really speak to the difference between ESPs and nRFs - I haven’t played with ESP mesh networking enough to compare them. The nRFs just get used because I already have libraries that I use and enough chips on hand. (I would imagine the ESP at this point is superior in every regard? It just has such an ecosystem around it.)

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.


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


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


Don't you have to run power to the blinds to run the motor to move them up and down anyway?


You assume the blinds are power to begin with.


The parent comment is talking about adding motors to their existing blinds.

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.


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


You 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

[2] https://github.com/xoseperez/espurna


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


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.


Do you have any write ups or code on this to share?


I am working on one. I will post it on HN when it's done :)


Cool, looking forward to it!


I've been using the attiny84, iirc attiny85 doesn't support the lowest of the low power modes


> the downside is you need to write code

You might call that an upside!


Sounds fascinating!

>> yet, vastly more powerful

What's sorts of things can you now do with this setup?


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




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

Search: