Uncategorized category

Raspberry Pi Twitter

Post Tweets With Your Raspberry Pi

Raspberry Pi is famous for its great computing strength and ability to run the Linux operating system. In today’s tutorial, you’ll learn how to make your Raspberry Pi tweet. You can add extra features to this project to post tweets autonomously if any specific event occurs. Let’s get started.

Required Parts

You’ll need following parts to make this project.

  • Raspberry Pi running Raspbian OS (Any model)
  • USB Mouse
  • USB Keyboard
  • HDMI Compatible Monitor
  • HDMI Cable
  • USB power supply for Raspberry (5V 2A)
  • Working Internet Connection

Create App In Twitter

You need to create an app in Twitter so that Raspberry Pi can use to make tweets on your behalf. Go here to make a twitter app. The Raspberry Pi will require following parameters to make tweets:

  • Consumer Key (API Key)
  • Consumer Secret (API Secret)
  • Access Token
  • Access Token Secret

You can find all these details from your app.

Creating An App In Twitter
Creating An App In Twitter

Store Keys In Raspberry Pi

In this step, you need to create a python file in your Raspberry Pi and store all the Keys and Tokens there. Create a file named keys.py in your working folder with all information in it.

consumer_key = "Place your consumer key here"
consumer_secret = "Place your consumer secret key here"
access_token = "Place the access token here"
access_token_secret = "place the access token secret here"
Get Access Keys And Access Tokens From App
Get Access Keys And Access Tokens From App

Now, save the file and go the nex step of this tutorial.

Install Twython

Well, what is Twython actually? Twython is the premier Python library providing an easy way to access the Twitter data. It’s been tested by companies, educational institutions and individuals alike. This amazing library will make our job a lot easier and the code much shorter. To install the Twython library, follow the given steps:

 sudo apt-get update sudo apt-get upgrade
 sudo apt-get install python-setuptools
 sudo easy_install pip
 sudo pip install twython
 sudo pip install requests
 sudo pip install requests-oauthlib

pip is required to install Twython, so it’s installed in 3rd step. But if you already have pip installed, just ignore that step.

Write The Python Script & Run It

Open a file in your working directory in your Raspberry Pi and rename it to twitter.py. Make sure that it is in the same directory wit previously created keys.py file. Now, copy-paste the following code using any editor or IDE:

import sys

from twython import Twython
from keys import (
 consumer_key,
 consumer_secret,
 access_token,
 access_token_secret
)
twitter = Twython(
 consumer_key,
 consumer_secret,
 access_token,
 access_token_secret
)
message = "My first tweet using Rapberry Pi! Yeh!"
twitter.update_status(status=message)
print("Raspberry Pi successfully tweeted: %s " % message)

Pretty simple, isn’t it? Actually, the Twython library performs lots of tasks behind the screen keeping the code surprisingly small.

Now, save the file and open terminal in your raspberry pi. Write the following command and hit the Enter key to run this Python script:

python twitter.py

That’s all. Now you can see that is your Raspberry Pi is tweeting successfully.

Advancing power supply solutions through the promise of GaN

by Michael Seeman and Dave Freeman from Texas Instrument:
One important innovation that promises to contribute significantly to meeting this goal is the use of gallium-nitride (GaN) in power applications. GaN is already an established semiconductor material, employed extensively in LED lighting and increasingly important in wireless applications. Now, with process advances and defect rate improvements, GaN is providing a number of advantages in electronic power supplies that convert electricity between alternating and direct current, change voltage levels and perform a number of functions to ensure the availability of reliable electric power.

Advancing power supply solutions through the promise of GaN – [Link]

ESP8266 PlaneSpotter

@ blog.squix.org has published his latest project.

After many hours of work I’m very happy to finally publish all the sources for the ESP8266 PlaneSpotter project. It is not yet really in a V1.0.0 state but I’m sure with the help of the community it will quickly get better. While this post is more a “making-of” you can find build instructions on Github: https://github.com/squix78/esp8266-plane-spotter-color

