Show Posts
Pages: [1] 2 3
1  Using Arduino / Installation & Troubleshooting / Re: Wrong microcontroller found. I may have applied high voltage to A0 pin on: September 20, 2014, 01:21:37 pm
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.

2  Using Arduino / Installation & Troubleshooting / Re: Arduino Micro - new out of box - just weird blinks and USB not detected on: September 20, 2014, 01:08:03 pm
Thanks Nick. I made some progress:

It is a bad (power only) micro-USB cable and Win7 USB driver quirky install (different from the FAQ).

(Win7 x64) Start-> Control Panel-> Hardware->Device Manager "Other Devices" - tab is not there. Used a different micro-USB cable and then the tab shows up  smiley Seconds later Windows reports the driver install failed, and Device Manager "Other Devices" tab disappears.
Disconnect/reconnect the USB cable and now Device Manager "Ports" tab shows "Arduino Micro (COM14)". hurrah.

Tried to upload an old sketch but error messages about timer2 TCNT2 register so I have more work to do. I'm used to the ATMega328, not 32U4.
3  Using Arduino / Installation & Troubleshooting / Arduino Micro - new out of box - just weird blinks and USB not detected on: September 19, 2014, 09:39:34 pm
Unboxed my new Arduino Micro (from Mouser Electronics, Made in Italy not a knockoff).

Power up and Pin13 green LED lights and pulses up and down in brightness (like PWM) every second for about 10 seconds, then the green LED blinks on/off 4 times, goes out and then blinks 4 more times, over and over again. The 4th blink is longer than the other 3, then a pause before repeating.
Also my PC does not show the USB device (Win7).

Is this an Arduino Micro (bootloader) error message, or ?
4  Using Arduino / Programming Questions / trouble assigning CONST to some values on: March 28, 2014, 05:01:22 pm
Hi, I'm having trouble assigning a constant some values, and can't make sense of it. Examples:
const int MAX_GRAPH = 0x567;  // compiles OK
const int MAX_GRAPH = 0x3233; // *error compiling
const int MAX_GRAPH = 0xFF;   // compiles OK
const int MAX_GRAPH = 0xFFF;  // *error compiling
const int MAX_GRAPH = 0xffff;   // compiles OK
const int MAX_GRAPH = INT16_MAX; // *error compiling, I thought defined here:

Arduino 1.0.5 error is:
c:/program files (x86)/arduino/hardware/tools/avr/bin/../lib/gcc/avr/4.3.2/../../../../avr/lib/avr6/crtm2560.o: In function `__vector_default': (.vectors+0x5c): relocation truncated to fit: R_AVR_13_PCREL against symbol `__vector_23' defined in .text.__vector_23 section in core.a(wiring.c.o)

I just want to set a const to maxint. How can I do this?
5  Using Arduino / Installation & Troubleshooting / Reprogram the Mega8U2 (USB-RS232) on Arduino UNO on: January 11, 2014, 06:10:09 pm
How do I reprogram the Mega8U2 (USB-RS232) on my Arduino UNO? I can't find the hex file or revision history, to see if there are updates.
6  Using Arduino / Microcontrollers / Arduino as ISP with the ATtiny85 on: March 22, 2013, 11:10:50 pm
I'm having troubles programming the ATtiny85V using the Arduino as ISP.

What happens is the (Arduino) programmer times out and I get:
avrdude: stk500_paged_write(): (a) protocol error, expect=0x14, resp=0x64
avrdude: stk500_cmd(): programmer is out of sync

The Arduino as ISP seems to work fine. I changed the line delay(40) in ArduinoISP sub heartbeat, and the heartbeat LED pulses and there's some initial data LED blinks, then things stall.  (I tried both Uno and Nano as programmers).
It's as if the ATtiny85 is not responding (I tried a few new ones). Using Arduino IDE 1.0.4, settings are tiny85 internal 8MHz, but I also tried 1MHz.

Have a 10uF cap on Arduino RESET line.

