UNO output voltage drops when circuit is connected

Hello all,

I am using an arduino UNO + LCD shield + one-wire temperature sensor for some project, and as of yesterday everything was working fine (could display the temperature and control an output for a heater).

...Until I actually connected the output to the opto-triac. Please see the attached circuit.

I am using A1 as a digital output (LCD shield uses so many pins!). The board is powered from a DC adapter.

If I open the circuit of the ouput (by removing R1), the voltage at the ouput is 5.0V. When the resistor is in place, the ouput drops to 1.8 - 2.0V. Why ? I am getting just over 1mA out of A1, could it be too much!?

If thought maybe the UNO was defective, I tried with another one : same result.

Could it be the LCD shield drawing too much current (around 150mA as far as I know) ?

Any help would be greatly appreciated.

Suggestion...

Also suggest changing R1 to 1K.

fojek:
If I open the circuit of the ouput (by removing R1), the voltage at the ouput is 5.0V. When the resistor is in place, the ouput drops to 1.8 - 2.0V. Why ? I am getting just over 1mA out of A1, could it be too much!?

Firstly check your software and make sure you are correctly setting A1 to output mode (pinMode). Then double check the value of R1 to make sure it's not something lower (like 4.7 ohms or whatever).

Thank you both for your replies.

dlloyd:
Suggestion...
Also suggest changing R1 to 1K.

dlloyd, can you explain why this would help (moving the diode over the collector)?

stuart0:
Firstly check your software and make sure you are correctly setting A1 to output mode (pinMode). Then double check the value of R1 to make sure it's not something lower (like 4.7 ohms or whatever).

Will do! But I am 97.8% sure of R1 and 100% sure of the pin being an output. (I did try pin D10 with a similar result yesterday). I will also try the same without the LCD shield.

dlloyd, can you explain why this would help (moving the diode over the collector)?

When the resistor is in place, the ouput drops to 1.8 - 2.0V. Why ?

You were using the NPN transistor as a high side switch, when it works much, much better as a low side switch. The way you had it, it would take 1.8 - 2.0V before the transistor begins to turn on. Just moving it to the low side, it will begin turning on at 0.6V.

Also suggest changing R1 to 1K.

With 4.7K, you had the gain at 47. Changing it to 10 ensures full saturation which is required for a transistor switch circuit.

fojek:
... 100% sure of the pin being an output.

Did I say 100%...? the pinMode instruction was commented out... I probably left it that way after I tested another output. :-[ Works perfectly now. Good for humility!

So being unassigned, a pin can be turned HIGH or LOW? I did measure it switching from 0 to 5.0V (without any load). How weird. Good to know, thanks for pointing that out!

dlloyd:
You were using the NPN transistor as a high side switch, when it works much, much better as a low side switch.

Thanks for the explaination!

So being unassigned, a pin can be turned HIGH or LOW?

Being unassigned,

  • using digitalWrite (pin, HIGH); turns on the internal pullup resistor (30-50K).
  • using digitalWrite (pin, LOW); turns off the internal pullup resistor (HIGH-Z).