tweak voltage divider for my config
[digitaldcpower] / hardware_settings.h
1 /*
2  * Hardware settings for the digital dc power supply
3  * http://www.tuxgraphics.org/electronics/
4  *
5  * In this file you can:
6  * - calibrate the ampere and voltmeter
7  * - choose your hardware type: 22V 2.5A or 30V 2.0A
8  *
9  *   The ADC has a resolution of 11 bit = values from 0-2047
10  */
11 #ifndef CAL_HW_H
12 #define CAL_HW_H
13
14
15 /* ================= uncomment this section for the model 22V 2.5A */
16
17 #define U_MAX 170
18 #define I_MAX 250
19
20 // internal adc ref voltage (should be 2.56V, can vary from uC to uC)
21 #define ADC_REF 2.56
22
23 // the divider R3/R4 [(R3+R4)/R4] (calibrate the voltmeter, lower value=higher output)
24 //#define U_DIVIDER 10.75       // 5.30
25 #define U_DIVIDER 11.50 // 5.00
26
27 // the shunt for current measurement, you can calibrate here the 
28 // amperemeter.
29 // 2*1.5Ohm 3W=0.75:
30 #define I_RESISTOR 0.79
31 // short circuit protection limit (do not change unless you know what you do):
32 // 850=2.85A= (2.85A * 1023 * 0.75 / 2.56 )
33 #define SH_CIR_PROT 850
34
35 /* ================= uncomment this section for the model 30V 2.0A */
36
37
38 //#define U_MAX 300
39 //#define I_MAX 200
40
41 // internal adc ref voltage (should be 2.56V, can vary from uC to uC)
42 //#define ADC_REF 2.56
43
44 // the divider R3/R4 [(R3+R4)/R4], you can calibrate here the voltmeter:
45 //#define U_DIVIDER 13.24
46
47 // the shunt for current measurement, you can calibrate here the 
48 // amperemeter.
49 // 2*1.5Ohm 3W=0.75:
50 //#define I_RESISTOR 0.78
51
52 // short circuit protection limit (do not change unless you know what you do):
53 // 690=2.30A= (2.30A * 1023 * 0.75 / 2.56 )
54 //#define SH_CIR_PROT 690
55
56 #endif //CAL_HW_H
57