A simple Pulse-Sensing Application

How to make a pulse sensor with a phototransistor, and a bright LED.

The SEN input of the SEELablet is connected to a 12-bit voltmeter, and is also connected internally to 3.3V via a 5.1Kohm resistor. A photo-transistor connected between SEN and GND can be used to measure the amount of incident light.

In order to measure and visualize heartbeats, place a finger placed between a bright light source and the phototransistor, such that the light has to pass through the finger to get to the phototransistor. The body’s pulse causes the opacity of the finger to change momentarily, and this is reflected in the amount of light received by the sensor.

In order to record these fluctuations , open  SEELablet – > Test and Measurement – > Data Streaming  utility , and set the command to ‘get_resistance()’ . This will start plotting the resistance of the phototransistor as a function of time

Results :

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])