Power Arduino and Solenoid - 1 Source

Hello,

I hope that I am posting this in the correct place.

I am working on a project that involves a radio controlled doorbell. When I press a button on the transmitter, the doorbell chimes and an LED turns on for 10 seconds before fading out.

I have some radio triggers that are used to trigger off-camera flashes from a DSLR. When a button is pressed on the transmitter, the receiver completes the circuit between the two connection wires. This part is working fine and I do not think it is relevant to my problem.

The doorbell is a solenoid-actuated mechanical doorbell. If you have not seen one before, this article explains it well: Ding Dong! - How Doorbells Work | HowStuffWorks

I am using a 5V logic level MOSFET to apply voltage to the doorbell when I want to make the sound. Applying voltage to the solenoid on the doorbell causes a piston to move up and down to make a chime.

Everything works great when I am powering the Arduino from the USB port and the solenoid with a 9V battery. The doorbell chimes when I trigger the transmitter.

However, I am experiencing some strange behavior if I power the Arduino by the same source that powers the doorbell. This is how I have wired it: Dropbox - Error - Simplify your life

I tried it first with a 9V battery. In this case, the white LED became very dim momentarily as the bell rung. Everything else worked fine. Next I tried a 12V wall wart. As before, the doorbell works when I trigger the transmitter. However, the Arduino appears to completely turn off momentarily (all of the onboard LEDs turn off) when the doorbell chimes.

I cannot tell if the Arduino is turning off when the solenoid is turned on or off. My current theory is that the collapsing magnetic field from the solenoid is producing a large voltage spike that is affecting the Arduino. This makes sense, but I haven't really been able to think of a way to protect the Arduino.

Does anyone have any thoughts or suggestions for this?

Thanks for reading!

I don't really think it is relevant, but here is the code I am using:

// Pins
const byte signal = A5; // If this goes HIGH, a signal has been received
const byte soundPin = 12; // Door bell trigger
const byte ledPin = 11; // LED trigger

// Options
const byte ring_number = 1; // Number of rings
const int ring_time = 180; // Time between the "ding" and the "dong"
const int ring_delay = 180; // If multiple rings are set, time (in milliseconds) between rings
const long indicator_time = 10000; // How long (in milliseconds) to keep on the indicator light

// Setup
unsigned long last_ring; // Stores the last time (in milliseconds) that the bell was rung
boolean indicator = false; // Records whether or not the indicator light is on

void setup() {
// Setup Pins
pinMode(signal, INPUT);
pinMode(soundPin, OUTPUT);
pinMode(ledPin, OUTPUT);
}

void loop() {
// If a signal is detected, ring the bell
if(digitalRead(signal) == HIGH) {
for(int rings = 1; rings <= ring_number; rings++) {
digitalWrite(soundPin, HIGH); // Turn on the sound
digitalWrite(ledPin, HIGH); // Turn on the LED
delay(ring_time);

digitalWrite(soundPin, LOW);
// If this is not the final ring, turn off the indicator LED
if(rings != ring_number) {
digitalWrite(ledPin, LOW);
delay(ring_delay);
}
}
last_ring = millis(); // Record the last time the bell was rung
indicator = true; // Record the fact that the LED is on
delay(150); // Prevents the bell from being rung immediately after
}
// If the indicator LED has been on for a certain amount of time, fade it out
if(indicator == true && (millis() - last_ring >= indicator_time) ) {
for(int level = 255; level >= 0; level = level - 5) {
analogWrite(ledPin, level);
delay(50);
}
indicator = false;
}
}

Can you measure the DC resistance of your doorbell solenoid? My bet is that it is about a couple of ohms. I believe what you are seeing is the voltage of your supply dropping out when you try to operate the solenoid. Doorbell solenoids are designed for ~16 VAC and have substantially more AC impedance at 50/60Hz than DC resistance. Even so, they probably draw 500 mA.

Try measuring the voltage on your supplies while operating the solenoid without any Arduino in the mix, just to see if this is the situation.

Thanks for the reply!

That is an interesting theory that makes a lot of sense to me. Most relay coils I have used have resistances above 100 ohms, so I had assumed this might be similar.

Unfortunately until I return to school at the end of this week I won't have access to a multimeter. However I will definitely do as you suggested when I get there!

Thanks again!

DWHIT:
Thanks for the reply!

That is an interesting theory that makes a lot of sense to me. Most relay coils I have used have resistances above 100 ohms, so I had assumed this might be similar.

Unfortunately until I return to school at the end of this week I won't have access to a multimeter. However I will definitely do as you suggested when I get there!

Thanks again!

Then you really need to go on-line and buy your own digital multimeter, there are many very inexpensive basic models for under $10 and nobody working with an arduino board should not own and learn to utilize their very own DMM. Don't wait, do it now it can save you much grief, money, and time in the long run.

http://www.ebay.com/itm/Digital-Multimeter-with-Big-LCD-Screen-MM2003-/140508283769?pt=LH_DefaultDomain_0&hash=item20b6f24379

Lefty

Yes you are right, I really should get one, thanks for the link!

Hi, (DISCLAIMER: Mentioning stuff from my own shop...) this is a nice meter with a large display: http://goo.gl/iplWI

I have sold hundreds of these to schools and they seem to hold up well except for an occasional probe wire that needs to be fixed.

I use one almost every day and it's within about 1% of my nice HP lab multimeter...

But there would be shipping...

SOLENOID PROBLEM: Sounds like you have both a current capability question and also likely the "inductive kick" from turning the solenoid on and off could be inducing noise into the Arduino. What voltage is applied to the solenoid? Take a look here on, http://ArduinoInfo.Info for some ideas on the interference issues:
http://arduino-info.wikispaces.com/RelayIsolation