Electrical Sensors¶
Current sensors¶
Due to high current at the battery. To make current sensors by sensor we must measure current at 0A current to 100A current. So we use shunt resistor (750 𝜇𝛺) to measure voltage drop in resistor. By voltage value can be calculated from Ohm’s law
When we get a sensor value the voltage is between 0 - 75 mV which is a very small range. If we want to input this value into the ADC of the microcontroller, we need to gain this voltage by op-amp in non-inverting amplifier mode. (gain voltage to 0- 3.3V for STM32h745 ADC)
Therefore , if we set R2 to 1 k𝛺 RF will be 43 k𝛺 . in this robot, we use variable resistor to set and calibrate resistor in this section (by selecting R2 at 1 k𝛺 and RF is variable resistor 100 k𝛺)
Although we have a digital current sensor with an ADC of microcontroller, we still need an analog sensor which is installed and displayed at the robot panel (pointer needle ammeter). It is used to view sensor value in real time and prevent errors at the microcontroller.
Voltage sensors¶
When we want to check the voltage of the battery to calculate the state of charge (remaining battery capacity). First, we have to know the present voltage of the battery. But the battery voltage is up to 29V. So we reduce the voltage to 3.3V for the ADC of the microcontroller. In this case we use a voltage divider to set voltage as we want and set current limit by the resistor that we choose.
Voltage divider : lets battery voltage between 20-30 V , lets maximum voltage of voltage divider circuit is 3.3V and lets first resistor (R1) is 10 k𝛺 .So second resistor will be calculated by.
And Vmin is calculated by :
If the battery voltage is 20-30 V. when voltage passes this circuit. It will decreased to 2.2 - 3.3V
Signal conditioning : from output voltage is 2.2 - 3.3 V it mst be change to 0 - 3.3V for best resolution of microcontroller ADC. then we need to offset voltage by 2.2, making voltage is 0 - 1.1 V then amplify to 0 - 3.3 V Lets V1 = input voltage , V2 = reference voltage (2.2 V) , Vout = output voltage
Therefore , if we set R1 to 1 k𝛺 RF will be 3 k𝛺 . in this robot, we use variable resistor to set and calibrate resistor in this section (by selecting R1,R2 at 1 k𝛺 and R3,R4 is variable resistor 10 k𝛺)