Wrong microcontroller found. I may have applied high voltage to A0 pin

Hi,

I am new to using Arduino, I started a week ago. Today I tried to create a device for my doorbell. I have two wires comming into my house from the doorbell, and I am assuming (maybe not the best idea) there is only a switch behind that.

I created a small circuit to test with a push button, that just counts howmany times the button was pushed.

5V ---> Push button

Push button ---> 220 ohm resistor ---> GND
Push button ---> A0

I wrote a script that counts how many time the signal on A0 is high. Serial monitor showed that this worked just fine. Then I connected my doorbell in series with with the push button. I did a reset of the Arduino board. Tested the push button 10 times, serial monitor showed 1,2,3... 10. Then I went downstairs to push the doorbell a bunch of times. Nothing showed up on the serial monitor, and suddenly the push button stopped working too!

Also, if I try to upload a script now, the IDE gives me this:

"Wrong microcontroller found. Did you select the right board from the Tools > Board menu?"
Binary sketch size: 466 bytes (of a 32,256 byte maximum)
avrdude: Expected signature for ATMEGA328P is 1E 95 0F
Double check chip, or use -F to override this check.

So my questions are:

  1. What could have gone wrong?
  2. Is there a way to fix my board?
  3. How do I prevent this in the future?

Can you set the option to show more upload information ? That option is in the settings.

If you are not sure about the voltage, use a 10k resistor to A0.

However, a doorbell is AC voltage, and the doorbell is inductive, so voltage peaks and sparks could easily occur. A 10k resistor is not enough. You can use an optocoupler, that way the Arduino board is safe and also the computer connected to the Arduino is safe.

Thanks for your reply!

I turned the output for uploading to 'verbose'. This is what it shows:

Binary sketch size: 466 bytes (of a 32,256 byte maximum)
C:\Program Files (x86)\Arduino\hardware/tools/avr/bin/avrdude -CC:\Program Files (x86)\Arduino\hardware/tools/avr/etc/avrdude.conf -v -v -v -v -patmega328p -carduino -P\.\COM3 -b115200 -D -Uflash:w:C:\Users\Jnoort\AppData\Local\Temp\build4870911207126825615.tmp\blank.cpp.hex:i

avrdude: Version 5.11, compiled on Sep 2 2011 at 19:38:36
Copyright (c) 2000-2005 Brian Dean, http://www.bdmicro.com/
Copyright (c) 2007-2009 Joerg Wunsch

System wide configuration file is "C:\Program Files (x86)\Arduino\hardware/tools/avr/etc/avrdude.conf"

Using Port : \.\COM3
Using Programmer : arduino
Overriding Baud Rate : 115200
avrdude: Send: 0 [30] [20]
avrdude: Send: 0 [30] [20]
avrdude: Send: 0 [30] [20]
avrdude: Recv: . [14]
avrdude: Recv: . [10]
AVR Part : ATMEGA328P
Chip Erase delay : 9000 us
PAGEL : PD7
BS2 : PC2
RESET disposition : dedicated
RETRY pulse : SCK
serial program mode : yes
parallel program mode : yes
Timeout : 200
StabDelay : 100
CmdexeDelay : 25
SyncLoops : 32
ByteDelay : 0
PollIndex : 3
PollValue : 0x53
Memory Detail :

Block Poll Page Polled
Memory Type Mode Delay Size Indx Paged Size Size #Pages MinW MaxW ReadBack


eeprom 65 20 4 0 no 1024 4 0 3600 3600 0xff 0xff
Block Poll Page Polled
Memory Type Mode Delay Size Indx Paged Size Size #Pages MinW MaxW ReadBack


flash 65 6 128 0 yes 32768 128 256 4500 4500 0xff 0xff
Block Poll Page Polled
Memory Type Mode Delay Size Indx Paged Size Size #Pages MinW MaxW ReadBack


lfuse 0 0 0 0 no 1 0 0 4500 4500 0x00 0x00
Block Poll Page Polled
Memory Type Mode Delay Size Indx Paged Size Size #Pages MinW MaxW ReadBack


hfuse 0 0 0 0 no 1 0 0 4500 4500 0x00 0x00
Block Poll Page Polled
Memory Type Mode Delay Size Indx Paged Size Size #Pages MinW MaxW ReadBack


efuse 0 0 0 0 no 1 0 0 4500 4500 0x00 0x00
Block Poll Page Polled
Memory Type Mode Delay Size Indx Paged Size Size #Pages MinW MaxW ReadBack


lock 0 0 0 0 no 1 0 0 4500 4500 0x00 0x00
Block Poll Page Polled
Memory Type Mode Delay Size Indx Paged Size Size #Pages MinW MaxW ReadBack


