Hacker News new | past | comments | ask | show | jobs | submit login

Does anyone know of a nicely packaged US smart plug that's not actually smart, but instead has an external input that I can plug a GPIO output into, and that has a solid-state relay so that I can PWM the plug?

This is the closest I could find, but it uses a physical relay, so it would be loud and probably incapable of any reasonable PWM rate: https://www.amazon.com/gp/aw/d/B00WV7GMA2

I'm interested in playing around with sous vide. I realized I have all the parts (anything Arduino-like, basic AC immersion heater, water pump, thermocouple with MAX6675 interface) except the SSR. I could buy a $15 SSR, but if I'm adding one to my collection of tools for this and future projects, I'd prefer it look more like a smart plug than a mess of wires and terminals that could be a hazard in the kitchen.

(Sorry to hijack, but can't resist this gathering of IoT enthusiasts.)




I'm not sure I would use PWM to control the flow of power to an AC appliance. That's more of a technique for getting analog approximations from digital sources.

If the purpose is to make a temperature-controlled water heater, you would probably be alright with just using that regular relay and switching power on/off to the element every few seconds. It takes a while for electricity to heat up water, and with some hysteresis / a PID loop you will get very accurate results, even switching once every five seconds.


Thanks (and thanks to petre down below). The Arduino PID libraries I found want to use PWM, but part of the appeal of the project was understanding PID in the first place, so perhaps I could adapt it to something like a 0.1Hz modulation rate and see where that gets me.

I assume it's hard to do proper AC PWM if you don't know when the AC sine wave's phase starts, preventing you from maintaining a consistent pulse amplitude over time. But I was hoping that something simple like a resistive heater wouldn't be too fussy about it.

And then there's the small matter of my home being constructed from flammable materials....


You can do PID using a discrete output instead of analog/PWM. It's a common use case. I think I've seen an Arduino library that allows for this. Or, you can use whatever library you're already using and convert the PWM value to OFF or ON. Slow down the loop so you don't get a lot of chatter on the output; add hysteresis if necessary.

If you actually want to do AC "PWM" (it's not really PWM), use a triac as suggested by another poster, and make sure it does zero crossing detection.


One could definitely use PWM on AC with a triac.

For the water heater he doesn't need PWM, Tasmota has a thermostat mode with hybrid PID control. There's Sonoff TH2 device that can do that. Dunno what temperatures does sous vide use but it can be definitely done with a Pt1000 or a thermocouple if not the regular digital sensors.


You might want to look into AC Dimmer products. I don't have a specific manufacturer / product to recommend, but I think you can find generic boards that'll do what you want. I _don't_ know if you can find one in a nice enclosure.

From what I remember, you probably want something that'll provide zero crossing detection. My vague understanding is you get the equivalent of PWM control, by cutting the AC sine wave relative to when it crosses zero voltage.


Shelly makes smart relays that you can put behind a standard plug.


Thanks. I'm looking for something that can be put away when the project is done and that can be moved to other places and used in different projects. I could spend a weekend figuring out how to build something safe with a quad box, or I could give $20 to someone who's already done it.


If you’re willing to do that why not just buy a sous vide? There are $50-60 ones available. I’m guessing cause you want to code the control, but just saying because there was a time when I couldn’t find one for less than about $300 but they’re more affordable now.


I actually already have one that works fine. It's less about cooking better chicken, and more curiosity about the software, PID algorithms, etc. The AC relay isn't all that interesting to me, so I'd be happy to treat it as a black box.




Join us for AI Startup School this June 16-17 in San Francisco!

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

Search: