Noise on Arduino servo PIN?

This is my first project but I’m trying to understand an issue that I’m having using the Servo.h library to trigger a camera. The basic setup is a camera trigger on PIN 6 using the Servo.h library and every time the write value changes, it triggers the camera to take a picture (I’m using the Arduino UNO). The following code works when ONLY the camera is attached:

#include <Servo.h>
const int driverPin = 6;
Servo camTrig;

void setup()
  pinMode (driverPin, OUTPUT);

void loop()
  Serial.print("HIGH ");
  Serial.print("LOW ");
  delay (5000);

Now, when I add a whole bunch of other devices (Compass, GPS, LCD, SD, buttons) to the project, when camTrig.write=180, then all is OK. BUT, when camTrig.write=0, there seems to be changes in the signal that inadvertently trigger the camera.

I don’t understand why this is occurring. Should I put something between the PIN and the trigger in order to filter the signal? Should I use a different PIN (I’m using PIN6)? Any other suggestions?
Thanks in advance for your help,
Conrad :slight_smile:

Is the camera controlled by a PWM signal? That is what is done in your sketch. PWM = PulseWidthModulation. Not impossible, just not seen before.

Never heard of it. do you have a datasheet of the device?

Think you must use digitalWrite(6, HIGH); and digitalWrite(6, LOW); but the datasheet will confirm.

Thanks robtillaart, The only information that I have is the camera model (FlyCamOne HD (720p) and a response from one of their customer service reps:

über einen RC-Empfänger wird ein freier Kanal für die Kamera verwendet.

This basically translates to "use a free RC-receiver channel".

This is why I'm using the Servo.h library and it works. However, with more devices attached, the Servo.write(0) setting has some variability which changes the signal triggering the camera when it's not supposed to. I don't see this when Servo.write(180). Any other ideas? Tomorrow, I will try and use another PIN, maybe one of the analog ones. Have a great evening, Conrad :)

From - -

External shutter release In all video modes "VR", "VE", "SR", "SE", and in photo mode "PE" recording is running while pins 1 & 2 are connected and will stop when disconnected. In photo mode "PR" only one photo will be shot when pin 1 & 2 are connected. Connecting again will shoot the next photo. The shutter speed will not be changed due to longer connection!

Might help...

That's the old model... doesn't work on the new one! It would have been so much easier!

talks about a movement detector cable (Bewegungsmelder kabel) which is to be connectedto the 10pins com port.... Mail the makers?

I figured out the problem! The issue occurs when I run both SoftwareSerial and Servo together. I found this thread here:

@Ian, Anything that generates interrupts (read: Tone, Servo, MsTimer2) has the potential of interfering with the NewSoftSerial timing, and vice versa.

dated Feb. 9, 2012.

Now the question is how to make this work! Conrad :)

Unless you added it since the first sketch you posted, you aren't using Software Serial.

Hello again, I got it working... but the solution is to turn off the PIN 6 that is using the Servo library. Not the prettiest solution but it works. @dxw00d, the sketch I provided was to show that the Servo library works to trigger the camera. And it works well. As you will note from the rest of the post, I also added many other devices and that is when the problems started. I was thinking that it was maybe power drain, but I'm glad I found the post (see my last post) that explained the issue to me.

If anyone has a more eloquent solution, I would love to hear about it! Have a great weekend, Conrad :)