Stagnant readings from Sound and Light Sensors (Solved)



I am modifying the default file by removing the twitter api bit and putting the rest in Software/Python folder.
I have LED connected to D3 and DHT temp/humidity sensor to D2, which are working fine. The readings changes according to the room temperature as I switch on/off the A/C. However the Sound sensor connected to A0 and light sensor connected to A1 are having the constant reading. (I have tried to make noise and cover the the light sensor). It always give me the same readings.

Here is the file

import time
import grovepi
import math
# Connections
sound_sensor = 0        # port A0
light_sensor = 1        # port A1 
temperature_sensor = 2  # port D2
led = 3                 # port D3

intro_str = "DI Lab's"

grovepi.analogWrite(led,255)  #turn led to max to show readiness

while True:
    # Error handling in case of problems communicating with the GrovePi
        # Get value from temperature sensor
        [t,h] = grovepi.dht(temperature_sensor,0)

    # Get value from light sensor
    light_intensity = grovepi.analogRead(light_sensor)

    # Give PWM output to LED

    # Get sound level
    sound_level = grovepi.analogRead(sound_sensor)

    # Post a tweet
    out_str ="%s Temp: %d C, Humidity: %d, Light: %d, Sound: %d" %(intro_str,t,h,light_intensity/10,sound_level) 
    print (out_str)
except IOError:
except KeyboardInterrupt:
    print("Duplicate Tweet or Twitter Refusal")

and the log.txt file. log.txt (6.1 KB)

Could someone advise please?



Hi @luzhuomi,

Sorry for the delay, we were able to replicate your problem and we will come up with a fix for this shortly. Once its fixed we will get back to you here.

Thanks for your patience,


Thank you. Will look forward to your solution.



Hi @Shoban

May I know any update on this?



Hi @luzhuomi,

Thanks for bringing this up again, missed this on our list, we will get back to you shortly.Sorry for the wait, it will be answered soon.



Hi @Shoban,

Any update on this?



Hi @luzhuomi,

We have been trying this out and we found that the DHT sensor is blocking readings from the other sensors. So we are working on it but we are yet to diagnose the cause of the issue. We will need a little more time to sort this out, we will definitely get back on this post as soon as we fix it. Thanks a lot for your patience.



Hi @Shoban

Thanks for the update. Sure I will look forward to the fix.



Hi @luzhuomi,

Thanks for understanding.



Hello AS of todats date is there a fix for this???



@callaway8085 : can you describe the problem that you are facing. Are you trying to run the exact same program or is it something else.


@karan hello the program runs and it publishes the readings to the command line and updates every 60 seconds but the light sensor and the sound sensor show a reading of 0 also the led dont blink. It publishes to twitter also.???

closed #13

This topic was automatically closed after 24 hours. New replies are no longer allowed.