element14 Community
element14 Community
    Register Log In
  • Site
  • Search
  • Log In Register
  • Community Hub
    Community Hub
    • What's New on element14
    • Feedback and Support
    • Benefits of Membership
    • Personal Blogs
    • Members Area
    • Achievement Levels
  • Learn
    Learn
    • Ask an Expert
    • eBooks
    • element14 presents
    • Learning Center
    • Tech Spotlight
    • STEM Academy
    • Webinars, Training and Events
    • Learning Groups
  • Technologies
    Technologies
    • 3D Printing
    • FPGA
    • Industrial Automation
    • Internet of Things
    • Power & Energy
    • Sensors
    • Technology Groups
  • Challenges & Projects
    Challenges & Projects
    • Design Challenges
    • element14 presents Projects
    • Project14
    • Arduino Projects
    • Raspberry Pi Projects
    • Project Groups
  • Products
    Products
    • Arduino
    • Avnet & Tria Boards Community
    • Dev Tools
    • Manufacturers
    • Multicomp Pro
    • Product Groups
    • Raspberry Pi
    • RoadTests & Reviews
  • About Us
    About the element14 Community
  • Store
    Store
    • Visit Your Store
    • Choose another store...
      • Europe
      •  Austria (German)
      •  Belgium (Dutch, French)
      •  Bulgaria (Bulgarian)
      •  Czech Republic (Czech)
      •  Denmark (Danish)
      •  Estonia (Estonian)
      •  Finland (Finnish)
      •  France (French)
      •  Germany (German)
      •  Hungary (Hungarian)
      •  Ireland
      •  Israel
      •  Italy (Italian)
      •  Latvia (Latvian)
      •  
      •  Lithuania (Lithuanian)
      •  Netherlands (Dutch)
      •  Norway (Norwegian)
      •  Poland (Polish)
      •  Portugal (Portuguese)
      •  Romania (Romanian)
      •  Russia (Russian)
      •  Slovakia (Slovak)
      •  Slovenia (Slovenian)
      •  Spain (Spanish)
      •  Sweden (Swedish)
      •  Switzerland(German, French)
      •  Turkey (Turkish)
      •  United Kingdom
      • Asia Pacific
      •  Australia
      •  China
      •  Hong Kong
      •  India
      •  Japan
      •  Korea (Korean)
      •  Malaysia
      •  New Zealand
      •  Philippines
      •  Singapore
      •  Taiwan
      •  Thailand (Thai)
      •  Vietnam
      • Americas
      •  Brazil (Portuguese)
      •  Canada
      •  Mexico (Spanish)
      •  United States
      Can't find the country/region you're looking for? Visit our export site or find a local distributor.
  • Translate
  • Profile
  • Settings
On the Line
  • Challenges & Projects
  • Design Challenges
  • On the Line
  • More
  • Cancel
On the Line
Forum Misaz’s Forum #4: Digital measurement of Analog output
  • News
  • Projects
  • Forum
  • DC
  • Leaderboard
  • Files
  • Members
  • More
  • Cancel
  • New
Join On the Line to participate - click to join for free!
Actions
  • Share
  • More
  • Cancel
Forum Thread Details
  • Replies 0 replies
  • Subscribers 36 subscribers
  • Views 41 views
  • Users 0 members are here
Related

Misaz’s Forum #4: Digital measurement of Analog output

misaz
misaz 21 days ago

Hello Element14 community.

In this forum I will show another play with Omega’s HX94C industrial humidity and temperature sensor with analog output. Today, I will convert analog current output to digital form using Arduino Uno Q.

How to do that is briefly explained in printed manual which come with sensor:

image

The missing part is “TEMP METER OR RECORDER”. Diagram highlights that it needs some resistor to measure. This is exactly what we need for converting current output to voltage measurable by ADC. Question is what value? The answer is ohm law. We need to map 20mA to 3.3V measured by Arduino UNO Q. Formula is: R = U / I. U is voltage we want to get (3.3V) at maximum current (0.020 A). 3.3 / 0.020 = 165 which means that we need about 165 ohm resistor. I do not have 165 ohm resistor, however I have lot of 330 ohm, so I will use two of them in parallel which result in exactly 165 ohm resistance. Connection is as follows:

image

In real life:

image

Now let’s write sketch. Arduino Uno Q support more or less same sketches as older Arduino Unos. Difference is only in using Monitor instead of Serial because it needs utilize interconnection between chips. You can create new app in App Lab by clicking or in terminal:

arduino-app-cli app new analog_humi_temp
cd /home/arduino/ArduinoApps/analog_humi_temp

Then you can edit sources using your favourite editor. Sketch is in sketch/sketch.ino:

vim sketch/sketch.ino

Sketch source code:

void setup() {
  Monitor.begin(9600);
}

void loop() {
  int adcTemp = analogRead(A0);
  float voltageTemp = 3.3 * adcTemp / 1024.0;
  float currentTemp = 1000 * voltageTemp / 165.0;
  float temperature = (currentTemp - 4) * 100 / 16;

  int adcHumi = analogRead(A1);
  float voltageHumi = 3.3 * adcHumi / 1024.0;
  float currentHumi = 1000 * voltageHumi / 165.0;
  float humidity = (currentHumi - 4) / 0.16;

  Monitor.print("Temperature: ");
  Monitor.print(temperature);
  Monitor.print("\tHumidity: ");
  Monitor.println(humidity);
}

And then you can run it by clicking Run in App lab, or in command line:

arduino-app-cli app start .

And logs you can observe using following command:

arduino-app-cli monitor

It should look as follows:

image

And that’s it. Outputs from industrial analog sensor are now in hands of modern fully digital Arduino Uno Q. In next part I will look to other sensor kit: Omega’s K-Type Thermocouple.

  • Sign in to reply
  • Cancel
element14 Community

element14 is the first online community specifically for engineers. Connect with your peers and get expert answers to your questions.

  • Members
  • Learn
  • Technologies
  • Challenges & Projects
  • Products
  • Store
  • About Us
  • Feedback & Support
  • FAQs
  • Terms of Use
  • Privacy Policy
  • Legal and Copyright Notices
  • Sitemap
  • Cookies

An Avnet Company © 2026 Premier Farnell Limited. All Rights Reserved.

Premier Farnell Ltd, registered in England and Wales (no 00876412), registered office: Farnell House, Forge Lane, Leeds LS12 2NE.

Follow element14

  • X
  • Facebook
  • linkedin
  • YouTube