calibration 0 0 0 0 no 1 0 0 0 0 0x00 0x00
Block Poll Page Polled
Memory Type Mode Delay Size Indx Paged Size Size #Pages MinW MaxW ReadBack


signature 0 0 0 0 no 3 0 0 0 0 0x00 0x00

Programmer Type : Arduino
Description : Arduino
avrdude: Send: A [41] . [80] [20]
avrdude: Recv: . [14]
avrdude: Recv: . [03]
avrdude: Recv: . [10]
avrdude: Send: A [41] . [81] [20]
avrdude: Recv: . [14]
avrdude: Recv: . [03]
avrdude: Recv: . [10]
avrdude: Send: A [41] . [82] [20]
avrdude: Recv: . [14]
avrdude: Recv: . [03]
avrdude: Recv: . [10]
avrdude: Send: A [41] . [98] [20]
avrdude: Recv: . [14]
avrdude: Recv: . [03]
avrdude: Recv: . [10]
Hardware Version: 3
Firmware Version: 3.3
avrdude: Send: A [41] . [84] [20]
avrdude: Recv: . [14]
avrdude: Recv: . [03]
avrdude: Recv: . [10]
avrdude: Send: A [41] . [85] [20]
avrdude: Recv: . [14]
avrdude: Recv: . [03]
avrdude: Recv: . [10]
avrdude: Send: A [41] . [86] [20]
avrdude: Recv: . [14]
avrdude: Recv: . [03]
avrdude: Recv: . [10]
avrdude: Send: A [41] . [87] [20]
avrdude: Recv: . [14]
avrdude: Recv: . [03]
avrdude: Recv: . [10]
avrdude: Send: A [41] . [89] [20]
avrdude: Recv: . [14]
avrdude: Recv: . [03]
avrdude: Recv: . [10]
Vtarget : 0.3 V
Varef : 0.3 V
Oscillator : 28.800 kHz
SCK period : 3.3 us

avrdude: Send: A [41] . [81] [20]
avrdude: Recv: . [14]
avrdude: Recv: . [03]
avrdude: Recv: . [10]
avrdude: Send: A [41] . [82] [20]
avrdude: Recv: . [14]
avrdude: Recv: . [03]
avrdude: Recv: . [10]
avrdude: Send: B [42] . [86] . [00] . [00] . [01] . [01] . [01] . [01] . [03] . [ff] . [ff] . [ff] . [ff] . [00] . [80] . [04] . [00] . [00] . [00] . [80] . [00] [20]
avrdude: Recv: . [14]
avrdude: Recv: . [10]
avrdude: Send: E [45] . [05] . [04] . [d7] . [c2] . [00] [20]
avrdude: Recv: . [14]
avrdude: Recv: . [10]
avrdude: Send: P [50] [20]
avrdude: Recv: . [14]
avrdude: Recv: . [10]
avrdude: AVR device initialized and ready to accept instructions

Reading | avrdude: Send: u [75] [20]
avrdude: Recv: . [14] . [1e] . [15] . [0f] . [10]
################################################## | 100% 0.00s

avrdude: Device signature = 0x1e150f
avrdude: Expected signature for ATMEGA328P is 1E 95 0F
Double check chip, or use -F to override this check.
avrdude: Send: Q [51] [20]
avrdude: Recv: . [14]
avrdude: Recv: . [10]

avrdude done. Thank you.

Notice the device signature seems to be wrong...

edit, I tried to modify the avrdude.conf file. Changed "signature = 0x1e 0x95 0x0F" to "signature = 0x1e 0x15 0x0F". If I try to upload it now, another error message appears:

Problem uploading to board. See http://www.arduino.cc/en/Guide/Troubleshootin#upload for suggestions.

avrdude: stk500_paged_write(): (a) protocol error, expect=0x14, resp=0x64
avrdude: Send: V [56] @ [40] . [00] . [00] . [0c] [20]
avrdude: Recv:
avrdude: stk500_cmd(): programmer is out of sync

Peter_n:
However, a doorbell is AC voltage, and the doorbell is inductive, so voltage peaks and sparks could easily occur.

Really? I thought those wires were just connected to a switch, and nothing more than that.

The reason I am assuming this, is that the wires were going into my doorbell (the part that makes the sound), and if I connect the points where those wires go with a jumper, the doorbell rings.

Please don't change the Arduino system files. You might forget to make it original.

That signature with '15' instead of '95' is a big problem. The chip is probably blown. That it still is doing something happens a lot more. The analog section of the chip is capable to make a half-blown chip.

I don't know how you connect the doorbell and the switch. The switch is just a switch, but when the switch is connected to the doorbell and the transformer, there is about 8V AC on the switch. And small sparks might occur when the switch is released.

Peter_n:
Please don't change the Arduino system files. You might forget to make it original.

