• HOME
  • ABOUT US
  • SERVICES
  • PRODUCTS
    • Micro:bit
    • IOController
    • LadderBOT
    • USB to Serial
    • Bluetooth Bee
  • BLOG
  • CONTACT US

Microbit

Last Updated on Wednesday, 13 September 2017 10:26

MQTT using Raspberry Pi and Amazon AWS IoT

Last Updated on Monday, 29 May 2017 17:28

MQTT(Message Queue Telemetry Transport) is a Publish/Subscribe based messaging protocol on top of the TCP/IP protocol. Amazon AWS IoT is a great platform that enables you to connect devices to AWS Services using MQTT protocol. Here, we are going to show Raspberry Pi communicating with another Raspberry Pi through Amazon AWS IoT.

We are using Amazon AWS IoT Python SDK and MQTT protocol to Publish/Subscribe event. The Publish/Subscribe messaging pattern requires a MQTT broker. The MQTT broker is responsible for distributing messages to interested clients based on the topic of a message. Here, Raspberry pi used as a MQTT Client and Amazon AWS IoT used as a MQTT Broker.

In this program, first Raspberry Pi device is Subscribing to Button Event of second Raspberry Pi device and vice versa. Raspberry pi will toggle the light when Button Event received from another Raspberry Pi. So when we press button on first device, it will send Publish request of button event. This event will be received by second device which will toggle light. We will need to generate end point on Amazon AWS IoT which will also provide us private key and certificate required for a particular device secure authentication.

IOController

Last Updated on Friday, 07 April 2017 12:25

IOController is designed to suit applications requiring Electronics Automation. IOController can be used in Machine Production Monitoring and Automation, Packaging Plant Automation, Building and Home Automation, Lighting Automation, Agriculture Automation. It has 5 active low Optoisolated Inputs, 5 active low Optoisolated Inputs, 2 Relay Outputs, 2 Open collector Outputs Multiplexed, RS485 connectivity, Buzzer, 16×2 Alphanumeric LCD Multiplexed, 8 Digital Inputs/Outputs, 4 Status Leds on Hardware.

IOController Top view
IOController Bottom view

Optoisolated Inputs can be used to connect Switches, NPN Proximity Sensors, PNP Proximity Sensors, Door Close Sensors and Water Level Sensors over long distance. Relay Outputs can be used to control high voltage AC powered devices. Open collector Outputs can be used to place Status Leds at a long distance. RS485 can be used to monitor activity from Master device and remote configuration. Buzzer can be used to indicate user. 16×2 LCD can be used to show status of process and for the local configuration of device. Digital Inputs/Outputs can be used to control Stepper Motors using external Driver.

We can develop customize software and hardware based on IOController. Contact us with your specific design requirement.

News – IOController

Last Updated on Monday, 03 April 2017 10:41

Check out our new product IOController.

IoT Using Raspberry Pi 3 and Thunderboard Sense

Last Updated on Monday, 06 March 2017 17:22

I am going to share with you something amazing using Silicon Labs Thunderboard Sense Kit, Thingspeak IoT Platform and My favorite Raspberry Pi 3.

Thunderboard Sense is tiny but Swiss Knife of Sensors. Trust me it is! It has Relative Humidity and Temperature Sensor, UV and Ambient Light Sensor, Pressure Sensor, Indoor Air Quality and Gas Sensor, 6-axis Inertial Sensor and MEMS Microphone including BLE capability.

Here I am going to show you how to get Temperature, Humidity and Battery Level data from Thunderboard Sense to Thingspeak through Raspberry Pi’s BLE and Internet connectivity. Check out this video.

Thunderboard Sense transmits all the Sensor values with its original shipped firmware. You can try to connect with it using following Thunderboard Android or iPhone App. It will shows all the Sensor values periodically.

Thingspeak is very easy to use platform. I have created my channel there with three fields. It gives you unique API key using which you can push data to cloud and on Thingspeak you can view the graph of your logged data. There is limit on it so you can push data once at every 15 seconds only.

As I want to read Battery Level, Temperature and Humidity, I have found out those three BLE characteristics first and then read it. It will read parameters at every 1 second from device and collect it and then after push to cloud at 15 second interval.

Here is the python code for Raspberry Pi 3 to connect with Thunderboard Sense Kit using BLE, Read data and push to Cloud.

from __future__ import division
import sys
from bluepy.btle import *
import struct
import thread
from time import sleep
import urllib2

PRIVATE_KEY = 'Your unique API Key Goes Here'

#Base URL of Thingspeak
baseURL = 'https://api.thingspeak.com/update?api_key='

