So I made myself a cable like this, with a section of the outer insulation cut away so that I could separate the insulated conductors inside and put the clamp around just one of them.
When I tested it with the plain, unmodified coffee machine and found that it was quite easy to tell when the heater was running and when the PTC hotplates were on. Because of that I’m not going to bother with any internal interventions inside the machine at all.
I used emonlib (https://github.com/openenergymonitor/EmonLib) and the plain current_only.ino example. Worked great, and I noticed a few interesting things. The clamp can be calibrated to give actual representative current values but I don’t care about that, I just need any old numbers so I went with the standard calibration numbers that were in the code.
- Bottom PTC – peaked at 20,000 for less than a second when it turns on, then settles down to 2,500.
- Top PTC – peaked at 19,000 and settled at 4,000.
- Heater – immediate goes to about 52,000
So I think I can simply set a threshold around 40,000 and expect that breaking this threshold means that the heater is on. There’s no ambiguity about the hotplates and the heater. I’m going to make a cable with separate conductors that won’t terrify the electricians at work, and just use that.
I’ve just committed https://github.com/euphy/coffee_boss/blob/master/coffee_boss/coffee_boss.ino which is the code to read all these things:
- DS3231 Realtime clock on the i2c buss (SDA is 21, SCL is 22)
- load cells with the HX711 ADC on pins 4 and 15
- VCNL4010 proximity sensor on the i2c buss
- current sensor on pin 14
And the breadboard looks like this:
Next up is to make a little mount for the proximity sensor that holds it near the carafe.