ESP8266 PlaneSpotter – [Link]

RELATED POSTS

That’s how nano solar cells work!

20160919102751_nano-solar-cell-fom
by Harry Baggen @ elektormagazine.com

Researchers from the AMOLF institute and Eindhoven University of Technology have developed a theory and an experimental method that for the first time provide a detailed description of how a nanoscale solar cell works. Previously this was difficult due to the extremely small dimensions of these solar cells. This new method brings the practical use of nanotechnology for sustainable energy supply a step closer.

That’s how nano solar cells work! – [Link]

Web-Bluetooth Devices Integration

Chrome Browser version 53 came out with a new feature: Origin Trial for Bluetooth which allows websites to use this feature and enable Web Bluetooth for all their visitors. Web Bluetooth is a new technology that connects the Web with the Internet of Things, this technology will provide a level of integration in the IoT scene that never happened before making web designers eager to get their bits out into the real world.

There is no need to install a mobile app on your smartphone to control any of your Bluetooth Low Energy (BTLE) devices anymore. Thanks to this technology, it will be easier to build one solution that will work on all platforms, including both mobile and desktop, that result to lower development costs, more open source control interfaces for various physical products, and more innovation.

To understand how that works, here’s an example of a drone controlled from a web app:

In Bluetooth Low Energy networks, devices play two roles. A device can be either a “Central” or a “Peripheral”. Bluetooth device with services that correspond to one function of the device. Each service exposes variables called characteristics that represent one parameter of the service, which can be read, written or both. Each service and characteristic is identified by a unique 16-bit or 128-bit number and they are defined by the Bluetooth SIG (Special Interest Group).

Bluetooth Low Energy: Peripherals, Services and Characteristics
Bluetooth Low Energy: Peripherals, Services and Characteristics

How to use Web Bluetooth

  • In order to use Web Bluetooth, your site must be served over a secure connection (HTTPS). A secure website is becoming a requirement for a growing number of new web APIs. One way is using GitHub hosting. The implementation of the Web Bluetooth API is partially complete and currently available on Chrome OS, Chrome for Android M, Linux, and Mac.
  • Go to chrome://flags/#enable-web-bluetooth, enable the highlighted flag, restart Chrome and you should be able to scan for and connect to nearby Bluetooth devices, read/write Bluetooth characteristics, receive GATT (Generic Attribute Profile) Notifications and know when a Bluetooth device gets disconnected.
  • Building a Web Bluetooth App

This is the process that will be common for all Web Bluetooth apps:

  1. Scan for a relevant Device
  2. Connect to it
  3. Get the Service you are interested in
  4. Get the Characteristic you are interested in
  5. Read, Write or Subscribe to the Characteristic

The code should be written in JavaScript. It has to scan for a device with an identified Service number, then ask for this service, ask for a specific characteristic number, and finally write the desired command. An example for hacking a light bulb and connecting it to the web via bluetooth is available here.

Although the browser is the most ubiquitous cross-platform operating system that the world has ever seen working on all platforms and systems, it could be a threat because of many malicious websites that mischief with your security. Sites ask the browser to show a list of nearby Bluetooth devices matching certain criteria, and the user either picks which to grant access to or cancels the dialog. Thus, users’ permission is the only responsible about their own privacy.

Two conflicting views are raising right now, one is for IoT enthusiasts and the other’s for security geeks. Essentially, this integration will push forward the development of new IoT applications. but it may risk users’ privacy. On the contrary, Developers are promising to minimize risks and are assuring that connection through this API will be secure and privacy-preserving. The Chrome team will end the trial in next January (2017), and after that, they expect to be able to stabilize the feature and move it closer to a general release.

Further details can be found at the official documentation website, the blog of one the developers, and this step-by-step tutorial. More about the security model can be reached here.

Evince raises £750,240 to develop diamond-based electronics

