# MCP3008 for Weather Station values different Python/Node-Red

**URL:** https://discourse.nodered.org/t/mcp3008-for-weather-station-values-different-python-node-red/27660
**Category:** General
**Created:** [2 June 2020 11:56 UTC](https://discourse.nodered.org/t/mcp3008-for-weather-station-values-different-python-node-red/27660 "2020-06-02T11:56:33Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![Brew](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/brew/32/19776_2.png) [@Brew](https://discourse.nodered.org/u/Brew)
#### Post date: [2 June 2020 11:56 UTC](https://discourse.nodered.org/t/mcp3008-for-weather-station-values-different-python-node-red/27660/1 "2020-06-02T11:56:33Z")

</div>

Hi all, I'm trying to build a weather station, one of my components is a weathervane showing wind direction, I'm following the instructions here [Raspberry Pi Weather Station](https://projects.raspberrypi.org/en/projects/build-your-own-weather-station/7). The project is going well however my problem is when reading the value of the MCP3008 chip in python the values I'm getting do not match the values I'm getting when trying to read them into Node-Red.

I'm using the [node-red-node-pi-mcp3008](https://flows.nodered.org/node/node-red-node-pi-mcp3008) node to read the values.

Anyone any ideas what I'm doing wrong?

 ![values_in_python](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/6/3/631ccec86c2e1e96208531770b57eca2d11b9e0b.png)

 ![values_node-red](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/d/b/db2f086c5ad313cd43a6cfe1ca314ea87664ec0f.png)

---

<div class="post-metadata">

### Author: ![dceejay](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/dceejay/32/38_2.png) [@dceejay](https://discourse.nodered.org/u/dceejay)
#### Post date: [2 June 2020 12:19 UTC](https://discourse.nodered.org/t/mcp3008-for-weather-station-values-different-python-node-red/27660/2 "2020-06-02T12:19:50Z")

</div>

As per the readme the node produces numbers from 0 - 1023 full scale... so you may want to divide by 1024.

---

<div class="post-metadata">

### Author: ![Brew](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/brew/32/19776_2.png) [@Brew](https://discourse.nodered.org/u/Brew)
#### Post date: [2 June 2020 12:26 UTC](https://discourse.nodered.org/t/mcp3008-for-weather-station-values-different-python-node-red/27660/3 "2020-06-02T12:26:31Z")

</div>

Ah stuff, how embarrassing for me! Well spotted thank you. 😳

---

<div class="post-metadata">

### Author: ![dceejay](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/dceejay/32/38_2.png) [@dceejay](https://discourse.nodered.org/u/dceejay)
#### Post date: [2 June 2020 12:32 UTC](https://discourse.nodered.org/t/mcp3008-for-weather-station-values-different-python-node-red/27660/4 "2020-06-02T12:32:20Z")

</div>

np - I like the easy ones :-)... of course what 841 and 0.8221 etc mean depends on voltage dividers etc anyway. (so the range node may also be useful...)

---

<div class="post-metadata">

### Author: ![system](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/1X/d073cd938eafa2e558d7c2cd59003b3ef4963033.png) [@system](https://discourse.nodered.org/u/system)
#### Post date: [16 June 2020 12:32 UTC](https://discourse.nodered.org/t/mcp3008-for-weather-station-values-different-python-node-red/27660/5 "2020-06-16T12:32:21Z")

</div>

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.
