Hacker News new | past | comments | ask | show | jobs | submit login
Show HN: Automated blind control via an Amazon Echo Dot and Raspberry Pi (jwahawis.github.io)
101 points by jwahawis on Jan 1, 2017 | hide | past | favorite | 30 comments



I love seeing stuff like this but I have to wonder - why aren't esp8266/Arduino/etc considered more often for these applications? I understand the Raspberry Pi seems obvious (and often is) but these kinds of solutions seem much less awesome when you realize the latest OpenSSL (or whatever) update applies to the full blown Linux installation controlling your blinds. Sure Arduino and others almost certainly have plenty of issues with their software stack but the attack surface is substantially smaller and lower cost and reduced power usage are benefits as well.


The biggest thing with Arduinos specifically is that the cheap ones don't really have the capacity to negotiate proper web services. They can't handle HTTPS, you are not going to be deserializing JSON in RAM, etc. By the time you pay for something like a Yun, you've spent more than a Pi. Also (prior to esp* WiFi breakouts) WiFi integration used up most of your I/O and cost 30+ dollars.

I've been playing around with a couple of CHIPs[0] that are cheaper than most Arduinos and come with Bluetooth, WiFi and USB built in, a bunch of memory, and run ARM Debian. They use NAND for storage so you don't need a SD card for the OS, and the forums are pretty active for a pretty recent hardware platform.

Other than still trying to get some SPI stuff integrated I've had no problem doing stuff I wouldn't want to use a Pi on and could not really use an Arduino on. I believe they're of better specs than anything but the latest Pi, maybe that as well.

For $9, I've been very happy with it, but I can't compare it to the ESP as I have a few laying around and haven't used them yet.

[0] https://getchip.com


The ESP, especially the esp32, can easily do HTTPS, WiFi, Bluetooth, JSON deserialization, and more with room to spare. All for less than $10 (less than $3 if you use an esp8266)


I'd imagine it comes down to accessibility. Many people probably have spare Raspberry Pis lying around as opposed to an Arduino with a wifi shield. Arduino would end up costing more and the processing capabilities isn't as powerful as the Pi. Not that the processing is important, but what if you wanted to tack on more functionality like adding a web cam, etc.

The other part probably has to do with language. Being that it's running on linux, you can program with a variety of languages versus just arduino language.


This is very true - at this point what self-respecting hacker doesn't have a Pi or two lying around to be re-purposed?

That said one of my favorite side projects last year was eliminating all of the Pis I had doing stuff like this. I used a NodeMCU ($9 Amazon Prime) and the Arduino SDK to replace my Raspberry Pi garage door opener (integrated with Home Assistant). Complete with magnetic door switch and no prior experience, I'd replaced the Pi after about two hours of hacking. Not worrying about `apt-get upgrade` is nice but the real bonus was noticing how much more robust the esp8266 wifi was compared to the Pi. In my garage door use case the difference was night and day.

Between this example and others around the house, I've noticed the Arduino ecosystem and community is actually much better for this kind of stuff. Once you really dig into things like GPIO, PWM, etc on the Pi it's clear they're second class citizens to community efforts surrounding video/HDMI (as one example). It's actually pretty incredible the same $35 board can control a stepper motor for your blinds or decode H.264 at 1080p while running Kodi in your living room!


My goal for 2017 is to start doing this kind of random hacking - I've slowly completed most of the guides in the Arduino starter-kit, and I've a bunch of esp8266 (D1 minis) on-order from China.

So far the process has been very refreshing, and as a long-time sysadmin working with these parts is a lot less frustrating than having to deal with distros on a pi.


True. Like rickyc091 pointed out, pis lying around and programming language would be a major plus for choosing it. An alternative for this problem would be https://www.kickstarter.com/projects/onion/omega2-5-iot-comp... Onion Omega 2 is more awesomer than esp8266( atleast according to the kickstarter video ).. $5 and runs linux out of the box, has wifi module built into it and has mods if we need them.. like pi zero.. I'll be getting mine in a week.. worth checking out..


A friend of mine has in their house a full fire alarm system, with pullboxes and flashers and everything. (No good reason for this, he thought it was cool and likes running wires.) He wanted to add to this system a way of sending emails when the fire alarm went off; the standard addons for his system to do this weren't readily available on eBay so he asked me if I could build something. "Easy," I said, "I'll just rig up an Arduino Ethernet[1] and grab an SMTP library."

This turned out to be a mistake. Problems encountered included:

- I don't know C++ all that well (for example, I was returning pointers to memory allocated on the stack). This is mainly an issue because you can't just attach GDB to a microcontroller, so debugging becomes guess-and-check.

- With the Ethernet and SMTP libraries initialized, I had barely enough RAM for the rest of the program, and wound up having to do some contortions to get everything to fit.

- Whenever there was a minor network hiccup the entire thing would freeze for twenty seconds. I had to rework the UI to disable itself before network operations, so it wouldn't freeze in the middle of a beep and screech loudly for the duration.

- GMail doesn't support non-SSL SMTP connections, and the Arduino isn't powerful enough to handle SSL. We had to install an SMTP service on a local server to act as a gateway.