I know, but I had to try something.. I didn't forget to make a copy of the original. I figured I can always reinstall the IDE if that is necessary.

Peter_n:
That signature with '15' instead of '95' is a big problem. The chip is probably blown. That it still is doing something happens a lot more. The analog section of the chip is capable to make a half-blown chip.

Ok.. I already have a replacement chip comming my way. It's just the ATmega chip, so I can replace that, right?

Peter_n:
I don't know how you connect the doorbell and the switch. The switch is just a switch, but when the switch is connected to the doorbell and the transformer, there is about 8V AC on the switch. And small sparks might occur when the switch is released.

Just for clarification: At the time when things got ugly, the doorbell speaker (with it's own batteries etc) was not connected to anything. Only the doorbell switch at the door was connected, and I don't think any voltage comes out of that. I will test this to make sure, but I need someone to ring my doorbell while I check with a mulimeter, I guess.

Edit:

I also managed to find the commandline that is used to upload the hex file to add an -F, but it still fails:

Commandline:
"C:\Program Files (x86)\Arduino\hardware\tools\avr\bin\avrdude" "-CC:\Program Files (x86)\Arduino\hardware/tools/avr/etc/avrdude.conf" -v -v -v -v -patmega328p -carduino -P\.\COM3 -b115200 -D -Uflash:w:C:\Users\Jnoort\AppData\Local\Temp\build4870911207126825615.tmp\blank.cpp.hex:i -F
Output:
avrdude: Version 5.11, compiled on Sep 2 2011 at 19:38:36
** Copyright (c) 2000-2005 Brian Dean, http://www.bdmicro.com/**__
** Copyright (c) 2007-2009 Joerg Wunsch**
** System wide configuration file is "C:\Program Files (x86)\Arduino\hardware/tools/avr/etc/av**
rdude.conf"
** Using Port : \.\COM3**
** Using Programmer : arduino**
** Overriding Baud Rate : 115200**
avrdude: Send: 0 [30] [20]
avrdude: Send: 0 [30] [20]
avrdude: Send: 0 [30] [20]
(blah blah blah)
avrdude: Send: d [64] . [00] . [80] F [46] . [0c] . [94] 4 [34] . [00] . [0c] . [94] Q [51] . [00] .
[0c] . [94] Q [51] . [00] . [0c] . [94] Q [51] . [00] . [0c] . [94] Q [51] . [00] . [0c] . [94] Q [
51] . [00] . [0c] . [94] Q [51] . [00] . [0c] . [94] Q [51] . [00] . [0c] . [94] Q [51] . [00] . [0c
] . [94] Q [51] . [00] . [0c] . [94] Q [51] . [00] . [0c] . [94] Q [51] . [00] . [0c] . [94] Q [51]
. [00] . [0c] . [94] Q [51] . [00] . [0c] . [94] Q [51] . [00] . [0c] . [94] Q [51] . [00] . [0c] .
[94] d [64] . [00] . [0c] . [94] Q [51] . [00] . [0c] . [94] Q [51] . [00] . [0c] . [94] Q [51] . [0
0] . [0c] . [94] Q [51] . [00] . [0c] . [94] Q [51] . [00] . [0c] . [94] Q [51] . [00] . [0c] . [94]
Q [51] . [00] . [0c] . [94] Q [51] . [00] . [0c] . [94] Q [51] . [00] . [11] $ [24] . [1f] . [be] .
[cf] . [ef] . [d8] . [e0] . [de] . [bf] . [cd] . [bf] . [11] . [e0] . [a0] . [e0] . [b1] . [e0] . [
e2] . [ed] . [f1] . [e0] . [02] . [c0] [20]
avrdude: Recv:
avrdude: stk500_paged_write(): (a) protocol error, expect=0x14, resp=0x64
avrdude: Send: V [56] @ [40] . [00] . [00] . [0c] [20]
avrdude: Recv:
avrdude: stk500_cmd(): programmer is out of sync[/quote]
[__

The chip is probably broken, you have to test with a new one.

Do you have a doorbell with batteries and speaker ? Then the voltages should not be so bad after all.
In my country every house has a transformer for the doorbell.

When you used only the switch, and it was not connected to anything, the Arduino should be okay. I don't know what happened. But you have little choice but to wait for a new chip.

Mains powered doorbells have a 16VAC power transformer that can put out over 20VAC with no load. This is too much to run into an Arduino unless you use a 47k-100k resistor.
But also, doorbell circuits are not grounded, they are floating so you will get stray voltage with respect to earth ground. When you connect your (grounded) PC to the Arduino, it can damage the USB port.

I suggest using an AC opto-coupler like a H11AA1 to keep the doorbell's power system isolated from your Arduino.