I am making a device that measures temperature and vibrations and records the values onto an SD card. It will be a standalone device that is powered via the USB port, preferably with a USB wall adapter.
Design and debugging has been done with the Arduino powered via a laptop. However, when I tested the final device with a wall adapter, the vibration detection failed. The threshold was always overcome due to noise in the analog piezo read-out. It appears that the wall adapter gives a jitter or noise to the 5V which I am using as an input via a divider for the piezo. The noise trips the threshold.
The hardware used:
- Arduino Uno
- PCF8523 RTC clock
- MAX3186 + PT100 RTD temperature sensor
- Adafruit data logger shield
- Typical bare piezo sensor
The piezo sensor is read via analog input 0. It is connected with the red terminal to A0 and the black terminal to a voltage divider of 2x100K resistors between 5V and GND. A 10uF cap is attached from the voltage divider to GND to stabilise the signal. A 1M resistor is placed in parallel with the piezo to slightly reduce the sensitivity.
When connected to the laptop USB port, the resting value jumps between 511 and 512. The threshold is set at 518 to pick up any small vibration spikes. When connected to a wall adapter, the signal jumps +/- 50 bits so any small vibrations completely dissapear in the noise.
I would like some help to find the best way forward. I have some rough ideas but find it hard to pick the right direction:
- Change analog 2.5V from the divider to a stable signal (measure from GND? > means losing negative peaks...)
- Stabilise the current 2.5V divider signal
- Use a different 5V source
- Stabilise the USB wall adapter source