This project measures the ADC value and the voltage using the potentiometer on Raspberry Pi. This code also uses an email class with smtplib to send a notication via email when the voltage reading is high. This project assumes that you have already setup your Raspberry Pi and have the Freenove Starter kit directory. If you do not you will need to setup Raspberry Pi and Freenove before you start this project.
- Raspberry Pi x1
- GPIO Extension Board & Ribbon Cable x1
- Breadboard x1
- Female-to-Female Jumper Wires x11
- Rotary potentiometer x1
- ADC module x1
- ADCDevice Library
- I2C-Tools
Below is the following pinout for this project:

Note: please plug in your cables BEFORE turning on your Raspberry Pi to prevent shorting out your parts.
This is where we will install the libraries listed above.
- From the terminal, type 'sudo raspi-config'
- Choose Interface 5 > P5 I2C > Yes > Finish
- Type 'sudo reboot' in the command line
- After restarting, check to make sure the module has started by typing 'lsmod | grep 12c'
- Install 12C Tools by typing 'sudo apt-get install i2c-tools'
- Install the smbus module
- sudo apt-get install python3-smbus
- From the terminal:
- cd ~/Freenove_Kit/Libs/Python-Libs/
- tar zxvf ADCDevice-1.0.3.tar.gz
- cd ADCDevice-1.0.3
- 'sudo python2 setup.py install' OR 'sudo python3 setup.py install'
- Download voltage.py
- Open voltage.py and change the following lines to correspond with the email notication:
- line 10: enter the email that you want to send the notification from
- line 11: enter the password to the email from line 10
- line 51: enter the recipient email
- line 52(optional): you can change the email subject
- line 53(optional): you can change the contents of the email
- Run voltage.py and turn the dial on the potentiometer to change the voltage