Wireless Nodes : Battery powered intelligent subunits

Wireless Subunits are battery powered devices with unique communication addresses. They are capable of relaying sensor data, and also include various I/O capabilities.

link = I.newRadioLink(address = 0x01010A)   #This address is unique for each IoT node, and is printed on it
link.WS2812B([[0,255,255]])  #Set the colour of the onboard RGB LED to cyan
print link.I2C_scan()        #Scan the I2C bus of the IoT node, and return detected addresses
>>> [58]
link = I.newRadioLink(address = 0x01010A)   #This address is unique for each IoT node, and is printed on it
from SEEL.SENSORS import HMC5883L
mag = HMC5883L.connect(link)  # Tell the magnetometer's class to use the IoT node with address 0x01010A as the link to the magnetometer
print mag.getRaw()
>>> [0.01,126.3,24.0]  # magnetic fields along the x,y, and z axes of the sensor

The 2.4GHz transceiver, and small form factor make it an ideal replacement for interfacing various sensors to the SEELablet. Multiple subunits may be used simultaneously.

Full Feature List:

- Unique 3-byte address
- 10 bit ADC. Capture mode
- Battery Level monitoring
- Automatic detection
- 2Hz to 8MHz frequency counter. 1% accuracy
- I2C bus . Integrated with sensor communication classes
- SPI bus
- 5-bit DAC
- Up to 10 WS2812B RGB LEDs in daisy chained form

 

Graphical Interface for the wireless nodes : Automatically detects nearby nodes and their connected sensors
'''
Connect to a wireless node.

Try out its various features by calling any of the defined functions
uncomment the functions to use them

'''
import time

from SEEL import interface
I=interface.connect()
LINK = I.newRadioLink(address = 0x0c0b0a)  #Replace with the address of your node

#Fetches 16 readings from the battery level monitoring input, and 1 reading from CS3 
def read_adc():
	print (LINK.captureADC('BAT'),LINK.readADC('CS3'))

#Sets the dac to values from 0 to 3.3V
def set_dac():
	for a in range(33):
		print (a/10.,LINK.setDAC(a/10.))
		time.sleep(0.01)

#Sets the DAC, and reads the voltage on CS3. Short Dac output and CS3 on the node
def adc_dac_loopback():
	for a in range(33):
		print (a/10.,LINK.setDAC(a/10.),LINK.readADC('CS3'))

#Write to eeprom, and read it back
def eeprom_check():
	LINK.write_eeprom([6,7],[50,50])
	for a in range(300): print LINK.read_eeprom([0,1,2,4,5,6,7]) # locations 0,1,2 contain the three byte address of the node. location #5 is unwritten(255) . 6,7 will be read 50

#Display various shades on the neopixel
def LED_TEST():
	for a in range(20):
		LINK.WS2812B([[a,0,0]])  #R
		time.sleep(0.05)
	for a in range(20):
		LINK.WS2812B([[20-a,a,0]])  #G
		time.sleep(0.05)
	for a in range(20):
		LINK.WS2812B([[0,20-a,a]])  #B
		time.sleep(0.05)
	LINK.WS2812B([[10,10,10]])  #white



#######################   READ THE BATTERY PERCENTAGE  ###############################
#print (LINK.batteryLevel())

#######################      READ FROM 10 bit ADC      ###############################
#read_adc()

#######################   USE THE NODE AS A FREQUENCY COUNTER  ###############################
#I.sqr1(6000)  #Connect SQR1 to CS3 of the wireless node. Connect GND of the node to GND of the SEELablet
#print LINK.readFrequency()
#print LINK.readHighFrequency()


#######################   SET THE 5-bit DAC output  ###############################
#set_dac()


#######################   DAC to ADC(CS3) LOOP TEST  ###############################
#adc_dac_loopback()

#######################   SET VARIOUS SHADES ON THE NEOPIXEL  ###############################
#LED_TEST()

#######################   R/W 256 byte EEPROM  ###############################
#eeprom_check()

#######################   RESET THE NODE  ###############################
#LINK.reset() #reset the wireless node

#######################   USE CS1 and CS2 as digital I/O  ###############################
#Connect LEDs between the I/O pins and ground via a series resistor
#print LINK.setIO(CS2=1,CS1=0)

#######################   READ FROM A CONNECTED SPI DEVICE  ###############################
#print LINK.readSPI('CS1',[100,100,100,100])