I have a Raspberry Pi 3 Model B. I am planning to connect an ADC (analog to digital) converter called the MCP3008.

I will follow the diagram that is shown here (scroll down past the enabling SPI step).

However, once this is done I am not sure how I would wire the ML8511 UV Sensor Breakout Board to the ADC and the rest of the breadboard.

I am a absolute beginner with wiring so I was wondering if someone could provide a diagram so I could figure out how to wire the UV sensor and the ADC sensor so I can record UV values on a Raspberry Pi.

1 Answer 1


Connecting ML8511 to ADC On the ML8511, there are 4 pins. Both EN (enable) and 3.3V (power) connect to a 3.3v voltage line (red positive rail on the breadboard). GND connects to the black (ground) rail on the breadboard. The OUT pin on the ML8511 would connect to the MCP3008 at the same point that the potentiometer does in the second example. Make sure that the chip is facing the correct direction, as in the example that you provided, the notch on the chip is facing downwards.

The chip would connect to the Pi GPIO in the way shown in the diagram.

Connector Leads To physically connect the pins, I would suggest using Male-Male Jumper leads (1st on the above link) and to connect the ML8511 use Male-Female Jumper leads (2nd on the link) and solder some header pins to the ML8511 (that way, you can attach and detach it easily) (See link at bottom of post)

You would then follow the rest of the tutorial (the one with just the potentiometer on it) to read analogue data from the ADC. The output value would be between 0 and 1, proportional to the level of UV. You may need to multiply this value by 3.3 to get the voltage from the ML8511. If you only need the data to compare the UV levels, then this will be ok, however, this voltage will need to be mapped to the true level of UV (mW/cm^2) if this is needed. If you need to know how to do this, i will edit my answer.

Link to header pins: https: //www.rapidonline.com/truconnect-ds1025-05-2-40-p8bv-40-way-double-row-pcb-header-plug-2mm-pitch-19-0077 (remove the space after the https:)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.