June Birth Magoncia

user Electronics Engineer

city Innovuze Solutions, Inc.

  • Simple ATTiny85 Based PH Meter

  • Created: Aug 04, 2016

    • view726
    • comment1
    • bookmark0
    • fork1


No description available.


The ATTiny85-20PU is an 8-bit microcontroller with an 8KB of program memory. It has six general-purpose input-output pins that can also be programmed to act as ADC pins, PWM pins, SPI port, or I2C port. The ATTiny85-20PU has 512 bytes of EEPROM that can be used to store data that are rarely changed like settings or options. It also has 512 bytes of data RAM that can be used for temporary data storage. The ATTiny85-20PU has an internal clock that can be set up to 8MHz speed. The device can operate with a voltage supply ranging from 2.7V to 5.5V.

In this reference design, the ATTiny85-20PU internal ADC is used to read the analog voltage from a pH sensor. The pH sensor circuit is made up of the BNC connector (J3), two op amps (U3 and U4), and passive components. The BNC connector J3 is where the pH sensor is inserted. The first op amp U3 amplifies the voltage from the sensor. The gain of this op amp can be varied by tweaking the trimmer R4. The pH electrode or sensor produces 414.12mV at pH value of 0.00, 0V at pH value of 7.00, and -414.12mV at pH value of 14.00. Since the ATTiny85-20PU ADC can only read positive analog voltages, the second op amp U4 converts the 414.12mv to -414.12mV output of the sensor to a 0-5V ATTiny85-20PU compatible voltage. The output of the second op amp serves as an input to the ADC pin or channel of the ATTiny85-20PU.

The fourth channel of the ATTiny85-20PU ADC, pin PB3, is used to read the analog voltage coming from the second op amp of the pH sensor circuit and display it on the OLED display. The ATTiny85-20PU communicates with the OLED display through I2C bus and protocol. The header J1 is used to program the ATTiny85-20PU through its SPI port. Upon burning the program, the shunt jumpers at header J2 must be removed to avoid errors. After the program is burned, connect the shunt jumpers again in order for the ATTiny85-20PU to communicate with the OLED display. The whole circuit can operate by powering it by a 5V power source. Since the op amps require a split supply, a charge pump switching regulator U5 is used to produce a -5V power source to power the op amps.

1 Comment


Where is source code? In the worst case though the HEX file? Shame!

Posted: Mar 09, 2018



  • No components added




Document Support:

- None