Voltage Scaling


I want to measure the voltage of a 24v battery using a voltage divider and an analog input (MCP3008) on my Raspberry Pi.

Does Cayenne allow you to scale the voltage on the gauge to show the voltage of my battery?


Not yet. It is definitely something we need in any analog widget though.

@bestes, I would also like to see support for thermistor scaling for the Pi, either by having the option to specify a range of supported thermistors, or by entering the Alpha and Beta equation coefficients.

Could be a drop down of the type of equation, and then boxes for the coefficients. For instance, lets say we go with the Steinhart-Hart equation where the manufacturer gives us a Beta and a resistance at 25C. Let’s say we assume the full scale voltage, thermistor source voltage, and ADC resolution.

We would need a form entry for the series resistor, the resistance of the thermistor at 25C, the Beta, and the temperature units we wish to display, and viola!

For a simple voltage divider formula, we would need to know the two resistor values only, assuming again that we can derive the rest from the ADC driver.

Just a couple examples.



I agree. Scaling for ADC is something that should be added.




Moving this to Ideas / Suggestions


A voltage divider that reduces 24v (or max charged state) to 5v should allow the mcp3008 to read it as analog seeing as the tmp36 outputs an analog voltage. Since it’s set up as a temperature sensor for now adjust the voltage divider output with a pot to ground until the reading is in the 24v range.


The MCP3008, when powered by 3.3V- has a Vin limit of 3.3v MAX. Vin cannot exceed Vcc


Checked the data sheet and the mcp3008 can be powered 2.7v to 5.5v


When you use a VCC of +5 on the MCP3008,
it also increases the voltage on the I/O and SPI lines.

Since the Pi, Arduino and the ESP12 all use 3.3 on their logic lines-
let me know how using +5 with the MCP3008 works for you!


Just tried running the chip on 5vdc and it works fine but definitely won’t read past 3.3vdc


if you make Vref = 5V, it will-
BTW, check the temperature of the chip when you input +5 on the SENSE lines-
toasty, isn’t it!
also, measure the voltage on the data lines-
the data voltage = VCC

-do what you want (for your exact same reason, -voltage divider)- but I wouldn’t run the MCP3008 on 5V, -but, that’s me…
I already tried it- in January, 2016-