ESPHome & Velostat

Anyone have a velostat sensor working in ESPHome? Did you set it up using esp32_touch platform or am I in the wrong place? I want to use it to detect if my keys are where they belong.

I’m having some luck using a pressure sensor (like bed occupancy) but I think my keys might be too light so wanted to try out a sheet of velostat.

thanks

Goddamn you made me google velostat. Useful stuff, but not a lot on interfacing with esp32.

Everyday we get the opportunity to learn something new.

Yeah, I’m using it for bed occupancy. I saw @tom_l’s post with the duct-tape and wanted to try it. I built like 8 of these and they do vary even though I built them all the same way.

  • Duct tape
  • Aluminum foil
  • Copper tape
  • Velostat

It’s essentially a sandwich of material. Wire->Solder->CopperTape->AluminumFoil->Velostat->AluminumFoil->CopperTape->Solder->Wire. I used the little pieces of copper tape so I could solder the wire to the aluminum foil, it works great. Out of the sensor you have two wires, one goes to VDD (5V), the other goes to the analog input and through a resistance to ground. I found that 220Ω worked to give me a pretty good range.

Ultimately, the problem is that they are very sensitive. Throughout the day they’re very stable. Once I get into bed you can see that it jumps, then while in bed as I roll around the voltage swings wildly. That is causing the binary sensor I created to register me as getting out of bed, then back into bed many times throughout the night

image

Because I was using and ADS1115 (with four analog inputs), I ended up deploying two sensors for me and my significant other (head and body, each). This helps make the response of the binary sensor more stable (ORing the two inputs together) but still not perfect. I was chatting with a coworker yesterday and he suggested using a small cap to hold the voltage. I’m going to try this when my capacitors arrive in the mail, I think it’ll help.

It’s a fun project but I really think that a load cell would work much better if it passes the WAF. Mine would not let me turn our bed into a scale so this was the next best thing. :slight_smile:

1 Like

If your sensors are in the range of 300 Ohms like mine were you are going to need a very big capacitor to get a reasonable time constant (proportional to R * C).

A better way might be to experiment with the ESPHome sensor filters.

Sliding window average would be the one to use. It will slow the response time of your sensor though.

Thank you for taking the time to write up your explanation. The bed that I’m using it on is way too heavy for one person to lift and slide in the load cells, think car jack! Therefore I went with esp32_touch & foil sensors under the mattress as discussed in this post.

Works great. Just wanted to try something different with the velostat and had myself confused between adc & esp32_touch.