Servo "ticking" every time temperature sensor fires an event

Hello,

I am using Johnny-five with configurable-firmata. My application is built with node.js. I am using a mg996r servo and a DS18b20 temperature sensor, which is configured per this johnny-five spec: JavaScript Robotics: Thermometer - DS18B20 with Johnny-Five). I am using a 5v step-down converter from a 12v power source (which is plugged into the wall) to my breadboard to achieve a separate 5v power source from the arduino.

So for some reason, every time the temperature sensor sends a reading to node (I have it set to fire the event every 5 seconds), I hear the servo "tick" slightly. I tried connecting the temp sensor to the arduino 3.3v power to completely separate it from the servo, but that did not help. My theory is that the serial communication is causing the ticking...

Any idea why a temp sensor event would cause the servo to tick like this? I can create a diagram and paste my code if needed. Any help is appreciated.

Chris19832:
Hello,

Any idea why a temp sensor event would cause the servo to tick like this? I can create a diagram and paste my code if needed. Any help is appreciated.

Yea, do post code and schematic. I relate most servo issues to more needed power. By any chance is the servo hooked to a breadboard? Anyway, not much else to do till the schemo (not a Fritzthing) and code is posted.

Hey Idahowalker, I appreciate the reply. I think I finally figured out the problem. If anyone else runs into this, here's an explanation of what might be happening and how to fix it:

In summary:
“Arduino’s Servo library on AVR uses interrupts; if interrupts are disabled for any amount of time, the servos will twitch.
1-Wire protocol (used by DS18B20) needs to disable interrupts for the protocol to work. Therefore, servos glitch.“

This explains a lot of what Ive seen :o