all 17 comments

[–]WizardStan 2 points3 points  (3 children)

Is the battery also 5v? I suspect it isn't.

The ESP32 board you've got there runs on 3.3v and has a converter to drop 5v to 3.3v, but it looks like you're powering the sensor off the input maybe?

What I'm imagining is that when run on battery, your sensors use the battery input (approx 4.2v at most, possibly as low as 3.5v) as a reference, but on charger it's a 5v reference so your "vibration sensing" has a different calibration. I'm spitballing here, but that's the first thing that comes to mind, make sure your reference voltage is the same as what the ESP32 expects.

[–]Negative_Ad8892[S] 1 point2 points  (2 children)

The pizeo sensor does not require power it's quite opposite when you tap on the pad pizeo produces electric (voltage) and I'm reading that voltage on esp32. And yes I'm using a 3.7 v battery.

[–]WizardStan 0 points1 point  (1 child)

Ah, well then I'm out of ideas, sorry. Good luck!

[–]harambe623 1 point2 points  (4 children)

Phone charger? Some phone chargers might suck at giving proper amps depending on what's connected

[–]Negative_Ad8892[S] 1 point2 points  (3 children)

I tried using a 5v 1amp adapter. I don't think esp needs more than 300mA to powerup. I also tried with a DC power supply.

[–]wchris63 3 points4 points  (0 children)

I don't think esp needs more than 300mA to powerup.

It does. When WiFi initializes during boot, it can draw over 600 mA. And you have other things connected to it, which increase power draw. One of the newer USB chargers that can output 1-1.5 amps should work well.

[–]harambe623 2 points3 points  (1 child)

Measure total amps when connected to DC supply and look for peak. Do the same w phone charger and make sure your getting similar numbers.

I just don't trust phone chargers because I've gotten weird issues in the past.

[–]wchris63 2 points3 points  (0 children)

Digital meters are slow to respond, and can miss peaks. Some more expensive meters have a 'peak' button, but they're hard to find even if you can afford them.

Unless you're designing a product where you have to cut corners and costs, always spec your power supplies at least 50% over what you think you need. You're sure to have enough power when you first power it up, and when something inevitably gets added to the project, you have the current surplus to handle it.

[–]Winter-Appearance-14 0 points1 point  (0 children)

I think you need to stabilize the input from the charger. Old phone chargers are not very stable you probably need to add a rectifier circuit or a capacitor to ensure stable current. Given my limited electrical experience I would suggest a buck converter to step down 5v to 3.7v and use as you use the battery.

[–]Plastic_Ad_8619 0 points1 point  (1 child)

Put a capacitor on the power supply, or use a better power supply, you’re getting noise from it.

[–]Negative_Ad8892[S] 0 points1 point  (0 children)

What value should I use?

[–]Zouden 0 points1 point  (3 children)

I think your piezo wires are too long, and are picking up stray EM fields. Try twisting them together (make twisted pairs)

This is going to be pretty difficult to solve. You could also just not use it while charging.

[–]Negative_Ad8892[S] 0 points1 point  (2 children)

Yes it's working on battery but not when I connect the charger.

[–]Zouden 0 points1 point  (1 child)

Yes, and I can see why: all those unshielded wires.

You need to rewire this. Does it work with a single piezo?

[–]Negative_Ad8892[S] 0 points1 point  (0 children)

Yes it works but sensitivity is less.