def vReadSENSE():
	scanner = Scanner(0)
	devices = scanner.scan(3)
	for dev in devices:
		print "Device %s (%s), RSSI=%d dB" % (dev.addr, dev.addrType, dev.rssi)

		for (adtype, desc, value) in dev.getScanData():
			print "  %s = %s" % (desc, value)
	num_ble = len(devices)
	print num_ble
	if num_ble==0:
		return None
	ble_service = []
	char_sensor = 0
	non_sensor = 0
	bat_char = Characteristic
	temperature_char = Characteristic
	humidity_char = Characteristic
	count = 15
    
	for i in range(num_ble):
		try:
			devices[i].getScanData()
			ble_service.append(Peripheral())
			ble_service[char_sensor].connect(devices[i].addr,devices[i].addrType)
			char_sensor = char_sensor + 1
			print "Connected %s device with addr %s " % (char_sensor, devices[i].addr)
		except:
			non_sensor = non_sensor + 1
	try:
		for i in range(char_sensor):
			
			services = ble_service[i].getServices()
			characteristics = ble_service[i].getCharacteristics()
			for k in characteristics:
				print k
				if k.uuid=="2a19":
					print "Battery Level"
					bat_char = k
				if k.uuid == "2a6e":
					print "Temperature"
					temperature_char = k
				if k.uuid == "2a6f":
					print "Humidity"
					humidity_char = k
			
	except:
		return None
	while True:
		bat_data = bat_char.read()
		bat_data_value = ord(bat_data[0])
		
		temperature_data = temperature_char.read()
		temperature_data_value =(ord(temperature_data[1])<<8)+ord(temperature_data[0])
		float_temperature_data_value = (temperature_data_value / 100)
		
		humidity_data = humidity_char.read()
		humidity_data_value =(ord(humidity_data[1])< 14:
			f = urllib2.urlopen(baseURL + PRIVATE_KEY +"&field1=%s&field2=%s&field3=%s" % (bat_data_value, float_temperature_data_value, humidity_data_value))
			print f.read()
			f.close()
			count = 0
		count = count + 1 
		sleep(1)

while True:
	vReadSENSE()

Page 1 of 8

  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • Next
Tweets by @energycloudtech

FOLLOW US

sending...
Subscribe to our Newsletter

CONTACT US

+91 9099261260
info@energycloud.co.in
energycloud
+91 9099261260

TESTIMONIALS

"Energy Cloud Team was very patient, thorough and having good knowledge on Microcontroller being used. They were able to complete the project quickly and successfully in spite of many challenges."

-Client, USA

"It has been great working with Energy Cloud. They explains very well and work is outstanding. We would definitely like to continue working with them."

-Client, USA

"Very pleased with Team of Energy Cloud. They are excellent professionals to work with. We are certainly looking forward to work on many more projects in Electronics domain."

-Client, USA

"Excellent work done by Energy Cloud! Very communicative and willing to help. We will be back again with our new project ideas to make it reality."

-Client, Romania

"Amazing work, very professional and fantastic communication skills. Always a pleasure to work with Energy Cloud. Great experience."

-Client, USA

"Energy Cloud approached my problem in a very professional way and solved it in no time. The solution they provided is of very high quality. Very much recommendable!"

-Client, Germany

"Energy Cloud was very prompt in response, I would definitely recommend them to others looking for Electronics Solution."

-Client, USA

"Energy Cloud's work was excellent. We were very vague with the specifics of the project but they did a great job of analyzing what we did provide."

-Client, Australia

"Great Team, always available, communication is solid, committed to delivery and their technical skills on Electronics are top notch."

-Client, USA

"Energy Cloud Team was very helpful, friendly and patient. They helped us through the process of integrated circuit design creation with Cadence, explained concepts, helped us with the analyses and troubleshooting of problems with the design. We are very happy with the result."

-Client, Switzerland

"We are very happy with the results and the quality was outstanding. Energy Cloud completed work on time and on budget. Their communication skills are excellent. They took the time to fully understand my requirements. We will work again on future projects."

-Client, USA

"Great work. Energy Cloud quickly understood my request and transformed it into reality. The product they developed for me is very professional and of great quality. I am extremely happy with the outcome."

-Client, Namibia

"Energy Cloud Team is very knowledgeable in what they do and easy to work with. I highly recommend Energy Cloud. You will not go wrong!"

-Client, USA

"Great to work with Energy Cloud. They skype with us and show us real results of the working project. Moving on to another project with Energy Cloud."

-Client, USA

"We are quite happy with the support we received from Energy Cloud."

-Client, Spain

"Excellent group of people. Excellent workmanship and very good communication!!"

-Client, Canada

"Energy Clouds expertise extends across many cutting edge wireless technologies. They served us to develop our M2M Navigation device. We are happily looking forward to continuing our professional engagement into the future."

-Client, UK

"Great to work with Energy Cloud. Studious, independent, readily available and able to pickup the complex technology we are working with."

-Client, UK

"We have only good words to say about Energy Cloud. Their work responsibility and solution oriented approach makes us repeating customer for our embedded product design."

-Client, Thailand

"Energy Cloud has in-depth knowledge in embedded system. Prompt response, amazing speed and professionally managed work throughout its life cycle."

-Client, Oman

© Energy Cloud Technology