ATtiny-85 Bi-Polar Tracking Programmable Reference Voltage Source
by ajoyraman in Circuits > Microcontrollers
83 Views, 2 Favorites, 0 Comments
ATtiny-85 Bi-Polar Tracking Programmable Reference Voltage Source
This is an ATtiny-85 project implementing a Programmable Bi-Polar Tracking Reference Voltage Source. The Reference Voltage range is 0 to 10V / 0 to -10V in steps of 10 mV with an accuracy better than 20mV.
A 10-Bit PWM is set up based on the method suggested by David Johnson-Davies @ technoblogy.com [link] http://www.technoblogy.com/show?1NGL
The PWM value is set by a variable incremented/decremented using a Rotary Encoder.
The 3.3V amplitude PWM from the ATtiny-85 is converted to an accurate 10.0V PWM using a novel method explained in the text.
The averaged PWM voltage is buffered/inverted to provide the tracking bi-polar reference voltage outputs.
The PWM setting is displayed on a 128 X 32 OLED display using a Bit-Bang software methodology. Based on the Library for the SSD1306 based OLED/PLED 128x64 displays @author Neven Boyanov [Link] https://gitlab.com/tinusaur/ssd1306xled/-/blob/master/ssd1306xled/font8x16.h?ref_type=heads
The Rotary Encoder increments/decrements in unit steps and steps of 50 when the integrated switch is depressed.
The project utilizes all 8-Pins of the ATtiny-85
Pin 8/4 are Vcc / Gnd
Pin PB2/PB0 are SCK/SDA for the OLED
Pin PB4/PB3 are CLK/DT for the Rotary Encoder
Pin PB5 the Reset Pin is used as an ADC for a potential divider voltage indicating the Rotary Encoder SW state.
Circuit Schematic and Prototype
The circuit uses all standard components except IC4 which is a High-Speed Dual-MOSFET Driver and SV4 connected to a G-energy B1212S-1WR3 12V to 12V 83mA 1W Dc-Dc Converter Isolated Module.
The primary supply for the unit is a 12V DC external supply of 100mA capacity. This is used along with the LM1117 regulators and Dc-Dc Converter to generate +3.3V, +10V and -12V supplies.
The ATtiny-85 generates a 3.3V, 10-Bit PWM on PB4 at ~ 10kHz which is converted using a novel method to a 10V PWM by IC4.
This PWM signal is filtered to obtain a proportional DC value which is buffered by IC3 to provide the Vout Positive signal. This voltage when inverted by IC5 provides the tracking Vout negative signal.
Pin PB3 and PB4 are connected to the Rotary Encoder. The interface card on the module has 10K pull-up resistors for the CLK and DT lines.
There is a modification to be made to the pull-up circuitry on the SW line connected to PB5/Reset Pin in order to use this with the internal ADC to check the state of the Switch.
As shown in the figure a potential divider 10K/22K is created so the the OFF/ON state voltages of ~3.26V/2.25V are read by the ADC. The program distinguishes these states and changes the Rotary Encoder increment by 1 or 50 counts.
Enclosure
The Enclosure is simple 3D-Printed 2-Piece construction. The Top and Bottom pieces have a groove into which thin 1mm plastic pieces forming the Front and back are inserted. The 1mm plastic pieces re obtained by cutting standard electrical-conduit to size.
Downloads
Software and Hex Code
The .c, .h and .hex files are attached.
The project is compiled in Atmel Studio 6.