
Why I stopped hacking the Amazon Dash button and learned to solder - ecaron
https://medium.com/@ecaron/why-i-stopped-hacking-the-amazon-dash-button-and-learned-to-solder-84386a38bbd1
======
Fuzzwah
I went through a similar experience when rigging up my own little "child sleep
improver" project. We play the same album of world music lullabies when our
kids go to bed. I wanted to be able to trigger playback remotely, so if I
heard my child stirring I could play the lullabies again and help them settle
again.

I'm also a R-Pi fan, so I rigged one up which allows me to have mplayer start
playing the album via a simple webpage which I access from my mobile phone.
That is excellent for the middle of the night times, but when we put the child
into bed at night I wanted a simple button to press to do the same thing.

I hunted around and just could not bring myself to pay $50 to $100 for a damn
button! Especially if I had to rely on some web service... It just seemed
ridiculous.

In the end I realised that I could just use a cheap wireless mouse. It is
stuck onto the change table; we left click to trigger playback, right click to
stop, mouse wheel to volume up or down.

~~~
sdegutis
> We play the same album of world music lullabies when our kids go to bed. I
> wanted to be able to trigger playback remotely, so if I heard my child
> stirring I could play the lullabies again and help them settle again.

FWIW that's super creepy and dystopian. In fact, now that I think of it, more
and more posts and comments on HN are really dystopianically unsettling
lately.

~~~
jimmaswell
Is this comment satire? I guess baby monitors are dystopian too now.

------
noonespecial
If he really wanted to "learn to solder", one of the esp8266 devkits from the
likes of sparkfun or adafruit would have served him better and been cheaper
and less power hungry as well. Running an entire Linux server nonstop just to
watch for a button press seems excessive.

Otoh, we've reached the point where you can reasonably run an entire Linux
server just to watch a button! Awesome.

~~~
ecaron
That's really where I burnt the first 4 weeks of this exercise. I would go on
those sites, read blogs/posts/product pages over and over, and get overwhelmed
and just shut down based on the number of options.

Probably a personal character fault. You're right that it is overkill. And
I'll probably be tossing some more money towards SparkFun soon too - but the
just from being a pure-software guy to buying/assembling the raw parts just
shut me down :-(

~~~
bsder
> I would go on those sites, read blogs/posts/product pages over and over, and
> get overwhelmed and just shut down based on the number of options.

Welcome to engineering. Pick one and finish the project. _Then_ look back.

Yes, running an RPi Zero to watch a button press is overkill. So what? It
optimizes _delivery time_ over efficiency. You can optimize for cost or power
later if you feel like it.

Anyhow, nice job.

------
mrb
Note that Amazon rolled out a second revision of the Dash button that is 4x
more energy efficient: _" I measured the new Dash Button’s energy usage to be
4.3±2.2 J per activation and the original Button’s energy usage to be 16.4±0.1
J per activation."_ Source: [https://mpetroff.net/2016/07/new-amazon-dash-
button-teardown...](https://mpetroff.net/2016/07/new-amazon-dash-button-
teardown-jk29lp/)

Although the Dash is still much over-engineered: for every activation it has
to establish (I believe) an HTTPS session and exchange a few requests with
Amazon servers. A much dumber wifi button sending a single packet should be
able to use 1/10th of this energy.

------
awqrre
The new Dash button is very different from the old one:
[https://hackaday.com/2016/07/26/bending-the-new-amazon-
dash-...](https://hackaday.com/2016/07/26/bending-the-new-amazon-dash-button-
to-your-will/..). and now, Amazon also has the over-priced Amazon IoT button:
[https://www.amazon.com/AWS-IoT-Button-Limited-
Programmable/d...](https://www.amazon.com/AWS-IoT-Button-Limited-
Programmable/dp/B01C7WE5WM/)

