
Show HN: I've built self-opening trash bin, I relax myself feeding garbage to it - ivanilves
https://github.com/ivanilves/arduino-sketches/tree/master/basurito
======
wgrover
One request - after you toss in the garbage and the lid closes, make it "chew"
for a couple seconds by rapidly opening/closing the lid over a small distance!

~~~
jimmies
Oh boy that's not a good idea. I have a trash bin that opens automatically
just like the author's post. I really realy love it. But the lid doubles as a
fan when it opens and closes so it fans out the ordors. You'd want that amount
of fanning minimized.

~~~
OJFord
You've undoubtedly thought more about bin design than I ever have, or probably
ever will, do you have any suggestion for combating that fanning effect?

My kitchen bin is of the slide-out cupboard type, and also suffers from that,
despite being more of a shearing than a wafting action!

~~~
rusk
Treating this as an X/Y problem ... do you separate your waste? I separate
anything that smells (non-compostable food waste, non-recyclable junk) into a
separate pail, that is emptied every day or two, so it's never there long
enough to get smelly. The dry recyclable stuff can stay in there as long as it
wants, and the compostible stuff (waste vege material) never really smells too
bad, but again gets tossed more frequently.

~~~
OJFord
Compost, and then recycling (paper/tins/glass mixed where I am) and rubbish in
two bins in the same drawer thing.

That's part of the problem really - after compost and recycling I'm left with
very little waste, so anything that there is can sit there a while. I tend to
empty it because it's been there a while rather than because it's full.

------
every
"Who's a good trash can? Who's the best trash can? Here, have a treat..."

~~~
gadders
Yeah, need to make the response faster to so it can snatch stuff out of the
air that is thrown at it like a dog.

------
rohan1024
I would prefer those sensor by the side so that when the bin senses someone is
near it automatically opens up eliminating the need to wave first.

~~~
madbkarim
That would cause unintentional trigger don’t you think? I.e. someone is just
passing by.

~~~
_Microft
It clearly needs more tech!

 _We at Trashero value our users time, attention and privacy and are proud to
introduce IntelliBin AI, the worlds first truly intelligent trash bin. Using
computer vision and AI, it possesses true situational awareness and determines
the intention of users from the context. It will therefore only open the lid
when someone approaches it to actually throw something away (sometimes even
before users know it themselves!) but will ignore approaches when someone or
their cat just passes by. At a price of $299 (includes the subscription fee
for cloud connection for 2 years, $9 per month thereafter; you can put it in
salvage mode to get 10% off your next Trashero product), it is a truly
competitive product in the market of next-generation trash bins. At a modest
assumption of one intelligent trash bin per four-person household, we see a
potential of $1.2 T per product cycle (expected lifetime of 2 years)
worldwide.

We're hiring: Trashero is changing the world and you want to be part of it?
Submit your application through our Trashero Hiring App. Due to the math-heavy
nature of our work, we are expecting candidates to be able to solve any of the
Millennium Prize Problems in a reasonable time on the whiteboard, so you might
want to brush up on these in advance. For the more hands-on part of your work,
we expect 10-15 years of experience with K8s, Rust and TensorFlow._

When is the deadline for the next YC batch again? ><

(This is a joke and the names are made up if that's not clear from reading)

~~~
netsharc
The other day I saw a video of man demoing a sink faucet that reacts to "OK
Google, I want 500ml of water at 80 degrees Celcius".

Although a trash can that detects if you threw trash at it would be neat.

------
zestyping
This would be an excellent place to add googly eyes!

~~~
abiogenesis
We attached googly eyes to our robot vacuum cleaner because my daughter was
afraid of it.

~~~
StavrosK
I added a mustache too, it was instantly more likeable.

~~~
shoo
What style of mustache?

~~~
StavrosK
A full handlebar (sticker), she looked very dapper.

------
smusamashah
After reading the title I imagined a bin I could throw things at and it
suddenly opens and closes.

Would these proximity sensors alone be enough to detect a projectile coming at
it?

~~~
abiogenesis
The sensors could detect that, but a motor that opens the lid so fast could be
dangerous.

~~~
adrianmonk
Some garbage cans have lids that open inward, so I guess you could do it that
way.

------
jedberg
Hah, my parents have a commercial version of this. I hope his works better
than theirs, because their's is always opening and closing at the wrong times!

~~~
ivanilves
Mine really works fine. Ultrasonic sensors are pretty decent in presence
detection.

------
Waterluvian
I just love it. Well done.

Have you considered a weight sensor or maybe sound sensor to determine when to
close again? I assume it’s on a timer at the moment.

~~~
ivanilves
Glad you liked it. ;) Closing is on timer for now, yes.

Maybe I will add an infra-red or sound sensor to make closing more
intelligent. Good tip!

------
undebuggable
Took me a while wondering how and why the bicycle pump is part of the
project...

------
henearkr
And with a balistic trajectory detection it could gulp trash on the fly!

------
izietto
I use these:
[https://photos.app.goo.gl/TfKqBp2GVJjYkmYG6](https://photos.app.goo.gl/TfKqBp2GVJjYkmYG6)

------
hhas01
[https://youtu.be/rxgWHzMvXOY?t=17](https://youtu.be/rxgWHzMvXOY?t=17)

------
crearo
A better, possibly fast open/close design would be:

1\. to have a motor roll open and close the bin lid.

2\. the opening end could have a weak magnetic strip to "click" on that side.

3\. to have the sensors to the side of the bin instead of on top.

4\. my bin is under the kitchen sink, and I'd presume you'd want to hide your
bin too, and so you could use a simple light sensor there.

All this would make it a simple yet super effective solution to avoid the bin
fanning out odours.

------
layla5alive
Hope you don't have any pets who might not like the sounds from that
ultrasonic sensor...

------
QuinnyPig
Before clicking the link my impression was “big deal, I have a Twitter account
too.”

------
madacol
"basurito" LMAO

------
reportgunner
Garbage in garbage out.

------
rasz
[https://www.google.com/search?q=trash+bin+foot+pedal&source=...](https://www.google.com/search?q=trash+bin+foot+pedal&source=lnms&tbm=isch)

~~~
dole
Yeah, this is an iTouchless 13 gallon trash can.

------
SomeoneFromCA
The idea is good, but the code is very mediocre. The state machine has many
redundant checks, very difficult to figure out how it works.

~~~
ivanilves
Thanks for your expertise, you are very welcome to propose any real
improvements, if you can ;)

~~~
shoo
ivanilves, thank you for writing this up and sharing the code & the video of
the end result, it is a fun project!

As a thought experiment I've had a play to see what the state machine logic
might look like if we try to replace the bool state variables with a set of
explicit finite states, and to push the state transition logic into a pure
function. Results are here:
[https://gist.github.com/fcostin/851c1b4d1e3cb75ba972408151f1...](https://gist.github.com/fcostin/851c1b4d1e3cb75ba972408151f185ba)

It is more verbose, but one advantage of structuring it like this (that i've
only partially succeeded at) is that state transitions only happen at most
once per each call to advance_state. Might make it easier to read through and
follow the logic. It also makes the state transition logic easy to unit test,
since it is pure-functional instead of being mixed together with sensing and
doing actions (unsure how much of a concern or possibility unit testing is
with ino files, I've never done any arduino dev myself).

Not sure if this is anything like what SomeoneFromCA was thinking.

~~~
ivanilves
Thanks for your code, looks like this can help improving my state machine
indeed. I'll try to apply that approach when I get my next slice of free time
;)

------
joshxyz
But does it play despacito?

Pacito pacito basu basurito

~~~
ivanilves
Sounds like a key feature! ;)

