how to safely hack a coffee roaster with a capacative drop power supply - Page 1
Forum section: electronics / beginners

author: dprotter
author_rank: Newbie
timestamp: December 09, 2024, 04:24:16 pm
content: Hi all, I'm hoping to get some advice on how to safely proceed on a passion project. I am trying to modify a pretty popular coffee roaster (FreshRoast SR800) so I can control it from my computer where I currently log temperature data. Unfortunately, I didnt study as an EE, so I've been trying to move through this project slowly. After learning more about how this power supply works, Im especially happy I didnt end up seriously electrocuting myself. (I'm sure plenty of comments would simply be "if you dont know enough to do this safely, you shouldnt do it at all..." which... fair!)What I really need is help deciding if there is a safe way to keep experimenting with this project.The basic way the roaster works is to use TRIACs to control the fan speed (resistive coil for voltage drop --> bridge rectifier --> 30V DC motor) and the heating element (resistive coil). The control is clunky and not very fine grained.The roaster is split into a power board that houses the TRIACs (and the optotriacs that do the actual triggering), a capactive drop -> bridge rectifier to generate 12V, and a LM368 to generate a zero crossing signal. The 12V and the 0-x go to a logic board that then takes user inputs via a rotary dial and sets the TRIAC firing delay. The optotriacs supplied from the 12V supply, and triggered by a transistor on the logic board connecting them to ground through a 1k resistor.I had just gotten to the point where I had successfully measured the delay times at various temperature and fan settings, and used an arduino analog pin to read the 0-x data. I was able to successfully set consistent delays after zero-crossing and trigger a MOSFET when desired. I also was able to send serial commands to the arduino to change that delay, which was tantalizingly close. I was just starting to try triggering the optotriacs, but nothing seemed to be happening when I did.At some point I came back to working on things and realized I had lost my zero-x signal, and that the power board was no longer producing 12V. In trying to learn more about how to diagnose what might have been going on with the capacitive drop power supply, I learned about how dangerous those circuits are, and how under the right failure modes (although I'm a bit unclear as to what those are) they could expose the arduino, my computer, and most importantly, ME, to 120V AC. I dont necessarily intend to do much diagnosing of the capacitive drop circuit, but I might consider buying another sacrificial roaster to experiment with.So, again, my question is: is there a safe way to proceed?I would likely want to have the arduino plugged into my computer for the simplest serial connection. Would it be sufficient to have the arduino isolated from the zerox signal by an optoisolator? And, similarly, putting those in between the arduino and the MOSFETs used to control the optotriacs?Thanks for the advice, and I am preparing myself for the (likely reasonable) safety lectures.

author: jwet
author_rank: Frequent Contributor
timestamp: December 10, 2024, 09:52:04 pm
content: I won't give you any safety lectures, this stuff is dodgy and any slip is dangerous.The part you show is more likely an LM358- a low cost dual op-amp. I didn't go through and analyze the circuit.Opto Isolators could likely make thing somewhat safer if you take some precautions. Opto isolators work by having just a light connection between the input and output. You can't share any grounds or supplies between the circuits. I would find some opto that have low current led operation- do a search on digikey, you don't want to load that little supply much.Connect any input you want to sample to the opto led though a suitable current limit resistor. Take transistor output to the arduino using only its 5v and Gnd. Use low current opto whose led's need less than .5 mA on the input side, the resistor to drive them could be very large, 10k or more to sample a 5v signal for example.To push a control in, drive the led of the opto with the arduino with suitable resistors using arduinos' supply- . Take the opto's output into the circuit to pull down what you want to control. Keep the currents very low, use large pull up R's on the roaster side, etc.Put these opto's in the roaster circuit and in its box, the wires coming out of the roaster will be just the input and output side of the side of these opto's and should be safe. Do the leakage test below before you assume so. Make your arduino connections to the led input and transistor outputs using only power supplies external to the roaster. There should be no wired connections that cross over the opto barriers of the isolators- this is the whole point. No grounds, commons, V+ etc. just light inside the optos.Before proceedsing, do a couple of safety checks. With an ohmmeter and the roaster unplugged, measusre the resistance between the isolated signal leaving the roaster to both pins of its power plug and and ground if it has one. R's by > 10 megohms. Plug the roaster in and measure the leakage current of this rig with a Good DMM (cat 2 rated). Measure leakage on each IO signal entering and leaving the roaster to Line Hi (Hot), Line Lo(neutral) and Ground. You can do this while the unit is open but be careful. There should be < 10 micro amps .01 mA of leakage and any of these lines. At this point, you have an isolated interface. Double check you workmanship and make sure nothing can cross the barrier. Insulate hot nodes and reassemble the roaster. You should repeat this leakage test annually.Be careful. Work slow and post again if you have more questions. This kind of stuff is done everyday in appliances, etc.The above is for information and educational discussion only. I take no liability for anything. Please do be careful.

author: dprotter
author_rank: Newbie
timestamp: December 11, 2024, 02:39:15 am
content: extremely helpful advice, thanks! ill start putting together a digikey order =)(and youre right about the op-amp, I mistyped the PN).

author: jwet
author_rank: Frequent Contributor
timestamp: December 11, 2024, 02:44:43 am
content: Thank me with the thanks button- its how I measure my success here.

author: Zero999
author_rank: Super Contributor
timestamp: December 11, 2024, 09:45:02 am
content: I strongly recommend replacing the capacitive dropper with an isolated power supply. It was perfectly safe in the original design, but connecting external circuits to it i.e. ardunio, computer etc. renders it hazardous.

author: Psi
author_rank: Super Contributor
timestamp: December 11, 2024, 09:56:37 am
content: yeah, i agree, replace the capacitive dropper with a normal isolated supply just for your own sanity.Capacitive dropper are a nightmare when trying to debug anything, it's all floating at 230V trying to kill you, including the ground.If you want something small you can build into something, instead of an external psu brick, Arrow still have some of these little pcb mount modules on specials for $2 instead of like $10 normally.https://www.arrow.com/en/products/pbk-3-5/cui-inc?q=PBK-3-585-264V AC to 5V DC isolated at up to 0.5A.You need a few external caps but they take care of the 110/230V to 5V conversion and are isolated.I've not used one yet but have 4 in my parts box already form my order last weekThey also had some 12v and 15V ones too i think.

author: BeBuLamar
author_rank: Super Contributor
timestamp: December 11, 2024, 05:25:05 pm
content: Do you have the schematic diagram of the original roaster? It seems to me that the roaster has all the controls needed.

author: Terry Bites
author_rank: Super Contributor
timestamp: December 11, 2024, 05:34:35 pm
content: Make coffee with a pot on the stove, fully programmable and works every time. Shock free too.How to make a capacitive psu the right way:www.tdk-electronics.tdk.com/en/373562/tech-library/articles/applications-cases/applications-cases/everything-for-capacitive-power-supplies-from-a-single-source/1380514Only an idiot would skimp on component quality.

author: BeBuLamar
author_rank: Super Contributor
timestamp: December 11, 2024, 09:21:51 pm
content: It seems that you try to build a new power controller for the heater and speed controller for the fan. I think the unit already has them. All you need to do is to figure out how to change their setting from the front panel control to your MCU. So all you do is to deal only with low power section.