~~~
ecaron
Previous HN conversation on it is at
[https://news.ycombinator.com/item?id=11687463](https://news.ycombinator.com/item?id=11687463).
TNW article about it is also pretty decent -
[http://thenextweb.com/gadgets/2016/05/16/dash-
elsewhere/](http://thenextweb.com/gadgets/2016/05/16/dash-elsewhere/)

I suppose in the article I should have mentioned that I expected the button to
be able to fire whatever HTTP payload that I wanted. Probably an odd
expectation of mine, but that's the price I pay for my day job seeping into my
night life.

~~~
i2shar
(Reposting my comment from your other thread): FWIW, if you don't need
hardware, you can turn your phone into such a "button". Apps allow you to add
a widget to your home screen and can be configured to make arbitrary HTTP
requests.
[https://play.google.com/store/apps/details?id=ch.rmy.android...](https://play.google.com/store/apps/details?id=ch.rmy.android.http_shortcuts)

------
IgorPartola
In case you decide to go with a Dash button anyways, I made it easier:
[https://github.com/ipartola/amadash](https://github.com/ipartola/amadash)

I like the dash buttons because for the price you actually get decent value.
Compared to an ESP8266 board, you also get the button, the case, and the
battery. The interface for it is not th best, but this actually lets you
monitor for many button presses from a single Linux node, so I think this is
the cheapest solution.

That is not to discourage anyone from learning how to solder, or make their
own electronics, but in case you have a bunch of these Dash buttons around
already.

------
dvcrn
Very cool!

I too am a "pure software" guy. A few years ago I was really into hardware but
started to go with buying finished solutions instead of building things on my
own to save time and concentrate on the software.

I had no idea it's this simple to solder something together and speak to it.

Now I'd love to know how to do the same with a arduino or similar "less heavy"
build. Does anyone have links to resources in how to do that and how to get
started?

~~~
exDM69
> Does anyone have links to resources in how to do that and how to get
> started?

If you don't mind spending a little money (less than $100), get one of those
"starter kits" for electronics that come with an Arduino (or similar) and a
bunch of leds, resistors, caps and chips to tinker with.

From there on, it's really easy. There should be tutorials that work with the
kit you get or find a set of tutorials and get a kit to match.

If you want to build things that talk to the Internet, a Raspberry might be a
better starting point than an Arduino (for which you need an Ethernet or Wifi
shield, but they should be easy to use too).

I can wield a soldering iron but I've only dealed with analog audio
electronics before, but I was able to whip up a custom gaming controller for
flight simulator use using shift registers, multiplexers and LEDs (and 64
buttons) in just a few nights of tinkering.

~~~
DanBC
> I can wield a soldering iron but I've only dealed with analog audio
> electronics before, but I was able to whip up a custom gaming controller for
> flight simulator use using shift registers, multiplexers and LEDs (and 64
> buttons) in just a few nights of tinkering.

I would love to read about that!

~~~
exDM69
I'm sorry I don't have anything written down and seems like I don't have the
images of it around either.

Basically it was just a big ass 8x8 switch matrix made with multiplexers and
shift registers and cobbled together with some diode logic. This gives 64
"buttons", some of which are wired to rotary encoders and the rest are buttons
and switches.

It's got enough knobs and buttons to deal with all the navigation and
communication instruments in a small civilian aircraft. Alternatively, I've
thought of using it as a MIDI or similar controller for my software synth
projects.

The coolest feature was that there is a row of backlit buttons that have two
colored, two wire LEDs. Current goes one way -> LED is red, current goes
opposite, LED is green. Alternate the current direction quickly and you get
yellow. This is used for autopilot status indicator, e.g. when running in
heading hold (HDG) mode and going to intercept a VOR or ILS beam, the HDG led
is green and VOR led is yellow. When you intercept and autopilot changes mode,
the HDG goes off and VOR goes green.

Right now it's gathering dust, which is a shame but I haven't had time for
flight simming in ages. Building this thing cost me a lot of money since I
bought all the hardware new, and big beefy switches are damn expensive.

I learned a lot when doing it. Like that electrical current flows both ways in
a copper wire. I felt really stupid when I realized that I must use some
diodes to get my switches working.

~~~
whamlastxmas
Just FYI you can do this a lot easier in the future with a Teensy board.

~~~
exDM69
Care to elaborate? Most of my issues were with designing and constructing the
hardware. The micro controller and the software wasn't too difficult to deal
with.

The only issues I had were getting the LUFA firmware built to make the device
work as a USB HID game controller.

------
quickben
I didn't get the part about the color change for wake up? Can somebody please
shed some light on that sentence?:)

~~~
ecaron
We've taught our son that when the light turns red, it is time for bed. When
the light is blue, it is time to get up. It has been amazingly beneficial for
times of the year like Daylight Saving ending/starting because he's not yet
able to read a clock and know "Oh, its 4am - I should try and go back to
sleep".

~~~
quickben
Ah thanks. We will try this when ours is a bit older. Sounds like a great
idea.

------
mrbill
For the Dash, surely it can't be that hard to replace the soldered-in battery
with a couple of spring terminals so it can be easily replaced in the future..

~~~
homero
Rev 2 is already out and mine has spring terminals and a Duracell battery. But
the case must be cracked open

~~~
ecaron
Did you do a successful swap of the battery? Are there any markings on the
case that designate it being a Rev1 or Rev2 battery?

~~~
homero
Yes and yes [https://mpetroff.net/2016/07/new-amazon-dash-button-
teardown...](https://mpetroff.net/2016/07/new-amazon-dash-button-teardown-
jk29lp/)

New one also uses 4x less power, cheaper battery lasts twice as long

------
revelation
_— the program effectively is saying “Once every .2 seconds, send some power
over this one pin on the board, and let me know if the circuit is complete.”_

No, that's not how this works at all. You're just querying some bit in memory.
Nobody is "sending power".

~~~
noonespecial
Well, _someone_ is sending power and the bit does flip when the circuit
completes. Its just not happening quite on the schedule he imagines.

BUT, notice how even this slightly incorrect theory of how its working still
gives him 100% predictive power on how his system is going to work in this
case... so meh? Plenty of time to be less wrong later.

------
SunboX
The Raspberry Pi Zero is nice, but he should decider using a Arduino device
instead. Both are very different devices. Using a Raspberry Pi for this kind
of task is like using a big truck to get a sixpack beer.

~~~
snarfy
In this case the big truck costs as much to both purchase and drive as an
economy car. As much as I love my Arduinos I think this argument is flawed.
For a one-off project like this you should use whatever works for you. Also,
you could argue arduino is the big truck if you consider the software side
Nodejs vs C.

------
netsharc
When turning the lights on require you to go through the 7-layer ISO/OSI
stack. The future is dumb.

~~~
sliverstorm
Give it time, soon enough it will require GFLOPs, hadoop, and deep learning.

~~~
technofiend
The end result is an AI telling your child 'Shhhh, it's ok. Go back to sleep'
and humming a lullaby. I'm OK with this too as long as we ignore the dystopian
possibilities.

~~~
StavrosK
I have good news for you: The dystopian possibilities are already here, so
we'll at least get the usability for free!

------
artpi
I was also tempted to use new IOT amazon buttons with the IOT AWS offering (
[https://aws.amazon.com/iot/](https://aws.amazon.com/iot/) ), but after
looking a bit deeper, the free limit is not that high. Instead, I bought
ESP8266 Wemos D1 mini for $4 each. Instead of AWS IOT I used Google Firebase
and I have to admit, it works pretty sweet for me. IFTTT, Siri integration and
all.

[https://piszek.com/2015/06/24/smartpi/](https://piszek.com/2015/06/24/smartpi/)

------
curioussavage
I also am constantly looking for better easier solutions for things like this.
right now I think the wemos d1 mini is the sweet spot for ease of
use/versatility.

------
roel_v
Jebus, running a raspberry pi off a battery to turn a light on and off, and
it's dependent on an internet connection to function as well? Get a zwave
remote control and lights and have something that won't need rebuilding every
three months...

Yes it'll be more expensive than 15$ or whatever, but he claims he 'just
wanted someone to take my money' in the post.

~~~
abricot
This story wouldn't be very interresting if it wasn't a bit overengineered.

------
qwertyuiop924
man, I love the RPI. I will love the CHIP, especially the CHIP Pocket, if it's
any good, because it's a mobile device with PHYSICAL BUTTONS. That I can kinda
TYPE ON. And it RUNS LINUX, so I can code on it. This is truly a brave new
world.

>If you think tech that was in the PPC in '05 was revolutionary, that is...

SHUT UP!

 _goes to sob in corner_

~~~
seanp2k2
_pulls out Sony Clie PEG-UX50 with wifi, Bluetooth, IR, color screen from 13
years ago_ _whistles_ _pulls out Palm Tungsten C from the same year, also with
wifi, SD slot, and VPN support_ _removes 1988 Cambridge Z88 from backpack,
begins calculating in the spreadsheet app how far we 've come_

------
gwbas1c
Interesting! My house is full of multi-way switches that I want to replace
with "on" and "off" buttons. Whenever I look at fancy electronic switches,
they are expensive and the reviews indicate that they are very unreliable.

Perhaps I should just find some time to make my own on and off buttons?

~~~
jon-wood
(Disclaimer, I work for a sister company of Fibaro's UK reseller)

Depending on your definition of expensive you might like to look at Fibaro's
z-wave switches. They're small wireless modules that go inside the switch box,
sitting between the switch itself and the light circuit, allowing wireless
control and monitoring of the switch. They effectively decouple the physical
switch from the act of turning a light on and off.

You'll need a z-wave controller as well, and a bit of time to learn how it all
fits together, but the flexibility it gives you is pretty impressive.

~~~
tmzt
Can they be returned to manual operation, such as for inspection or turning
off a socket to change a bulb?

~~~
jon-wood
From what I've seen of them, no - they effectively turn the single loop
between switch and powered device into two distinct things, the switch(es),
and a relay that can turn the device on and off. Even if they could be it
would involve opening up the switch/socket box and removing it to get at the
actual device, which you'd presumably want to kill the entire circuit for
anyway.

------
mratzloff
Learning something new is great, but if you just want to turn the light on or
off with a remote, you don't need a computer or the Internet:
[https://www.amazon.com/dp/B0087EIDRS](https://www.amazon.com/dp/B0087EIDRS)

~~~
ecaron
This is more than that, though. This attaches to a web site where I can see
when the button was pushed, control the color based on time of day, and turn
it on/off remotely (plus define the length of time for the auto off).

------
braymailloux
You don't need a computer to turn on a light in the same room. you don't even
need digital electronics.

~~~
eddieroger
There are a lot of things we don't need. That's not a good reason not to try
something. The author learned a new skill and built something with his hands,
which is the reward, forgetting that his kid also had a stable light switch
now. Seems pretty fine to me.

~~~
peckrob
I'm currently building a cat feeder using a Raspberry Pi and a servo. Is it
way overkill? Well, yeah, probably. It's not that difficult to pour a cup of
cat food into the dish.

But I'm learning a whole lot of neat stuff in the process. I've spent my
entire professional career in software, dealing with hardware only at a high
level. So this kind of low level stuff - wiring, soldering, etc - is new to me
and something I've wanted to really dive into for awhile.

The point of the exercise is not because the cats need feeding, or that I
couldn't buy a programmable feeder already on the market. It's a pretext to
learn a new skill and actually create something _physical_ that I can interact
with. So much of what I do every day is ephemeral - it exists and bits stored
on various computers. This will be something that I can _touch_ and _see_ and
_interact with._ I can look at it and say, "I made that, hardware and
software."

And my cats will be happy too. :)

~~~
shabble
How are you handling dosing/delivery method? I've been (over)thinking this for
a while now and my prototype "lego hopper with RC servo controlled bottom
flap" didn't work particularly well, and would get jammed with kibbles, and
wasn't particularly consistent in delivering a fixed portion of food.

I'd like to find a nice big & cheap auger that could pull or push to dispense,
and have a lot more control.

The other suggestion someone made was a hopper with a close-toleranced
vibratory table/spout to bounce the appropriate amount out.

All this assumes you want arbitrary duration/portion dispensing, otherwise you
just need N bowls, and a rotary cover that opens each at a set time (which is
most commercial ones I've seen).

~~~
peckrob
> All this assumes you want arbitrary duration/portion dispensing, otherwise
> you just need N bowls, and a rotary cover that opens each at a set time
> (which is most commercial ones I've seen).

Mine current design will allow some level of arbitrary feeds and duration.

My current plans call for a sealed rotating drum with an opening that contains
~1/2 cup of kibbles, so each spin of the drum will dispense that much. Using
door brush to seal around the bottom of the hopper and the drum to keep
kibbles from escaping. The servo will rotate it from 0 to 180 and back,
allowing the kibbles to fall down a small ramp and into the bowl. My concern
with this design is that I may not be able to rotate the drum fast enough, but
I'll see if that's an issue when I get there.

Just spin it X times for X/2 cups of kibbles. I figure 1/2 a cup is good
resolution for a home project.