After all this effort I finally got the whole thing to work, and installed it in his house. A year later something stopped working (I don't remember what, I think it was something about the SMTP server) and he asked me to fix it. I decided that it would be easier to redo the whole thing instead of trying to patch this new issue. I built an addon board for a Pi that had the same connector as the original Arduino shield I had built so it was a drop-in replacement (they even both run off the same 5v USB power supply!) The effort required to develop the Pi-based replacement was about a quarter of the original. This included getting rid of the separate SMTP server and adding some extra features like a web UI. To top it all off, the original Arduino Ethernet cost $65, whereas the Raspberry Pi that replaced it cost only $35.

On the other hand, the ESP8266 might start to tip this balance back in the other direction, especially with NodeMCU which provides a Lua environment.

[1]: https://www.arduino.cc/en/Main/ArduinoBoardEthernet


Too late now, but I suspect the simplest thing to have done would have been to have the arduino hit a remote URL to trigger the email-delivery, rather than doing it entirely standalone.


Actually, now that you mention it I think that's what we did in the end: I wound up building a "private cloud" (really more of a pileus than a full cloud) just for this one thing, whereas the Pi let me put it all in one self-contained box that I haven't had to touch since.


How might someone with only software experience know what motor, encoder, power supply, etc. to buy? Would this be an easy enough project to step into, or should one start with something more basic for a first project?

Btw, awesome work OP!


Thanks!

You can follow Adafruit's guide[1] to get started. I think on this project the software requires more experience to get setup, especially if you are working with a headless Raspberry Pi.

[1] https://learn.adafruit.com/adafruit-dc-and-stepper-motor-hat...


I managed to learn all this stuff by playing around with a breadboard and Arduino first. Sparkfun, AdaFruit + Arduino have a lot of beginner tutorials.

The first tutorial with Arudino will teach you how to light up an LED. Then figure out switches. Then look into motors and play around with other things like temperature, buzzers, etc. Once you do a few of these tutorials everything just clicks together. It's really just sending 1s (current) and 0s (ground) through the wires.

You'll learn that you can essentially break apart anything like a scale or a clock and just tap into the electrical connectors.


Most of this project is build using prebuild components/shields, so elementary electronics knowledge should be enough ;)


The time has never been better to learn electronics through experimentation. I would recommend using the fantastic resources within the Raspberry Pi or Arduino communities to get going. There are a lot of torrents.


I've wanted to do this too, since there's a lot of light pollution in my neighborhood but I also want to be woken up by the sun. Also FYI you should probably make those embedded youtube videos


Thanks for not making them embedded Youtube videos. Here in China, that would require a VPN just to see the unplayed still image, and lengthy buffering to see the video.


It's great to see a solution that works using some basic hardware and existing blinds. Not only does that make it incredibly cheap compared to commercial alternatives, but it also doesn't require implementation at time of construction (or a major renovation).

I recently have been working on the technical aspects of building a new house for my aging parents. We went with Lutron's Serena shades, because we also used Lutron's light controls and they feature both Nest and Alexa integration. Construction hasn't been completed yet, so I can't fully report on the final result. But, my initial tests have gone well and setup was simple. For reference, the per-shade cost is around $600 installed. Basic shades of similar quality would likely be $150-200 each, so it's a fair bit more but not outrageous.

I considered a DIY approach, but then thought about the primary users and realized an off-the-shelf solution would be best. Even in your own home, it's hard to overstate the importance of reliability and ease of use for your spouse, kids, guests, etc.


Thanks for posting thing. I've been thinking about how to go about doing this but didn't really know where to start with finding an appropriate motor and controller.

Will come back to this as a winter project, busy building a coffee trailer this summer https://goo.gl/photos/9rrRAZy7xSprWVnA6


No problem! The NEMA 17 form factor is quite ubiquitous so it's easy to find cheap hardware and compatible drivers. Be mindful that the same form factor has different windings and therefore different stall currents.


Totally love the cardboard "case" held together with some rubber bands. LOL, this is real hacking. I spent a bit of time learning 3D printing and printed a few cool looking raspberry pi cases but always looking out for cool case ideas.


Is there an App Store yet for either Alexa or Google Home?

I just got a google home and I want to program/add apps(games) or actions(movie times, order a pizza, call x friend on skype, call 911, record & playback my sleep talking recordings and many other ideas thought of).

I can't see why such an App Store isn't available yet for programmers and either Google or Amazon to profit from!!! One that is run like Apple's App Store where things are reviewed and approved, as for me I think these AI speakers are the next big thing like the iPhone.



So you can charge a buck for each download?

Also, I'm sorta partially to Google Home as I think it's AI is superior... though i could be mistaken.


I often wonder is it worth the _extra_ electrical energy spent on Alexa/Raspi/voice recognition automations. I am not a technophobe but if everyone moves to magic mirror, voice recognition everywhere what would the power needed to drive all these (comparing to your arm)!


I wonder if people are working with Alexa to automate houses for people with disabilities.


The article had the word "blind" and I thought OP meant home automation for the vision-impaired.

Combine Alexa and the tech for the Amazon supermarket that tracks shoppers and they could have a talking, listening assistant that can be your pair of eyes at home.


I'm about to start working on that.


I've been looking into something similar. Are you not reading the state of the blinds in anyway? For example, in the case of a power failure or reset.

It looks like your code just has a default.


I could write the last state to a file, but long term I plan on adding an encoder to the output shaft. The motors are intentionally not locked to limit power draw and allow manual adjustment.




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

Search: