I am beginner trying to develop two voltage sensors for attiny85 microcontroller. I have two separate voltage levels that I want to sense using the attiny. One of the voltage supply is 0V-5.5V and is fluctuating very often within that range, and I want to detect the voltage every second or so through attiny85 analogread function and record it inside a log. I want to use the VS1 sense line from the schematic and connect it directly to any analog pin of the attiny85. And the SIN is directly connected to the supply voltage. On the other supply, I have linear 0V-2.7V which is connected directly to the CVP pin. And the VS2 is connected directly to another analog pin of the attiny85.

The attiny85 is being powered by a separate 3.3V supply. And the reference voltage I want to use is 1.35V inside the software. So, 0V-1.35V inside the attiny analogread to detect this 0V-5.5V fluctuating range and 0V-2.7V linear range.

Now, the questions: 1. Is my voltage divider circuits feasible and a good approach for these two types of voltage measurements? 2. Is it possible to improve the voltage sense circuitry, to get better accurate readings? 3. What high quality good brand SMD components I could use for these voltage sense circuits and their eagle library parts suggestions?

Included inside the question

Any suggestions and tips would be highly appreciated. Thank You.

  • \$\begingroup\$ What is 'fluctuating very often'? R1 and C1 create a low pass filter of about 2Hz \$\endgroup\$
    – Swedgin
    Oct 11, 2019 at 10:50
  • \$\begingroup\$ the voltage going into SIN is fluctuating very often. I mean it can go to 5V and then suddenly drop to 2V and then within seconds can go back upto 5V again. The suddenly 0V. Hope you got the point. It is not entirely oscillating in high frequency. It is a variable unpredictable voltage supply. \$\endgroup\$
    – Farukh
    Oct 11, 2019 at 10:52
  • \$\begingroup\$ Ok, with the setup now, the voltage divider will have a slow respons. So sudden changes won't be recorded directly or eg. spikes will be missed. To have a faster respons you can decrease the capacitor value. \$\endgroup\$
    – Swedgin
    Oct 11, 2019 at 10:58
  • \$\begingroup\$ The ADC system of the Attiny85 has selectable references of 1.1V, 2.56V, and Vcc. If you use the 2.56V reference you can also add an optional capacitor filter onto the reference pin (when selected). Using the higher reference voltage will improve the circuit's noise immunity. \$\endgroup\$
    – Nedd
    Oct 11, 2019 at 10:59
  • 1
    \$\begingroup\$ According to stefan's suggestion I will change the capacitor value to 100nF @Swedgin. \$\endgroup\$
    – Farukh
    Oct 11, 2019 at 11:08

1 Answer 1

  1. Your voltage divider circuits seam OK to me. Given that there are no other requirements, this is a feasible way of measuring these voltages.
  2. Your question is too unspecific. It is always possible to improve something. It depends on what your requirements are. With the 10bit ADC of the Attiny85 you have a theoretical signal to noise ratio of 60.2dB. So this is the best you can do with this ADC converter.
  3. If you want low temperature drift and tight tolerances, you can use C0G/NP0 type SMD parts. I would use a unpolarized cermic cap with much lower capacity (100nF), e.g. this one GRM31C5C1H104JA01L. But I think that also an X7R rated (standard) SMD ceramic capacitor could be OK for your application. For resistor, you could use this one (10K, 1%, 1206 case size): CRG1206F10K. Please be aware that there are a lot of capacitors or resistors that could fit your application.
  • \$\begingroup\$ 3. Can you please guide me on the specific part numbers for the capacitor and resistors on the C0G/NP0 class. I am very beginner to SMD electronics. So, it would be really helpful to refer to part numbers directly and then implement them in eagle. 2. As I stated my requirements in the question. Just need to measure a non-linear flactuating voltage using VS1 and a linear one using VS2. And I have provided the range of voltage that is needed to be measured in both cases. \$\endgroup\$
    – Farukh
    Oct 11, 2019 at 9:03
  • \$\begingroup\$ Also, any suggestion on the type of capacitor I should use in this case? How much voltage rating, what type? tantalum, ceramic, film, electrolytic and polarized or non-polarized? \$\endgroup\$
    – Farukh
    Oct 11, 2019 at 9:05
  • \$\begingroup\$ 3. I updated the answer regarding the capacitor suggestion. \$\endgroup\$ Oct 11, 2019 at 9:14
  • \$\begingroup\$ thanks for the update. if possible please update the answer with a resistor suggestion also. And what do you think of adding a zener clamp in this circuit? \$\endgroup\$
    – Farukh
    Oct 11, 2019 at 9:18
  • \$\begingroup\$ Of course you could add a zener clamp too, if you need to protect the circuit. \$\endgroup\$ Oct 11, 2019 at 9:22

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.