#avr Logs

Oct 31 2019

#avr Calendar

12:21 AM day__ is now known as day
02:36 AM polprog: rue_mohr: damn, i havent got around to doing it :(
05:11 AM cehteh_ is now known as cehteh
08:36 AM rue_bed2: --
12:21 PM polprog is now known as spookprog
12:28 PM spookprog is now known as polprog
01:29 PM unclenorton: Does anyone know a safe way to measure up to 300 volts DC with an attiny85?
01:38 PM cehteh: depends on your definition of safe :D
01:38 PM cehteh: and what range/precision
01:39 PM cehteh: do you need galvanic isolation? or 'just' minize the current, is the tiny85 touch safe encased, is it mains voltage with refers to ground or standalone?
01:43 PM cehteh: unclenorton: ^
01:44 PM unclenorton: cehteh: it is not mains voltage, the tiny85 is touch safe encased, range is 0-300v and the precision doesn't really matter but the higher it is the better
01:45 PM cehteh: so some DC voltage?
01:45 PM unclenorton: yes
01:46 PM cehteh: in the simplest case you can use a voltage divider with a 4v7 zener to have some limit
01:47 PM cehteh: might be better to do that with fairly high resistors and then opamp, depends on the noise and what you want to measure
01:47 PM unclenorton: yeah i im probably gonna use a voltage divider, i was just wondering if there is a better solution
01:47 PM unclenorton: and i don't want to use an opamp because it makes the circuit too big and complicated
01:47 PM cehteh: the tiny can do differential measurements so when you have a lower and an upper point (like 250-300V) you can use that to increase res
01:48 PM cehteh: when you want to make something really safe you can use a optocoupler
01:48 PM unclenorton: well it has a 10 bit adc so the resolution is like 0.3 volts or something i think
01:49 PM cehteh: you can/shoul oversample/lowpass anyway
01:49 PM unclenorton: yes i was going to oversample anyway
01:49 PM cehteh: i always make it to result in a 16bit value, the res wont be 16bit but better than 10 at least
01:50 PM cehteh: 64x oversampling fits in 16 bit
01:51 PM cehteh: zener diode and RC filter
01:51 PM cehteh: and use the internal 1v1 AREF (or some external one) but not VCC
01:55 PM cehteh: http://tinyurl.com/y6j5t7ul
01:56 PM unclenorton: thanks
01:57 PM unclenorton: btw, can i still use a 4.7v zener diode if the vcc on the avr is 3.7v?
01:57 PM cehteh: nah in that case smalelr of course
01:58 PM cehteh: should be well above the 1v1 aref and below the VCC
01:58 PM cehteh: analog input accepts vcc+0.5v (otherwise internal protection diodes trip)
01:59 PM cehteh: actuially any pin except reset
01:59 PM cehteh: the zener just adds some safety there
02:00 PM cehteh: the poti should be some multi turn trimmer you use once for calibration, thats easier than low tolerance resistors
02:00 PM cehteh: you may/should add some software calibration as well
02:01 PM cehteh: the RC filter part can dimensioned differntly depending on the characteristics you need
09:46 PM JanC_ is now known as JanC
11:08 PM Thrashbarg_ is now known as Thrashbarg