i have a project where i read two analogue inputs from two sensors and a pro Mini. I have some spikes in my readings that are present when i'm powering the system using a powerbank step-up module. When i use a 7805 and a 9V battery, the results seem clear. The spikes appear every 600-650ms.

Is there any way to filter them out on a hardware level without using code?

The frequency of the spikes is about 1.5HZ, too slow for a typical ripple of a "dirty" dc converter i think. My first though was that the module was checking for sufficient load to stay powered on. I added a dummy load but nothing changed. The project is a datalogger and unfortunately i don't really want the code to do the filtering, as it's gonna cost me some speed.

enter image description here enter image description here

  • 1
    Re “i don't really want the code to do the filtering, as it's gonna cost me some speed”: A 3-point median is a very cheap filter speed-wise, and should be quite effective against this kind of spikes. Commented Jun 6, 2023 at 20:37
  • Are you charging a battery while you are running the program?
    – Nick S.
    Commented Jun 6, 2023 at 20:59
  • No, i'm using a fully charged 18650 battery, not plugged in into an external charger.
    – stelPet
    Commented Jun 6, 2023 at 21:42
  • 1
    @stelPet to me, my initial thought process points to an inductive spike. I'm wondering if putting a snubber diode across the inductor will help with them; if not, you would have to resort to implementing a hardware filter as described below. Two more things to consider - how are you checking the voltage? If you are using a scope with an isolated ground, then you'd have to make sure that the ground are bonded together with the module and the scope - there was a thread on AllAboutCircuits - when I'll find it I'll link it. You could ask in EE SE.
    – Nick S.
    Commented Jun 7, 2023 at 16:21
  • 1
    @stelPet also, commercial dataloggers often use digital filters for filtering out 50/60 Hz and stuff like that. What is the application for your datalogger? Unless it's a high-speed acquisition FPGA-based datalogger, I doubt you'd have too much impact on your processing if you do minor digital filtering - it might be just easier to use Edgar's advice rather than fiddle around with soldering stuff to the module (at that point, you should be making your own module, I'm sure there are good charge regulator ICs out there).
    – Nick S.
    Commented Jun 7, 2023 at 16:23

1 Answer 1


On a hardware level, without a substantial delay, you could use active filters, such as active low-pass or band-pass filters, that can provide better control and customization over the filtering process.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.