Bluenet  5.7.0
Bluenet, firmware for nRF52 smart home devices
Loading...
Searching...
No Matches
cs_ACR01B2G.h File Reference
#include <cfg/cs_Boards.h>
#include <cfg/cs_DeviceTypes.h>
Include dependency graph for cs_ACR01B2G.h:

Go to the source code of this file.

Functions

void asACR01B2G (boards_config_t *config)
 The second type of plug that is delivered to Crownstone users. More...
 

Function Documentation

◆ asACR01B2G()

void asACR01B2G ( boards_config_t config)

The second type of plug that is delivered to Crownstone users.

Voltage measurements:

  • This plug has an offset as additional input for the ADC. It can do differential measurements.
  • The ADC is configured with a range of -1.2V to 1.2V.
  • Note, voltageRange=1200 is a bit of misnomer here, the complete range is 2x1200 mV = 2400 mV.
  • It means that a gain of 1/2 is used.
  • The voltage divider (R12/R13 also in this circuit) centers at 3.3V/2 by two identical 68k resistors.
  • The equivalent parallel resistor is 34k.
  • The opamp gain becomes 34k/10.3M = 0.00330 (or 302.94x when inverted).
  • If we divide 2.4V over 4096-1 we have 0.58608 mV per interval.
  • The voltage multiplier of 0.00058608 x 302.94 = 0.17754.
  • If the reference voltage is exactly 3.3V/2, we should have zero offset for our voltage.
  • If VDD is not exactly 3.3V, this is exactly the same for the voltage divider at the opamp as well.
  • Resistor values with accuracies of 1% are used. This can lead to a difference of 33 mV (calculation not shown).
  • This would amount to a maximum offset error of 33 / 0.58608 = 56 in ADC values.

Temperature:

  • Threshold of 0.70 corresponds to about 50°C.
  • Threshold of 0.25 corresponds to about 90°C.

TODO: Here voltageMultiplier=0.171f is used instead of 0.17754f. Check. TODO: Here voltageZero=-99 is used instead of 0. The offset should be at max 56. Check. TODO: The values used now might be empirical. Replace by theoretic values or tell why the calcluation is incorrect.