So I'm not sure what to check; usually I'm up against fusebits when this happens? To set the fusebits, I read you select a clock speed and "Burn Bootloader" (even though you can't put one in the 85). I thought "out of the box" the Attiny is running 8Mhz internal RC oscillator.

I'm using the MIT high-low tech ATtiny library and instructions
7  Using Arduino / Installation & Troubleshooting / Re: Serial Monitor - opens past the edge of my main screen and I can't see it on: March 11, 2013, 02:38:00 pm
Found the way to move the windowe back on my screen, from Microsoft's Tech forums:

"Windows 7 has a cool new feature that should help.  Click the icon in the taskbar to ensure that the program has focus. Then hold down the Windows key and press the right-arrow a few times. That should move the window across your screens and eventually bring it back onto the screen that is still active."
8  Using Arduino / Installation & Troubleshooting / Serial Monitor - opens past the edge of my main screen and I can't see it on: March 11, 2013, 02:11:05 pm
I'm having trouble when I open the Serial Monitor - it opens past the right edge of my main screen and I can't see it.
The Java icon and COM15 show up in my system tray and only a "Close Window" option is there.
I'm using Windows 7 with a dual-monitor setup. Doesn't matter if I run the IDE on the other (left) monitor.
This happened for me in 1.0.1 so I upgraded to 1.0.4 and same thing.
I ran the Java control panel utility (V6.0 Update 26), but nothing about moving things, also cleared the cache.
I assume the Arduino IDE sets the pop-up location?
9  Using Arduino / Programming Questions / a little help with pulsein on: November 20, 2012, 10:59:52 pm
Trying to measure capacitance by turning on a digital output, with R to input pin and C to gnd, and measure the time delay. Arduino Uno.
Using pulsein (see code below) I get timeouts if R=infinity (open) or if tie the input pin low, which is expected.
But if I tie the pulsein input pin to +5V, or use a RC (100k and 0.1uF) to the pulsein pin, I get timeouts, where I expect a number  smiley-confuse 'scope signals look ok to me.

If I disconnect pulsein pin and touch (giving noise) I start to get wandering readings from pulsein. Otherwise, it's always timeouts, as if pulsein gets "stuck" or needs an edge?

#include <avr/io.h>

byte SensorPin = 3;   // pin "D3", PD3
byte PulseOutPin = 2; // pin "D2", PD2
byte ledPin = 13;

#define TRUE 1;
#define FALSE 0;

void setup() {
  digitalWrite(ledPin,LOW) ; // led off
  digitalWrite(PulseOutPin, LOW); 
  pinMode(PulseOutPin, OUTPUT); 
  pinMode(SensorPin, INPUT);
void loop() {

unsigned long duration;
const unsigned long pulsein_timeout = 100000; // in usec
const unsigned long pulse_triptime = 5000; // in usec

  digitalWrite(PulseOutPin, HIGH);  //
  duration = pulseIn(SensorPin, HIGH, pulsein_timeout);
  if (duration==0) {
      Serial.println("pulse timeout");
  else {
    Serial.print("tau= "); Serial.print(duration); Serial.print(" usec");
    if (duration>=pulse_triptime) {
       digitalWrite(ledPin,HIGH) ; // led on
       Serial.print("  * trip *");
    else { 
      digitalWrite(ledPin,LOW) ; // led off
  digitalWrite(PulseOutPin, LOW);  //
10  Using Arduino / Installation & Troubleshooting / Xbee and Wireless shields: 3.3V-5V level translating problem on: September 29, 2012, 10:30:16 pm
I bought an XBee shield V03 from and ran into a shield design problem while checking it out- before installing my Xbee module smiley
It's the same circuit as

The Xbee modules are 3.3V and my Uno is 5V. For level translation there is a 10k/15k divider to lower Arduino's TX swing.
But for RX, the Xbee runs straight into the Arduino. In theory this works, but I found 5V there and traced it back to the USB transceiver, which also drives the AVR's Rx line through a 1k series resistor. So you get 5V backfeed into the Xbee's TX output pin, which I am not okay with.

I found the same design problem also exists with the newer Arduino Xbee Wireless module and Arduino Wireless Protoshield, so any 3.3V RF module will experience this I reckon.

It looks like changing to the newer Leonardo might work, as the serial port OR'ing is not done in hardware. Is this correct? Is there a 3.3V Arduino?
11  Development / Suggestions for the Arduino Project / Please add the AVcc filter on: September 23, 2012, 12:47:25 am
I never get 10-bit A/D performance with Arduino's - there's always too much noise. If I add the (Atmel datasheet) RC +AVcc filter, there is a huge improvement. Can you put these or at least provisions for these on Arduino designs? Even if there is a 0R resistor there, I can add it myself.
12  Using Arduino / General Electronics / Re: ~RECOMMEND A BUCK 12V-5V DC converter? on: September 23, 2012, 12:36:49 am
I think you get higher losses at 10A - in the switcher, wiring etc. I would series connect more LED's to up the voltage, or break them up so you can use smaller 2-3A switchers.

Doc, I tried a few of the LM2596 switchers from eBay, I was going to use one for an iPad charger. They just don't have the heatsinking or diode rating to dish out 5V@2A from 12V, so for $1.59 they let me down. They run quite hot.

DX has some "10A" ones but they are potted:

A cheap buck converter will fail and overvoltage your load, so I don't cheap out on them anymore.
13  Using Arduino / General Electronics / Re: Safe location of a AC current sensor on: February 25, 2012, 10:22:57 pm
Never forget the lead-in wires are always energized, unless you call your power company to disconnect (yank the power meter).

It's too dangerous and too much hassle to make your own current transformers. They also have to have a dielectric rating to prevent any arc- which if that happened on the lead-in, it would be a bad thing, upstream of the 100A breakers...

I would buy two split-core CT's (i.e Leviton Ctd01-k16 $39), call the power company to disconnect for install and put them on each phase coming in (black wires).
Also, CT's need a burden resistor and without them they are dangerous and can generate many kV.

Google "Sub-metering Current Transformer" to find some.

14  Using Arduino / Programming Questions / How to detect loss/presence of AC mains? on: February 25, 2012, 10:08:05 pm
I need some help to detect loss/presence of AC mains. 24VAC runs into an input pin, through 100k resistor=1/2 wave.

I thought of missing pulse detect by having a timer overflow if AC didn't appear and clear the timer. The timer starts on a rising edge. But if AC is not (initially) present, the timer never sees an edge and just sits there?

It looks like 8-bit TMR2 is available= 16.32msec overflow (16MHz clock and prescale/1024, count of 255) so it's too fast for 60Hz 1/2 wave  smiley-cry
Anyone have suggestions for an algorithm...

15  Using Arduino / General Electronics / Re: mobile power on: November 14, 2011, 05:57:22 pm
AA alkalines or NiMh rechargeables (2,000mAh) would run for around 13 hours. 5-6 cells though.

Maybe your sensor does not have to be on all the time- can you turn it on every second or two to save power?
Pages: [1] 2 3