Setting up a Raspberry Pi with sound sensor


I have a Raspberry Pi, a Pi Adapter, a Helium Prototyping Module and A helium Element. I believe I have a tempature sensor that I want to attach, I have a breadboard, would prefer to not use it though. Im wondering how I can set all this up with a battery pack as well so I can change its location within a room.


I’m running this script on my PI using the atom and getting the response below

# Use it any way you want, profit or free, provided it fits in the licenses of its associated works.
# VCNL4010
# This code is designed to work with the VCNL4010_I2CS I2C Mini Module available from

import smbus
import time

# Get I2C bus
bus = smbus.SMBus(1)

# VCNL4010 address, 0x13(19)
# Select command register, 0x80(128)
#   0xFF(255) Enable ALS and proximity measurement, LP oscillator
bus.write_byte_data(0x13, 0x80, 0xFF)
# VCNL4010 address, 0x13(19)
# Select proximity rate register, 0x82(130)
#   0x00(00)  1.95 proximity measeurements/sec
bus.write_byte_data(0x13, 0x82, 0x00)
# VCNL4010 address, 0x13(19)
# Select ambient light register, 0x84(132)
#   0x9D(157) Continuos conversion mode, ALS rate 2 samples/sec
bus.write_byte_data(0x13, 0x84, 0x9D)


# VCNL4010 address, 0x13(19)
# Read data back from 0x85(133), 4 bytes
# luminance MSB, luminance LSB, Proximity MSB, Proximity LSB
data = bus.read_i2c_block_data(0x13, 0x85, 4)

# Convert the data
luminance = data[0] * 256 + data[1]
proximity = data[2] * 256 + data[3]

# Output data to screen
print "Ambient Light Luminance : %d lux" %luminance
print "Proximity of the Device : %d" %proximity

from helium_client import Helium

helium = Helium("/dev/serial0")

channel = helium.create_channel("Helium MQTT")

from helium_client import Helium

helium = Helium("/dev/serial0")

channel = helium.create_channel("AWS IoT")

```pi@raspberrypi:~/helium-client-python/examples $ sudo python
Ambient Light Luminance : 375 lux
Proximity of the Device : 2215
Traceback (most recent call last):
  File "", line 54, in <module>
    channel = helium.create_channel("AWS IoT")
  File "helium_client/_helium.pyx", line 245, in helium_client._helium.Helium.create_channel (helium_client/_helium.c:3067)
  File "helium_client/_helium.pyx", line 331, in helium_client._helium.Channel.create (helium_client/_helium.c:4457)
  File "helium_client/_helium.pyx", line 266, in helium_client._helium.Helium._channel_create (helium_client/_helium.c:3759)
  File "helium_client/_helium.pyx", line 261, in helium_client._helium.Helium._channel_response (helium_client/_helium.c:3605)
  File "helium_client/_helium.pyx", line 119, in helium_client._helium._check_result (helium_client/_helium.c:1827)
  File "helium_client/_helium.pyx", line 259, in helium_client._helium.Helium._channel_response._check_result_details (helium_client/_helium.c:3307)
helium_client._helium.ChannelError: -1```

when i run it with the Helium MQQT it works fine


Hi Josh,

ChannelError: -1 means that the Channel wasn’t created successfully. What this probably means is that what you’ve input for your AWS IoT Channel credentials in Dashboard aren’t correct. When you get a moment, delete that AWS IoT in Dashboard, double check your AWS IoT credentials (access Key ID and secret access key) and spin a new channel. Give that a shot and let us know if you get the same error.



Ok I deleted my channel, created a new one, and that seems to get the data to the Iot dashboard, but now getting an error of.

helium_client._helium.NoDataError: 1

Any ideas on this one?


NoDataError: 1 means a time out. Specifically it means that your Atom didn’t hear back from the Helium Channel in time as to whether or not the it was successfully transmitted. There are a few potential causes for this. Typically they are range related. If you have antennas, make sure they are on the dev board; and make sure they sensor is within range of the Element. Then fire it up again. If it persists, let us know and we’ll look into it. We can dig into the AWS Channel latency on our side if need be.

As an aside, we’ll be documenting these (and other) errors as part of the Python client very soon. :slight_smile: