Delay in Sensor reading when Arduino Powered with 12V adaptor

So I am trying to power an arduino to measure water flow. It works fine when I am powering it with laptop, but when I directly power it with 12V 1.5A adaptor the reading take a second to come...why is that?

Before taking the readings I am switching on a motor which is also directly connected to the adaptor just like the arduino.

Edit: Would adding a voltage regulator that steps down 12V to 9v between arduino and adaptor help?

How do you know? Where does your reading show? Serial monitor? LCD display? Something else?

It sounds like your Arduino resets when you switch the motor on. Is the motor controlled by the Arduino or do you have a simple on/off switch. A schematic will be useful.

Add an indication in your code so you know that the Arduino is running setup(); if you see that indication, you know that there was a reset.

Please post your code.

I am taking the readings on a LCD.

The pump (Sorry, not motor) is controlled by a 5V solenoid switch.

Sorry I am bad at drawing schematics (And scared of the labor), but I'll do it if its absolutely necessary.

Draw it. You can use pencil and paper, draw every single connection (pump, solenoid switch, display, power and gnd, everything).

Take a photo and include it in a reply.

I don't have deep understanding of this type of electronics but there are others that can advise.

Basically this below is the block diagram. I just don't understand. It works fine when I power Arduino through laptop, but when its 12V into VIN, its being naughty, the pump starts but the readings on the LCD screen takes a few seconds to start, which leads to overflow.

addition: I've also just noticed that sometimes mid flow the readings hang for a moment and then start again

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.