I am working on my university project to develop industrial PLC on atmel atmega 328 microcontroller.
I have a 2 questions?!
1.How to measure 0 - 10 V input to analog pin as a 0 - 5 V. Half year a go I done my university engineer project "Elaboration of the Multi-functional PLC on Base of the Arduino Mega Platform". Then I used voltage divider (attached picture). But now my lecture said so I can't use this, because I can't protect microcontroller from higher input as 5 V if input is more then 10 V. I should use amplifier or what to manage max 5V output?
2.PWM output from 0 - 5V to 0 - 10V (see attachment) is not clearly straight. I should use capacitor at end?
Thanks for your help!