UV sensor pull up wiring

Hello I am working on a project using a UVTron ultraviolet sensor. I have it setup so that when the sensor detects UV it lights a LED.

Bulb http://www.hamamatsu.com/jp/en/R9533.html
Driver board http://www.thoughtek.com.tw/C10807_TPT1025E02.pdf

I’m able to get a signal with an external pullup but I guess I’m confused as to how to wire it using the internal pull up. One picture shows the working circuit with external pull up resistor. The other shows what I understand is how to wire it up using internal pull up but have not been able to get it to work.

Hi stythys

What value external pullup were you using?

Have you changed your pinMode statement?

pinmode(xxx, INPUT_PULLUP);

Regards

Ray

I am using a 10k ohm resistor on my external pull up and yes I changed the code. Right now I'm just keeping it simple.

void setup() {
  pinMode(24,INPUT);
  pinMode(25,OUTPUT);
  digitalWrite(24,HIGH);
}

void loop() {
if (digitalRead(24) == HIGH){digitalWrite(25,HIGH);}
else {digitalWrite(25,LOW);}
}

This is the code I'm trying to use for the internal pullup.

The internal pullup resistors are higher value, about 40K or something. So maybe too high a value to work correctly with your sensor.

If you have a 33K or 47K resistor, try it instead of the 10K resistor and see what happens.

I just tried a 50k resistor for my external pull up circuit and it still works.

Use pinMode(24,INPUT_PULLUP); to activate the internal pullup in setup().

DrDiettrich:
Use

pinMode(24,INPUT_PULLUP);

to activate the internal pullup in setup().

I thought that

digitalWrite(24,HIGH);

was the same thing or am I wrong in this assumption?

Yes,
pinMode(24,INPUT);
digitalWrite(24,HIGH);
will turn on the internal pullup resistor.