HSM-20G Temp & Humidity Sensor Module, without 3 volt to 5 volt logic level convertor

Hello Friends,

Can i connect the temp & humidity output of HSM-20G without using 3 to 5 volt logic level convertor like 75HC4050. Thinking to connect it to Core’s A0 and A1 pins and read the output, Is it safe?
As analog pins are not 5 volt tolerant.


You will definitely blow up the STM32 for feeding 5V to the Analog pins.

The crude method is to use a simple voltage divider but a logic level converter would be ideal :smile:


Thanks bro, will use the converter …


@bmishra4, @kennethlimcp, actually that sensor is deceiving. The datasheet indicates (at least for humidity) that the output voltage doesn’t go above 3.3v! For the temperature, it is measured as resistance so creating a voltage divider with the sensors temperature “resistor” should give you an acceptable voltage range. I found this post on an Arduino forum regarding using 3.3V instead of 5V:

There might be a solution:
change the ref voltage!
the humidity does not go over 3.3V
so ref voltage should be 3.3V (jumper from 3.3V to Ref)

Add a resistor between temp output and analog in so that the voltage does not go over 3.3 V at 80 or 100C (CAREFUL not to fry the Arduino)

this should increase the resolution
3.3V is now 1023

Humidity resolution will be almost 70% better

You may want to consider the DHT22 sensor instead. It is reliable, cheap, works at 3.3V and there are Spark libraries for it. :slight_smile:


Thanks @peekay123 for the suggestion, will go for DHT22. :smile: