# Storing Volumetric Flow Data as .txt

**URL:** <https://forum.xod.io/t/storing-volumetric-flow-data-as-txt/5790>\
**Category:** Hardware Interfacing Questions\
**Created:** [January 14, 2022, 3:59pm UTC](https://forum.xod.io/t/storing-volumetric-flow-data-as-txt/5790 "2022-01-14T15:59:42Z")\
**Posts on this page:** 14\
**Page:** 1

<div class="post-metadata">

**Author:** ![jjenkins](https://avatars.discourse-cdn.com/v4/letter/j/b9bd4f/32.png) [@jjenkins](https://forum.xod.io/u/jjenkins)\
**Post date:** [January 14, 2022, 3:59pm UTC](https://forum.xod.io/t/storing-volumetric-flow-data-as-txt/5790/1 "2022-01-14T15:59:42Z")

</div>

I am creating a simple program to monitor and save data into a spreadsheet. This is very much like the [Temperature Log Example — XOD](https://xod.io/docs/guide/sd-log-example/)  
But I would prefer to use the SD card as a back up, and primarily just take the data straight into to my laptop via the USB port.  
Is there a guide for this?  
I have the sd-log example running already, seems to be working fine, so I assume modifying the program to go straight into the laptop via USB would not be difficult.

UNO R3  
IFM SA6010  
Adafruit Data Logging Shield

---

<div class="post-metadata">

**Author:** ![wayland](https://yyz1.discourse-cdn.com/flex027/user_avatar/forum.xod.io/wayland/32/1590_2.png) [@wayland](https://forum.xod.io/u/wayland)\
**Post date:** [January 14, 2022, 6:37pm UTC](https://forum.xod.io/t/storing-volumetric-flow-data-as-txt/5790/2 "2022-01-14T18:37:16Z")

</div>

In addition to sending your data to sd-log, you should additionally send them to **uart/print** , e.g.:

 ![Screenshot 2022-01-14 at 18.29.12](https://canada1.discourse-cdn.com/flex027/uploads/xod/original/2X/c/cd59b32ff1a27c9a87fc2b9dfb025a9fe7e720d9.png)

You can then run a tool such as [putty](https://www.chiark.greenend.org.uk/~sgtatham/putty/latest.html) on your laptop to receive and log the serial data.

Here’s a guide lo logging serial data using putty:

> **[Logging incoming serial data using PuTTY](https://www.eye4software.com/hydromagic/documentation/articles-and-howtos/serial-port-logging/)**
>
> Log serial port data using the freeware tool PuTTYUse PuTTY to debug devices using serial ports like GNSS receivers, dredging equipment and NMEA0183 devices.

---

<div class="post-metadata">

**Author:** ![wayland](https://yyz1.discourse-cdn.com/flex027/user_avatar/forum.xod.io/wayland/32/1590_2.png) [@wayland](https://forum.xod.io/u/wayland)\
**Post date:** [January 14, 2022, 6:46pm UTC](https://forum.xod.io/t/storing-volumetric-flow-data-as-txt/5790/3 "2022-01-14T18:46:15Z")

</div>

Alternatively, you could use **console-log** and run your patch in the debugger, e.g.

 ![Screenshot 2022-01-14 at 18.45.41](https://canada1.discourse-cdn.com/flex027/uploads/xod/original/2X/d/ddb7bcd9ae4e13f2aacc4d855b6692023d0f1e2c.png)

---

<div class="post-metadata">

**Author:** ![jjenkins](https://avatars.discourse-cdn.com/v4/letter/j/b9bd4f/32.png) [@jjenkins](https://forum.xod.io/u/jjenkins)\
**Post date:** [January 14, 2022, 8:03pm UTC](https://forum.xod.io/t/storing-volumetric-flow-data-as-txt/5790/4 "2022-01-14T20:03:15Z")

</div>

Wonderful!  
I will begin learning about this now.  
Thanks,

---

<div class="post-metadata">

**Author:** ![jjenkins](https://avatars.discourse-cdn.com/v4/letter/j/b9bd4f/32.png) [@jjenkins](https://forum.xod.io/u/jjenkins)\
**Post date:** [January 27, 2022, 7:53pm UTC](https://forum.xod.io/t/storing-volumetric-flow-data-as-txt/5790/5 "2022-01-27T19:53:43Z")

</div>

Hello and good day to all,  
I’m afraid this project has not gotten off the ground very well.  
To start things off simply, I began with a only an ASAIR AM2302 Hygrometer. This sensor is already soldered to a small board with a resistor and a capacitor.  
I connected it to the 5v pin, Gnd, and D3. I used a multimeter to confirm the voltage is present at the sensor connections.  
In the XOD IDE; I used the dht2x-hygrometer node and 2 watch nodes. Right from the start, I got the common error, “node evaluation stopped…”, just like others have gotten, so I added a clock node and set the time interval to 5 seconds. This resulted in the same error, only with a pause at first. I am guessing this pause to be about 5 seconds.  
I read a post where the person said their sensor was faulty, so I have now tried a second one, but still I have the same result.  
Before I find a new vendor and order a third sensor, I thought I should upload these pictures and get some ideas from the forum.  
Thanks,  
 ![AM2302 hygrometer Node XOD Forum](https://canada1.discourse-cdn.com/flex027/uploads/xod/original/2X/7/78e7d75f42bcf9fc1a064d625d53e017fbb27276.jpeg)

 ![AM2302 hygrometer XOD Forum](https://canada1.discourse-cdn.com/flex027/uploads/xod/original/2X/5/5fb768c1cf35db4e56630fad88e5b765670b3cab.jpeg)

---

<div class="post-metadata">

**Author:** ![xodballxod](https://avatars.discourse-cdn.com/v4/letter/x/f475e1/32.png) [@xodballxod](https://forum.xod.io/u/xodballxod)\
**Post date:** [January 28, 2022, 4:39am UTC](https://forum.xod.io/t/storing-volumetric-flow-data-as-txt/5790/6 "2022-01-28T04:39:42Z")

</div>

1. Try using a different pin, like D8
2. Try to get this working in the Arduino IDE. Here’s the Adafruit tutorial on this device  
[Overview | DHT11, DHT22 and AM2302 Sensors | Adafruit Learning System](https://learn.adafruit.com/dht)
3. Trace the board to make sure they board was made right. Based on the spec sheet, the pins could be mislabeled. So, assume it’s labeled wrong, and wire it based on the data sheet. If you break it, then you said you have a spare, anyway.

Spec Sheet: [https://www.allelectronics.com/mas\_assets/media/allelectronics2018/spec/SEN-17.pdf](https://www.allelectronics.com/mas_assets/media/allelectronics2018/spec/SEN-17.pdf)

 ![image](https://canada1.discourse-cdn.com/flex027/uploads/xod/original/2X/d/df20b24c3458976604dc99daf76490dc49c560b3.jpeg)

The order of the pins in the datasheet look different than order of the pins on the board. So, you gotta follow the traces. Is the alone pin by NC to be GND or is it Sig as on the board label? You could go right to the sensor pins, bypass the board, and wire your own pull-up… However, the Arduino can Pull-Up by itself, so I’m surprised we need a pull-up resistor, if we do it Ardunio, instead.

here’s some links to troubleshooting forums for this device

> **[\[SOLVED\] DHT11/DHT22 - Failed to read from DHT sensor | Random Nerd Tutorials](https://randomnerdtutorials.com/solved-dht11-dht22-failed-to-read-from-dht-sensor/)**
>
> Troubleshooting guide for the most common issues and errors with DHT11, DHT22, AM2302 or AM2301 sensors, follow the next steps to make your sensor work.

> <https://arduino.stackexchange.com/questions/6543/how-to-choose-between-am230x-and-dht22-temperature-and-humidity-sensors>

> **[Arduino DHT22 (AM2302) Tutorial + Library + Wiring](https://www.electroschematics.com/arduino-dht22-am2302-tutorial-library/)**
>
> You can use the DHT22 (or AM2302) humidity/temperature sensor and the Arduino UNO board to read data and print it out to the serial monitor or to display

1. If none of those work, then consider looking into changing the timing in the C++ code of the node…

2. If you can’t get it working in XOD, but it works in Arduino, then scrutinize which library the Arduino code is using. The Arduino IDE examples all use the DHT.h library… which has been updated, apparently. However, the XOD/xod-dev/dht nodes don’t call an Arduinio Library, but instead has hardcoded the digital timing functionality into itself, doing all the low level stuff to talk to the board. So, again, it would point to a timing issue… Then, you’re back to changing the timing in the XOD node to better manage the DHT you have, OR, go ahead an make your own DHT library in XOD that accesses the DHT.h library from github.

Hopefully, option 1 works… which is just changing the Digital pin. One of the forums mentioned using a pin that is pulled high on bootup, which, when used throws the DHT into error.

Let us know how it goes!

~xbx~

---

<div class="post-metadata">

**Author:** ![xodballxod](https://avatars.discourse-cdn.com/v4/letter/x/f475e1/32.png) [@xodballxod](https://forum.xod.io/u/xodballxod)\
**Post date:** [January 28, 2022, 4:52am UTC](https://forum.xod.io/t/storing-volumetric-flow-data-as-txt/5790/7 "2022-01-28T04:52:38Z")

</div>

Also, deeper in the node there’s a word-to-number that appears to be deprecated. I’m not sure what effect that would have on the system.  
 ![image](https://canada1.discourse-cdn.com/flex027/uploads/xod/original/2X/f/f4de63388d26e7f6f91e2d8fdcbc0a41cfb3424c.png)

When you run the program… double click inside the node, and see which node there is giving the error. That will help isolate the issue, also.

---

<div class="post-metadata">

**Author:** ![jjenkins](https://avatars.discourse-cdn.com/v4/letter/j/b9bd4f/32.png) [@jjenkins](https://forum.xod.io/u/jjenkins)\
**Post date:** [January 28, 2022, 5:09pm UTC](https://forum.xod.io/t/storing-volumetric-flow-data-as-txt/5790/8 "2022-01-28T17:09:05Z")

</div>

I will begin working through these ideas today and report back with my findings.  
Thanks

---

<div class="post-metadata">

**Author:** ![jjenkins](https://avatars.discourse-cdn.com/v4/letter/j/b9bd4f/32.png) [@jjenkins](https://forum.xod.io/u/jjenkins)\
**Post date:** [January 31, 2022, 5:45pm UTC](https://forum.xod.io/t/storing-volumetric-flow-data-as-txt/5790/9 "2022-01-31T17:45:01Z")

</div>

Attached are some pics.  
I tried using Pin 8,

 ![Wiring Hygrometer](https://canada1.discourse-cdn.com/flex027/uploads/xod/original/2X/b/b69ed328f6b9334e4f53b0b54ef4a9e499546dce.jpeg)  
no love.  
I tried using the Arduino IDE,  
 ![Arduino IDE Sketch Hygrometer](https://canada1.discourse-cdn.com/flex027/uploads/xod/original/2X/5/5298ba6c0a0084d213350f716b21fc41d3b5ea4d.jpeg)  
no love there either.  
I traced the board and it all seems to be good, even has the capacitor included.  
 ![AM2302 DHT22 (1)](https://canada1.discourse-cdn.com/flex027/uploads/xod/original/2X/7/76302f2d5bc37e618c89f1769d7c57c5bae2aa7c.jpeg)  
 ![AM2302 DHT22 (2)](https://canada1.discourse-cdn.com/flex027/uploads/xod/original/2X/2/26044954cfc73ac75501519991158c8d091b8eb2.jpeg)

In XOD, I clicked on the node during the error, but I didn’t see any information there.  
 ![dht2x-hygrometer (1)](https://canada1.discourse-cdn.com/flex027/uploads/xod/original/2X/e/e6e7067a1b51729df7a540827395aded0ce1beeb.jpeg)

![dht2x-hygrometer read](https://canada1.discourse-cdn.com/flex027/uploads/xod/original/2X/3/39d4d261da1985060bf94713c9a040a9f6778476.jpeg)

I guess I will just grab a different sensor as the main point here was to be able to accomplish some data logging, the final project will be using an IFM SA6010 flow meter, I just wanted to use the hygrometer as a “stand-in” variable input signal.  
I will look through my bag of stuff here and find a different temporary analog sensor.

I will have to come back to the hygrometer at some point, right now I  
feel defeated by it so another round is definitely in the future.

---

<div class="post-metadata">

**Author:** ![xodballxod](https://avatars.discourse-cdn.com/v4/letter/x/f475e1/32.png) [@xodballxod](https://forum.xod.io/u/xodballxod)\
**Post date:** [February 1, 2022, 5:05am UTC](https://forum.xod.io/t/storing-volumetric-flow-data-as-txt/5790/10 "2022-02-01T05:05:31Z")

</div>

If it’s not working with the Arduino Sketch, then it’s a problem with the DHT. To me, the power wiring that is soldered looks suspect. Also, the board itself has some suspect soldering. I would test the connections with a multimeter to see if they make sense, or are shorted, for example. You could check the resistors, too, to see if they are burned out… Something is making that DHT not work. The logic of the traces look OK…  
Now, I would want to verify the Red and Black Wires are going to where they should be. You said earlier that all the voltages you measured were correct…  
Finally, the Arduino code you have doesn’t look like the Arduino code in the Tutorial. You may want to follow the Adafruit tutorial exactly to test your board in Arduino IDE… It’s not clear where your Arduino Code came from. Question: Which pin is your code using for data?

Also, are each of those solder spots on the red dev board independent? I would assume they are… but if they are actually connected across the bottom, then the way the board is mounted may short the pins on the underside.

I would check all those board connections and power. Then, follow a tutorial exactly. But, the device could just be broken. I have a DHT11, I’ll try to get it going soon, and wrap one of the github libraries, if I can.

---

<div class="post-metadata">

**Author:** ![xodballxod](https://avatars.discourse-cdn.com/v4/letter/x/f475e1/32.png) [@xodballxod](https://forum.xod.io/u/xodballxod)\
**Post date:** [February 4, 2022, 2:42am UTC](https://forum.xod.io/t/storing-volumetric-flow-data-as-txt/5790/11 "2022-02-04T02:42:30Z")

</div>

The sensor has to be broken. I used the xod-dev/dht library, 10kohm resistor between 5V and Signal on Pin 3 and got values… Though, they do look pretty noisy and it looks like only 1 degree resolution, but something was able to be printed to the watch nodes.  
 ![image](https://canada1.discourse-cdn.com/flex027/uploads/xod/original/2X/e/e5457ec42fd36084050678f699a61523ebf0ae74.png)

---

<div class="post-metadata">

**Author:** ![jjenkins](https://avatars.discourse-cdn.com/v4/letter/j/b9bd4f/32.png) [@jjenkins](https://forum.xod.io/u/jjenkins)\
**Post date:** [February 9, 2022, 6:12pm UTC](https://forum.xod.io/t/storing-volumetric-flow-data-as-txt/5790/12 "2022-02-09T18:12:50Z")

</div>

I assume the sensors were broken. I never got either of them to work.

I also believe that I have chosen poorly for my data logger, as it uses the PCF8523. This does not seem to be currently supported with XOD.

I have gotten the data logger to work in the Arduino IDE using the examples, and I have used XOD to read a DS18b20 sensor and display it on an i2c LCD. But I have not yet been able to do all three of these things at the same time.

I would much rather use only XOD. so for right now I am stuck. I think I should buy a different data logger because this might be quicker than learning how to put a node together for using the adafruit data logger with PCF8523.

I will have the next two days off work to read, learn, and decide a course of action.

Thanks to all,

---

<div class="post-metadata">

**Author:** ![xodballxod](https://avatars.discourse-cdn.com/v4/letter/x/f475e1/32.png) [@xodballxod](https://forum.xod.io/u/xodballxod)\
**Post date:** [February 10, 2022, 10:03pm UTC](https://forum.xod.io/t/storing-volumetric-flow-data-as-txt/5790/13 "2022-02-10T22:03:45Z")

</div>

PCF8523 appears to be I2C, LCD is I2C, DS18b20 is digital, and the SD-Card is SPI… So, if it’s not all working together, then it is likely you’ve got to time the two I2C devices so they are NOT “running into each other”… I put up an example of how to get multiple I2C working altogether… I hope this helps!

I feel like I had a better example posted, but here’s what I found.

> [@MCP4725 Odd Behavior - does not update with number directly](https://forum.xod.io/t/mcp4725-odd-behavior-does-not-update-with-number-directly/5393):
>
> I’m using the e/MCP4725 library, and it works fine in 2 scenarios, and doesn’t work in another (direct number wire). Basically, can work with deprecated triangle wave, but not the updated triangle wave. I couldn’t get it to update with any kind of number wired directly, even when changing the number to trigger the pulse-on-change inside the mcp4725 node. Works using the example node with the library, with the deprecated triangle-wave node, directly wired to the mcp4725 Works using updated …

I’ve got a big project I’m working on with about 5x I2C on the same wires… I put them in a loop with each “Done” pulse wired into the “Send” pulse of the next device… Works well… But, the above it’s a simpler method for fewer devices.

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex027/uploads/xod/original/1X/eb7348baa04192c2ef932d1db54d44f09f8a7888.png) [@system](https://forum.xod.io/u/system)\
**Post date:** [March 12, 2022, 10:04pm UTC](https://forum.xod.io/t/storing-volumetric-flow-data-as-txt/5790/14 "2022-03-12T22:04:10Z")

</div>

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