Test a 25V voltage sensor module
This is a quick test of a 25V voltage sensor I picked up recently.
The circuit simply measures a variable voltage (manually controlled wiper on a pot) and displays the result on a 5110 LCD.
- Voltage input range : 0 - 25V DC
- Voltage detection range : 0.02445 - 25V DC
- Voltage analog resolution : 0.00489 V
Given the 25V range and taking a reading through the analog point (0-1023), then the
actual voltage will equal the
analog input / 1023 * 25.
|+||Sensor power 3.3/5V|
|VCC||Input positive DC|
Well taking a closer examination, there’s nothing much too it. As you might expect, it turns out to be nothing more than a voltage divider.
The sensor power pin is bogative - it’s not connected to anything. The module is not isolated - the input ground is common with the sensor ground.
The input voltage is applied across two resistors in series, with the sensor output tapped at the midpoint. The resistors are 0805 surface mount “precision” (4-digit code) resistors of values:
- 3002 (30kΩ)
- 7501 (7.5kΩ)
5110 LCD SPI Configuration
The u8glib takes advantage of hardware SPI, which means pin connections are dictated for at least MOSI and SCK.
Here’s the mapping from the terminology used by my particular 5110 module and pins on an Arduino Uno.
|Pin||Usage||Arduino Uno Pin|
|CE/SCE||chip enable||10 SPI SS|
|DC||address line 0||9|
|DIN||data in||11 SPI MOSI|
|CLK||clock||13 SPI SCK|
|BL||Backlight on when GND|