news-evince3

by Julien Happich @ edn.com

The company has demonstrated proof of concept devices and is currently developing prototypes of two solid-state devices based on proprietary IP that leverages diamond’s unique electronic properties.  It is now announcing £750,240 of new equity investment from business angels and other private investors.

Diamond offers the potential to yield devices that are up to 100x faster than silicon and could therefore revolutionise electronics across a broad range of industries.

Evince raises £750,240 to develop diamond-based electronics – [Link]

100Vin, 5W out regulator uses primary-side control

160919edne-linear8303

LT8303 is a monolithic flyback regulator in a TSOT-23 package that simplifies the design of isolated DC/DC converters. By sampling the isolated output voltage directly from the primary-side flyback waveform, the part requires no opto-isolator, LT1431 or third winding for regulation. by Graham Prophet @ edn-europe.com

The LT8303 operates over a 5.5V to 100V input voltage range, has a 0.45A/150V integrated DMOS power switch and delivers up to 5W, suiting it for a range of telecom, datacom, automotive, industrial, medical and military applications. The output voltage is set with one external resistor and the transformer turns ratio. Several off-the-shelf transformers are identified in the data sheet. The LT8303 operates in boundary mode, which is a variable frequency current mode control switching scheme, typically resulting in ±5% output voltage regulation over the full line, load and temperature range. Boundary mode enables the use of a smaller transformer compared to equivalent continuous conduction mode designs. The high level of integration and the use of low ripple Burst Mode operation result in a simple to use, low component count and high efficiency application solution for isolated power delivery.

100Vin, 5W out regulator uses primary-side control – [Link]

A20 Plus – WIFI/GPRS/GSM/CAMERA module

cd322635060704491

Raymond Tunning shares the information he found about the new A20 modules bought from taobao.

A20 Plus – WIFI/GPRS/GSM/CAMERA module – [Link]

ICS501 simple frequency multiplier

phICS501-simple-frequency-multiplier-600

Scott from SWHarden has published a new build:

Today I made a high frequency multiplier using a single component: the ICS501 PLL clock multiplier IC. This chip provides 2x, 5x, 8x (and more) clock multiplication using an internal phased-lock loop (PLL). At less than a dollar on eBay, $1.55 on mouser, and $0.67 on Digikey, they don’t break the bank and I’m glad I have a few in my junk box! I have a 10MHz frequency standard which I want to use to measure some 1Hz (1pps) pulses with higher precision, so my general idea is to use a frequency multiplier circuit to increase the frequency (to 80 MHz) and use this to run a counter IC to measure the number of clock pulses between the PPS pulses.

ICS501 simple frequency multiplier – [Link]

Bargraph Voltmeter 0-5V DC range – PIC16F686

BAR-GRAPH-VOLT-METER-RANGE-0-5V-DC-001

Tiny Bar-Graph displays provide a Red color bright, easy to read display of Voltage range of 0 to 5V. This Bar-Graph has 20 segments in single color and display 0 to 5V DC. The Barograph Voltage monitor is based on PIC microcontroller with 10 Bit resolution ADC. This high performance measurement provides unique capabilities and can be used in various applications. The Bar can display 0 to 5V with 20 LED with 0.25V (Approx.) resolutions. Each LED output provided with Solder- jumper for output set point can be configured for control, alarm, Relay.

Features

  • Supply 7.5 V to 18V DC (Direct 5V Input Possible)
  • Test Voltage Input 0 to 5V
  • Output Display 20 Color RED SMD LEDs
  • Compact Board with SMD Components
  • Supply input Header Connecter
  • On Board 5V Regulator
  • Resolution 0.25V Approx.
  • Onboard Trimport to Calibrate The Display Range.
  • Solder Jumper on each LED for Output Control, Alarm, and Relay
  • PCB Dimensions 75.88 X 26.69 MM

Bargraph Voltmeter 0-5V DC range – PIC16F686 – [Link]