Raspberry PI Projects http://projects-raspberry.com World Biggest Site for Raspberry PI Projects - Tutorials - Ebooks - Project Ideas Mon, 11 Dec 2017 07:32:38 +0000 en-US hourly 1 Rail-to-rail step-down regulator sinks/sources ±5A from 0V to 14.5VOUT http://projects-raspberry.com/rail-rail-step-regulator-sinkssources-%c2%b15a-0v-14-5vout/ http://projects-raspberry.com/rail-rail-step-regulator-sinkssources-%c2%b15a-0v-14-5vout/#respond Mon, 11 Dec 2017 07:32:38 +0000 http://projects-raspberry.com/?p=10220 Features Single Resistor Programmable VOUT: 0V to VIN – 0.5V Silent Switcher® Architecture IISET Accuracy: ±1% Tight VOUT Regulation Across VOUT Range Output Current Monitor Accuracy: ±5% Programmable Wire Drop Compensation Easy to Parallel for Higher Current and Heat Spreading Input Supply Voltage Regulation Loop High Efficiency: Up to 96% Output Current: ±5A Integrated N-MOSFETs (60mΩ […]

The post Rail-to-rail step-down regulator sinks/sources ±5A from 0V to 14.5VOUT appeared first on Raspberry PI Projects.

]]>

Features

  • Single Resistor Programmable VOUT: 0V to VIN – 0.5V
  • Silent Switcher® Architecture
  • IISET Accuracy: ±1%
  • Tight VOUT Regulation Across VOUT Range
  • Output Current Monitor Accuracy: ±5%
  • Programmable Wire Drop Compensation
  • Easy to Parallel for Higher Current and Heat Spreading
  • Input Supply Voltage Regulation Loop
  • High Efficiency: Up to 96%
  • Output Current: ±5A
  • Integrated N-MOSFETs (60mΩ Top & 30mΩ Bottom)
  • Adjustable Switching Frequency: 400KHz to 4MHz
  • VIN Range: 4V to 15V
  • Current Mode Operation for Excellent Line and Load Transient Response
  • Shutdown Mode Draws Less Than 1µA Supply Current
  • Low Profile 24-Lead 3mm × 5mm QFN Package

Rail torail step down regulator sinks sources ±5A from 0V to 14.5VOUT

Description

TheLTC3623 is a high efficiency, monolithic synchronous buck regulator in which the output voltage is programmed with a single external resistor. The accurate internally generated 50µA current source on the ISET pin allows the user to program an output voltage from 0V to 0.5V below VIN. The user can also directly drive the ISET pin with an external voltage supply to program the converter’s VOUT. The VOUT voltage is fed directly back to the error amplifier to be regulated to the ISET voltage. The operating supply voltage range for the SVIN pin is from 15V down to 4V, while the PVIN pin’s voltage range is 15V down to 1.5V, making it suitable for dual Li-Ion batteries and for taking power from a 12V or 5V rail.

The operating frequency is programmable from 400KHz to 4MHz with an external RT resistor. Higher switching frequencyallowstheuseofsmallersurfacemountinductors while lower frequency allows for higher power efficiency. The unique constant-frequency/controlled on-time architecture is ideal for high step-down ratio applications that are operating at high frequency while demanding fast transient response.

Applications

  • Tracking Supply or DDR Memory Supply
  • ASIC Substrate Biasing
  • Point-of-Load (POL) Power Supply
  • Portable Instruments, Battery-Powered Equipment
  • Thermo Electric Cooler (TEC) Systems

For more details: Rail-to-rail step-down regulator sinks/sources ±5A from 0V to 14.5VOUT

The post Rail-to-rail step-down regulator sinks/sources ±5A from 0V to 14.5VOUT appeared first on Raspberry PI Projects.

]]>
http://projects-raspberry.com/rail-rail-step-regulator-sinkssources-%c2%b15a-0v-14-5vout/feed/ 0
Alexa, Who’s At The Door? http://projects-raspberry.com/alexa-whos-door/ http://projects-raspberry.com/alexa-whos-door/#respond Mon, 11 Dec 2017 07:26:46 +0000 http://projects-raspberry.com/?p=11735 Hardware components: Raspberry Pi 2 Model B × 1 Amazon Alexa Amazon Echo × 1 Raspberry Pi Camera module × 1 Software apps and online services: Amazon Alexa Alexa Skills Kit Firebase Amazon Web Services AWS Lambda STORY Note: The first part of the video is our playful take on the interaction of the application. […]

The post Alexa, Who’s At The Door? appeared first on Raspberry PI Projects.

]]>
Hardware components: R8326274 01
Raspberry Pi 2 Model B
× 1 Echo
Amazon Alexa Amazon Echo
× 1 11868 00a
Raspberry Pi Camera module
× 1 Software apps and online services: Dp image kit 02
Amazon Alexa Alexa Skills Kit
Firebase
Screen%20shot%202015 07 20%20at%206.10.26%20pm
Amazon Web Services AWS Lambda

Alexa, Whos At The Door

STORY

Note: The first part of the video is our playful take on the interaction of the application. We developed this Alexa application while being 400km away from each other with our hardware being divided amongst us hence the difference in scenery when I go to open the door. The second part of the video shows that our Alexa project actually works and there isn’t any editing tricks shown. Enjoy :).

Introduction

“Alexa, Who is at the Door?” is an Amazon Alexa skill set that utilizes Raspberry Pi and Firebase along with a facial recognition API to let you know who is knocking at your door.

After Alexa gets the approval to take a picture of the visitor’s face, it sends a command to the Raspberry Pi to take a picture of them using the camera module. The picture is then processed through a facial recognition API called “Kairos” which then determines whether or not the face is recognized, unknown, or not there at all.

After Alexa is taught a new face, the person is given a name by the user which is then saved in the database. It can be re-taught several times in each occasion that the visitor comes to your home. This way, the visitor’s face can be recognized in different conditions such as brightness, darkness, or a slight change in appearance of the individual. This also improves Alexa’s speed at which she recognizes each new friend that is added to the database.

Setup the Raspberry Pi and Camera Module

One of the key components of this project is setting up the Raspberry Pi and the camera module properly because after all, we wouldn’t be able to see who has wandered up to our door! After installing the Raspbian operating system onto your pi from RP’s website, we’re going to need to need to install the latest kernel, GPU firmware and applications for Raspberry Pi. The RaspiCam Documentation provided on RP’s website makes this super easy for us.

Plug in the RaspiCam module into the Raspberry Pi

Step 1) Execute the following commands into your Raspberry Pi terminal to get started.

sudo apt-get update
sudo apt-get upgrade

Step 2) Next, we need to enable RaspiCam camera support.

sudo raspi-config

Step 3) When the fancy GUI appears, use the arrow keys on your keyboard to move down to enable and hit the enter key to select it. After exiting raspi-config, you will be prompt to reboot your Pi. The enable option ensures that upon reboot the correct camera drivers will be running. To test that everything is working smoothly try the following command in your terminal.

raspistill –v –o test.jpg

If everything is going as planned, the Raspberry Pi display should show a 5-second preview from the camera’s perspective and you should see a little red dot appear in the top corner of the camera module. The terminal will output various informational messages as this is happening. After the picture is taken, it’ll be saved under in the file test.jpg which you can then open and view your marvellous picture!

If things aren’t working as they should be, the RaspiCam Documentation outlines a series of very descriptive troubleshooting methods that will help you get your Pi camera up and running in no time.

Setup Database and Configure Code Repository

For “Who’s at the Door?”, firebase was used as the connection between local and cloud communication. Both the lambda function and the Raspberry Pi are listening to the firebase DB (the lambda function only listens to firebase when it’s triggered by Alexa Voice Services).

Based on messaging triggers sent by both the Lambda Function and the Raspberry Pi in the flow of this Alexa Skill, specific responses can occur on the Alexa and specific actions can occur on the Raspberry Pi.

Setting up your firebase service

Step 1) Create a firebase account or login with your google account at Firebase.

Step 2) Create a new project.

Step 3) Create a firebase security profile.

A window should show up giving you some options to create your security profile. Start by first setting your service account name (1). Next name your Service account ID (2). Then check ‘Furnish a new private key’ (3) and choose JSON format (4). Click create when finished (5).

Once created, the security profile will download. Place this file in the github repository you have downloaded and re-name it something easy to remember.

Step 4) Configure your Real-Time Database. Start by clicking on ‘getting started’ in your firebase console.

Next, we have to setup the Real-Time DB. This can easily be done by importing this JSON (can be found in Github repository under db.json)

{
  "Alexa" : {
    "Read" : "",
    "Write" : ""
  }
}

Voila! The firebase is setup. Now let’s move onto setting up Alexa and our Lambda Function.

Setup Repository Code

In index.js, change the APP_ID variable to your Amazon App ID found on the Alexa section of the developer console,

var APP_ID = '<Amazon APP ID HERE>';

In firebase.js and database.js, change the firebase.initializeApp function parameters databaseURL to your firebase Real-Time database URL (found on the firebase console) and serviceAccount parameter to the saved security profile you created above (.json format).

Schematics ofAlexa Whos At The Door

firebase.initializeApp({
  databaseURL: '<firebaseURLhere>',
  serviceAccount: './<firebaseSecurityProfile>.json'
});

Create a developer account at Kairos and replace the app_id and app_keyparameters in firebase.js to the credentials on your Kairos developer account.

headers:{
  'Content-Type': 'application/json',
  'app_id': '<KairosAppID>',
  'app_key': '<KairosAppKey>'
}

Now, zip up the files to get ready to push it to lambda. Zip index.js, database.js, responses.js, <SecurityProfile>.json, node_modules, AlexaSkill.js, and package.json.

Read More: Alexa, Who’s At The Door?

The post Alexa, Who’s At The Door? appeared first on Raspberry PI Projects.

]]>
http://projects-raspberry.com/alexa-whos-door/feed/ 0
It’s the end of C as we know it! http://projects-raspberry.com/end-c-know/ http://projects-raspberry.com/end-c-know/#respond Sun, 10 Dec 2017 07:23:23 +0000 http://projects-raspberry.com/?p=10217 The C programming language has been with embedded software developers since its creation in 1972. Ever since then C has been a blazing constant, surviving even the big push in the late 90’s and early 21st century to move to C++ or other object oriented languages. Undoubtedly, C will continue to be a foundational language […]

The post It’s the end of C as we know it! appeared first on Raspberry PI Projects.

]]>
The C programming language has been with embedded software developers since its creation in 1972. Ever since then C has been a blazing constant, surviving even the big push in the late 90’s and early 21st century to move to C++ or other object oriented languages. Undoubtedly, C will continue to be a foundational language for embedded systems but over the last year, the language has begun to see a decrease in popularity.

the end of C as we know it

Don’t believe me? Take a look at the TIOBE Index image snapshot taken in early August 2016. Since November 2015, C’s popularity has been dropping like a rock, reaching an all-time low (well at least since the index started back in 2001).

Now keep in mind that the TIOBE index calculates the popularity for programming languages as a whole and not just for embedded system use. TIOBE scans the internet, search engines and websites looking for programming language search trends. It’s interesting to note that up until just recently, C has always been a constant pillar programming language. So what exactly is going on?

There are multiple changes that are currently driving change in industry. First, the big push to IoT devices and infrastructure is putting a large emphasis on programming languages for mobile devices and cloud based services. The C programming language is not well suited for these applications. C is meant for low level programming that needs to be fast and efficient. As more developers adopt web based technologies, it only makes sense that the general use for the C programming language as a whole would decrease.

The next big area to consider is the embedded space. Traditionally embedded software is mostly written in C. Microcontroller manufacturers provide example code in C, drivers, etc. Most middleware and RTOSes are written in C. Example code and open source software is written in C. C programming is engrained in the embedded space.

Using C in the embedded space is starting to change. The reduced cost and availability for 32-bit microcontrollers is beginning to cause a change in the industry. Efforts by ARM to push out mbed along with RTOSes and examples in C++ may start to change the trend to C++ rather than defaulting to C. Microcontrollers are becoming so complex that for many applications it doesn’t make sense for developers to work at the hardware level twiddling bits and bytes. Instead, using higher level languages such as Python are beginning to become more popular. The trend is not just at the application processor level either such as with Raspberry Pi’s but is even being seen with resource constrained microcontrollers that can run ports like Micro Python.

For more details: It’s the end of C as we know it!

The post It’s the end of C as we know it! appeared first on Raspberry PI Projects.

]]>
http://projects-raspberry.com/end-c-know/feed/ 0
AWShome – Home automation using RPi + Alexa + IoT http://projects-raspberry.com/awshome-home-automation-using-rpi-alexa-iot/ http://projects-raspberry.com/awshome-home-automation-using-rpi-alexa-iot/#respond Sun, 10 Dec 2017 06:55:29 +0000 http://projects-raspberry.com/?p=11729 Hardware components: Raspberry Pi 2 Model B A Raspberry Pi 3 or even a Raspberry Pi Zero will work too! × 1 433Mhz RF Transmitter and Receiver Available for as low as $1 on Amazon as well! × 1 Cheap Remote RF Outlet × 1 Jumper wires (generic) Female-Female if you want to use them […]

The post AWShome – Home automation using RPi + Alexa + IoT appeared first on Raspberry PI Projects.

]]>
Hardware components: R8326274 01
Raspberry Pi 2 Model B
A Raspberry Pi 3 or even a Raspberry Pi Zero will work too!
× 1
433Mhz RF Transmitter and Receiver
Available for as low as $1 on Amazon as well!
× 1
Cheap Remote RF Outlet
× 1 11026 02
Jumper wires (generic)
Female-Female if you want to use them without a Breadboard
× 1 12002 04
Breadboard (generic)
Optional, with Female-Female Jumpers you can wire directly to the Pi
× 1
USB Microphone
Only for Advanced Portion! Any USB or Bluetooth (with dongle) microphone works!
× 1
3.5mm Speaker
Only for Advanced Portion! Any 3.5mm or Bluetooth (with dongle) speaker works!
× 1 Omron b3f 1000 image 75px
SparkFun Pushbutton switch 12mm
Only for Advanced Portion, and optional!
× 1 09590 01
LED (generic)
Only for Advanced Portion, and optional!
× 2 08377 02 l
Resistor 330 ohm
Only for Advanced Portion, and if using LEDs
× 1 Software apps and online services: Dp image kit 02
Amazon Alexa Alexa Skills Kit
Screen%20shot%202015 07 20%20at%206.10.26%20pm
Amazon Web Services AWS Lambda
Ha 2up iot
Amazon Web Services AWS IoT
Avs med 3 22
Amazon Alexa Alexa Voice Service
Only for Advanced Portion!
Hand tools and fabrication machines: 09507 01
Soldering iron (generic)
Optional!!! Only if you want to add an Antenna to increase the range.

AWShome Home automation using RPi Alexa IoT

Introduction

Most wireless outlets like Wink and SmartThings cost around $70, and then each additional outlet can cost another $50! Older remote control outlets, like this one from Etekcity, can be as cheap as $5 an outlet!

The problem is, they don’t have all those fancy voice and Wi-Fi features the new ones do, that’s what this tutorial is going to help you solve!

We’ll be using a Raspberry Pi (any model will do, but the pins might be different!), a 433 Mhz Transmitter/Receiver to communicate with the wireless outlets, and some Female-Female Wire Jumpers. You’ll also need an AWS account to setup the Alexa, IoT and Lambda portions. Altogether it should cost about $50 for everything!

There’s no hard language dependency, all of the libraries I use are basic and written in multiple languages. I normally write everything in Javascript, but this tutorial will be Python to better match other Raspberry Pi tutorials.

All IDs in this tutorial were deleted after completion, so don’t worry about everyone being able to see my authentication secrets!

Preparing the Raspberry Pi Operating System

We start with the Raspberry Pi’s operating system. Your Pi may have come with an SD card with the operating system already good-to-go, or you might have an SD card with NOOBS. Either of those will work, but you can also follow the official tutorials to prepare your own SD card. For the next step I’ll assume you have the operating system installed and your Pi booted up.

Connecting to the Pi

You can easily get started using a Keyboard/Mouse/Monitor, but you will be able to do everything using just SSH so all you really need is an Ethernet cable. Here’s a longer tutorial on how to do things using only an Ethernet cable and Adafruit has a tool, but on my Mac it was as simple as plugging one in and starting SSH in Terminal (default password is raspberry ):

$ 
The authenticity of host 'raspberrypi (10.10.10.74)' can't be established. 
ECDSA key fingerprint is SHA256:NcxFUmKkMfan0WozFOVFli9qDmBnwP5MC1ZkrgK29pM. 
Are you sure you want to continue connecting (yes/no)? yes 
Warning: Permanently added 'raspberrypi,10.10.10.74' (ECDSA) to the list of known hosts. 
pi@raspberrypi's password: raspberry
The programs included with the Debian GNU/Linux system are free software; 
the exact distribution terms for each program are described in the 
individual files in /usr/share/doc/*/copyright. 
Debian GNU/Linux comes with ABSOLUTELY NO WARRANTY, to the extent 
permitted by applicable law. 
Last login: Fri May 27 11:50:32 2016 
pi@raspberrypi:~ $ 

Installing Dependencies

Once you’re there we can begin installing our first dependency: pi-switch-python, which in turn has its own dependencies. Their page will have the most up-to-date instructions, but the main commands are below for convenience. Note libboost can take a LONG time, mine took half an hour!

From now on I won’t include the output of the commands, just the current directory, and the commands themselves (everything after the dollar sign)

~ $ cd wiringPi 
~/wiringPi $ ./build 
~/wiringPi $ sudo apt-get update 
~/wiringPi $ sudo apt-get install python-dev libboost-python-dev python-pip  
~/wiringPi $ sudo pip install pi_switch

Installing AWShome

The final installation step is the actual AWShome library, which just needs to be cloned:

~/wiringPi $ cd ~ 
~ $ git clone https://github.com/rajington/AWShome 

Wiring up the Components

Both the schematic and the picture below use matching colors. I used a breadboard and a Pi Cobbler to make it easier to show, but they aren’t necessary if you use Female-Female jumpers.

AWShome Home automation using RPi

Finding the Remote Codes

When the Etekcity remote’s buttons are pressed, it emits a small radio signal. Once you’ve put batteries in the remote and wired up your Pi, you’re ready to discover the actual codes the remote sends so we can send them without the remote. Simply run the included codes.py helper and it will display them on the screen. For each button you plan on using, record the code, remembering that on and off have different codes and that codes will repeat the longer you hold down the button. I’ve included the 10 codes that came with my remote, but yours might be different.

~ $ cd AWShome/ 
~/AWShome $ sudo ./codes.py 
Listening for RF codes... 
Received code 283955 
Received code 283955 
Received code 283964 
Received code 283964 
Received code 284099 
Received code 284099 
Received code 284108 
Received code 284108 
Received code 284419 
Received code 284419 
Received code 284428 
Received code 284428 
Received code 285955 
Received code 285955 
Received code 285964 
Received code 292099 
Received code 292099 
Received code 292108 
Received code 292108 

Configure the AWS CLI

Once you’ve registered and can login to the AWS console, you can get the credentials to configure awscli . Below is an example:

~/AWShome $ sudo aws configure 
AWS Access Key ID [None]: AKIAIOSFODNN7EXAMPLE 
AWS Secret Access Key [None]: wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY 
Default region name [None]: us-east-1 
Default output format [None]: ENTER 

Although awscli doesn’t require sudo, our script does and it’ll be looking for credentials under the root account.

Create the Things using AWS IoT

We’re now ready to create some thing s using AWS IoT. Each thing will be a different remote outlet, and it helps to give them friendlier names than outlet-1 and outlet-2, here I create two:

~/AWShome $ sudo aws iot create-thing --thing-name floor-lamp 
~/AWShome $ sudo aws iot create-thing --thing-name table-lamp 

You can also create the things using the web interface.

Configure AWShome

The last step is to configure the awshome.py file to use the names you created above. Edit the file and add the new things at the bottom. I’ve created two additional lines for the two things I created earlier using the remote codes I found earlier:

if __name__ == "__main__": 
    iot = createIoT() 
    rf = createRF() 
 
    # Create your switches here, using the format: 
    #   OnOff(<THING NAME>, <ON CODE>, <OFF CODE>, rf, iot) 
    # 
    # The codes should be 6 digits and can be found using "codes.py". 
    # 
    # Example (from my remote): 
    #   OnOff('outlet-1', 283955, 283964, rf, iot) 
    #   OnOff('outlet-2', 284099, 284108, rf, iot) 
    #   OnOff('outlet-3', 284419, 284428, rf, iot) 
    #   OnOff('outlet-4', 285955, 285964, rf, iot) 
    #   OnOff('outlet-5', 292099, 292108, rf, iot) 
    OnOff('table-lamp', 283955, 283964, rf, iot) 
    OnOff('floor-lamp', 284099, 284108, rf, iot)
 
    print('Listening...') 
    
    while True: 
    

You must also update the endpoint with the one specific to your things, visible by selecting any thing from the IoT dashboard:

# creates thhe AWS IoT 
def createIoT(): 
   iot = AWSIoTMQTTShadowClient('AWSHome', useWebsocket=True) 
   # update this with your own endpoint from the IOT dashboard 
   iot.configureEndpoint('a1am7bjirugllj.iot.us-east-1.amazonaws.com', 443) 
   iot.configureCredentials(os.path.join(os.path.dirname(os.path.realpath(__file__)), 'VeriSign-Class 3-Public-Primary-Certification-Authority-G5.pem')) 
   iot.configureConnectDisconnectTimeout(10)  # 10 sec 
   iot.configureMQTTOperationTimeout(5)  # 5 sec 
   iot.connect() 
   return 

Testing IoT

We can now actually test to see that IoT is all working! First we download the required certificate file that AWS IoT requires.

~/AWShome $ wget https://www.symantec.com/content/en/us/enterprise/verisign/roots/VeriSign-Class%203-Public-Primary-Certification-Authority-G5.pem 

Next we run awshome.py so our things get populated with some state. If your outlets were currently on, they will initialize to off the first time you run the program.

$ sudo ./awshome.py 
Turning table-lamp OFF using code 283964 
Turning floor-lamp OFF using code 284108 
Listening... 

Read More: AWShome – Home automation using RPi + Alexa + IoT

The post AWShome – Home automation using RPi + Alexa + IoT appeared first on Raspberry PI Projects.

]]>
http://projects-raspberry.com/awshome-home-automation-using-rpi-alexa-iot/feed/ 0
Bi-Directional Voltage Level Translator http://projects-raspberry.com/bi-directional-voltage-level-translator/ http://projects-raspberry.com/bi-directional-voltage-level-translator/#respond Sat, 09 Dec 2017 07:15:35 +0000 http://projects-raspberry.com/?p=10214 While most of my microcontroller designs run on 3.3 volts there is still the ocasional 5 volt design. Or I do something with an Arduino. So the need may arise to interface between logic working at different voltage levels. There are several ways of doing this, depending on your needs. Things are relatively simple as […]

The post Bi-Directional Voltage Level Translator appeared first on Raspberry PI Projects.

]]>
While most of my microcontroller designs run on 3.3 volts there is still the ocasional 5 volt design. Or I do something with an Arduino. So the need may arise to interface between logic working at different voltage levels. There are several ways of doing this, depending on your needs. Things are relatively simple as long as you know in advance which side is transmitting and which side is receiving. It gets more difficult if the communication is bi-directional or with busses such as I2C that are bi-directional by nature. I did a search on farnell.com and identified two chips that can translate between almost any two voltage levels bi-directionally. The Texas Instruments TXB0106 works with up to 6 CMOS (i.e. actively driven high or low) signals for protocols such as SPI. The PCA9306 (also from TI) is intended for protocols such as I2C that rely on pull-up resistors and where a line must never be actively driven high.

Bi-Directional Voltage Level Translator

 

I ordered a few of these chips and laid out a simple board that contains the two chips together with the pull-up resistors and some decoupling caps. I also added two larger 10uF ceramic capacitors for a generous amount of bulk capacitance. The result is a tiny little board (45x30mm) that can universally be used to translate between almost any two logic voltages for almost any protocol.

Giving dirtypcbs.com a try

I can think of a lot of situations where it could be useful. But the main reason for this project was to gain some experience with getting a PCB professionally manufactured by a board house. For several years I have done my own designs but I always milled and drilled them myself. This had pros and cons. I never had to worry about silk screens or solder masks because my boards never had any. On the other hand I suffered from the lack of plated-through holes. Vias were always a pain in the arse because I had to manually solder in pieces of wire to connect the two sides. And it was very difficult if not impossible to put a via below a component which made the layout challenging when working with ICs with many and/or tightly spaced pins.

For more details: Bi-Directional Voltage Level Translator

The post Bi-Directional Voltage Level Translator appeared first on Raspberry PI Projects.

]]>
http://projects-raspberry.com/bi-directional-voltage-level-translator/feed/ 0
Make a Mini Weather Station With a Raspberry Pi http://projects-raspberry.com/make-mini-weather-station-raspberry-pi/ http://projects-raspberry.com/make-mini-weather-station-raspberry-pi/#respond Sat, 09 Dec 2017 06:24:31 +0000 http://projects-raspberry.com/?p=11725 Hardware components: Raspberry Pi 2 Model B × 1 Raspberry Pi Sense HAT × 1 STORY Today I’m going to show you how to make sort of a mini weather station with a Raspberry Pi. This is an ongoing project of mine that I’ve been tinkering with so I’ll share my learning with you. A […]

The post Make a Mini Weather Station With a Raspberry Pi appeared first on Raspberry PI Projects.

]]>
Hardware components: R8326274 01
Raspberry Pi 2 Model B
× 1 Front 1024x1024
Raspberry Pi Sense HAT
× 1

Make a Mini Weather Station With a Raspberry Pi

STORY

Today I’m going to show you how to make sort of a mini weather station with a Raspberry Pi. This is an ongoing project of mine that I’ve been tinkering with so I’ll share my learning with you.

A core part of the “Internet of Things” movement is the idea of devices that gather data and send it to the Internet. That data is then acted on or observed for later. It’s a simple concept and has been going on for a while but lately it’s been getting cheaper and easier to do. This project is a great example of that.

Once you complete this your Raspberry Pi will measure:

  • Temperature
  • Humidity
  • Barometric pressure

You can send your results to:

  • Google Spreadsheet on your Google Drive

What you’ll need

For this project you will need:

  • Raspberry Pi 3, 2 or Model B+, Zero
  • Sense HAT

The Sense Hat

The Sense HAT is an add-on board for Raspberry Pi, made especially for the Astro Pi mission – it’s going to the International Space Station in December 2015 – and is now available to buy…

The Sense HAT has an 8×8 RGB LED matrix, a five-button joystick and includes the following sensors:

  • Gyroscope
  • Accelerometer
  • Magnetometer
  • Temperature
  • Barometric pressure
  • Humidity

Technical Specification

  • Gyroscope – angular rate sensor: +/-245/500/2000dps
  • Accelerometer – Linear acceleration sensor: +/-2/4/8/16 g
  • Magnetometer – Magnetic Sensor: +/- 4/8/12/16 gauss
  • Barometer: 260 – 1260 hPa absolute range (accuracy depends on the temperature and pressure, +/- 0.1 hPa under normal conditions)
  • Temperature sensor (Temperature accurate to +/- 2 degC in the 0-65 degC range)
  • Relative Humidity sensor (accurate to +/- 4.5% in the 20-80%rH range, accurate to +/- 0.5 degC in 15-40 degC range)
  • 8×8 LED matrix display
  • Small 5 button joystick

Installing the software

Install the Sense HAT software by opening a Terminal window and entering the following commands (while connected to the Internet):

sudo apt-get update

sudo apt-get install sense-hat

sudo pip-3.2 install pillow

Usage

Hello world example:

from sense_hat import SenseHat

sense = SenseHat()

sense.show_message("Hello world!")

Gather data from all the sensors

Here we will gather the data from all the sensors using an application I wrote. This reader will gather all the information and display it on 8×8 RGB LED matrix, or send it out to the internet.

Google Spreadsheets

You can output data to a Google Spreadsheet using my application. You will need to setup OAuth with Google, and create a JSON file. Instructions are here:

http://gspread.readthedocs.org/en/latest/oauth2.html

You will want to store the generated JSON file in the MiniWeatherStation.pyfolder.

One thing you will need to is open up that OAuth JSON file and look for “client_email”. It should look like this:

“client_email”: “1985453359310-asdlkjried8ss98eeEic@developer.gserviceaccount.com”,

Take note of that email address value and go to your Google spreadsheet in a web browser. Using the File -> Share… menu item share the spreadsheet with read and write access to the email address found above. Make sure to share your spreadsheet or you will not be able to update it with the script!

 Sharing settings of Make a Mini Weather Station With a Raspberry Pi

Next, open up the MiniWeatherStation.py file and edit:

sudo nanoMiniWeatherStation.py

Replace the GDOCS_OOAUTH_JSON value with the name of your JSON file you downloaded. Set the GDOCS_SPREADSHEET_NAME with the name of your sheet. Save it. Type in :

sudo python MiniWeatherStation.py

If all your information is correct, it will start running and adding rows to your spreadsheet every 30 seconds:

Read More: Make a Mini Weather Station With a Raspberry Pi

 

The post Make a Mini Weather Station With a Raspberry Pi appeared first on Raspberry PI Projects.

]]>
http://projects-raspberry.com/make-mini-weather-station-raspberry-pi/feed/ 0
Cheap homemade 30 MHz – 6 GHz vector network analyzer http://projects-raspberry.com/cheap-homemade-30-mhz-6-ghz-vector-network-analyzer/ http://projects-raspberry.com/cheap-homemade-30-mhz-6-ghz-vector-network-analyzer/#respond Fri, 08 Dec 2017 07:06:17 +0000 http://projects-raspberry.com/?p=10211 Introduction Vector network analyzer (VNA) are used to measure scattering parameters of high frequency circuits. When frequency is high enough the reflections of the waves start to matter and distributed effects need to be taken into account. VNA can be used to analyze reflection and transmission coefficients of circuits at high frequencies. For example ideally […]

The post Cheap homemade 30 MHz – 6 GHz vector network analyzer appeared first on Raspberry PI Projects.

]]>
Introduction

Vector network analyzer (VNA) are used to measure scattering parameters of high frequency circuits. When frequency is high enough the reflections of the waves start to matter and distributed effects need to be taken into account. VNA can be used to analyze reflection and transmission coefficients of circuits at high frequencies.

Cheap homemade 30 MHz 6 GHz vector network analyzer

For example ideally antenna would radiate all the energy it gets, but all antennas reflect some of the energy back to the source and only radiate energy at certain frequencies. With VNA amount of energy reflected as function of frequency can be measured. Amplifiers also reflect some energy from both input and output and have some amount of gain. All of which can be measured using VNA.

Unfortunately VNAs are often very expensive and way out of my budget. Newest cutting edge VNAs with very wide frequency band can have insanely high cost. For example starting price of Anritsu’s 110 GHz VectorStart ME7838A VNA is $575,850. Even used VNAs for lower frequencies are often several thousand dollars. At ebay cheapest used 6 GHz two port VNAs seem to sell for about 2,000€, still way more than I’m willing to pay.

Since I can’t afford even a used VNA I decided to make one myself with a budget of 200€, tenth of what they cost used and about 1/100 of what they cost new. Of course it isn’t going to be as accurate as commercial VNAs, but I don’t need that high accuracy and it’s a good learning experience anyway.

So how does VNA measure reflection and transmission of signals? Operating principle is simple, but implementation is more challenging. Theoretically VNA consists of signal source that is used to excite the device under test (DUT), two directional coupler per port that measure transmitted and reflected waves and detectors at the end of the couplers that can measure both amplitude and phase of the signals.

Signal source generates a test signal which is routed to one of the ports. Part of the signal is coupled by the receiver directional coupler and its phase and amplitude are measured. Rest of the signal goes out of the VNA port and into the device under test. Some of the signal is reflected back to the source port and it is measured by another directional coupler. Ratio of reflected power to transmitted power is used to calculate the reflection coefficient of the DUT.

For more details: Cheap homemade 30 MHz – 6 GHz vector network analyzer

The post Cheap homemade 30 MHz – 6 GHz vector network analyzer appeared first on Raspberry PI Projects.

]]>
http://projects-raspberry.com/cheap-homemade-30-mhz-6-ghz-vector-network-analyzer/feed/ 0
Windows 10 IoT Core: UltraSonic Distance Mapper http://projects-raspberry.com/windows-10-iot-core-ultrasonic-distance-mapper/ http://projects-raspberry.com/windows-10-iot-core-ultrasonic-distance-mapper/#respond Fri, 08 Dec 2017 05:55:04 +0000 http://projects-raspberry.com/?p=11718 Hardware components: Arduino Nano R3 × 1 Raspberry Pi 2 Model B × 1 Ultrasonic Distance Sensor (HC-SR04) × 1 Servo (generic) × 1 Resistor (1K) × 3 Resistor (2K) × 3 Jumper wires (generic) × 1 Breadboard (generic) × 1 Software apps and online services: Arduino IDE Microsoft Visual Studio 2015 Microsoft Windows 10 […]

The post Windows 10 IoT Core: UltraSonic Distance Mapper appeared first on Raspberry PI Projects.

]]>
Hardware components: Ard nano
Arduino Nano R3
× 1 R8326274 01
Raspberry Pi 2 Model B
× 1
Ultrasonic Distance Sensor (HC-SR04)
× 1
Servo (generic)
× 1
Resistor (1K)
× 3
Resistor (2K)
× 3 11026 02
Jumper wires (generic)
× 1 12002 04
Breadboard (generic)
× 1 Software apps and online services: Ide web
Arduino IDE
Vs2015logo
Microsoft Visual Studio 2015
10
Microsoft Windows 10 IoT Core

STORY

Ever wonder that we can make a device just like RADAR and LiDAR using these sensors! Yes it is possible; but with some limitation. RADAR are the most precise but are much expensive. So let’s make our own distance mapper device which acts like RADAR using UltraSonic Distance Sensor (HC-SR04) and a Servo.

UltraSonic and IrfraRed are basic fundamental sensor for measurement of distance. These sensor measures the distance in the visible sight of them with the range of 80cm to 500cm. Both sensor have their pros and cons. IR are susceptible to sun-lite and are not good in open field.

Concept

Mapping distance like RADAR requires a rotating sensor that picks up distance at different level and maps into 2D view. Just like RADAR, to rotate UltraSonic Distance sensor, we need a servo that accurately rotates it. Once RPi2 rotates servo at specific angle, RPi2 then measures distance and plot it into 2D view as shown in title image of the article. But we can’t directly operate servo from RPi2 because, Windows IoT buil 10531 provides access to ADC and PWM via external chips. It means we can’t directly control servo from RPi2 and requires extra components. Thus I found a way to operate servo via Arduino. Arduino will communicate with RPi2 via I2C bus and operates servo:

Concept of UltraSonic Distance Mapper

Software

It is clear that we need to develop two firmware. One for Arduino and another for RPi2 (UWP). You don’t have to bother with the complexity of the communication as I have already provided library that will provide easy way for communication between Arduino and RPi2.

I am developing gateway firmware for Arduino. With the gateway firmware, you will be able to operate Arduino directly from Windows IoT code just like you wrote in Arduino sketch. It means that you will be able to manipulate Arduino’s digital, analog, PWM and Serial pins directly from RPi2 with minimal coding. I have already developed gateway firmware for Arduino but right now there are lots of stability issues with it. Thus I’m improving the firmware and going to write PowerTip article for that. Will update here when it will be ready.

Gateway Sketch

Here, gateway is an I2C slave device. Which will serves the task requested by RPi2. There is no special requirement to understand for gateway sketch as it is already provided at the end of the article. It is simple and well commented.

Universal Windows App

Universal Windows App will communicate with gateway via I2C and requests gateway to move servo at specified position. After successful move of servo, UWApp will measures distance and plot it into 2D view.

Do not take immediate distance reading after moving servo because it will take some time (in milliseconds) to set servo at an angle. Take multiple sample of a specific direction to get accurate distance reading. Higher the sampling, more accuracy but with less resolution (it means it will take some time to process samples). So we need to balance sampling and performance.

Schematic

schematic diagram of UltraSonic Distance Mapper

An issue has been found with Arduino Nano. RPi2 won’t be able to communicate via I2C with Arduino Nano if you have implemented voltage divider circuit (Green rectangle in above image) for I2C. Try direct connection for I2C between Arduino Nano and RPi2. It not good for RPi2 (because RPi2 works at 3.3v while Arduino works on 5v)  but it worked for me and there is no any side effect has been seen on RPi2.

Read More: Windows 10 IoT Core: UltraSonic Distance Mapper

The post Windows 10 IoT Core: UltraSonic Distance Mapper appeared first on Raspberry PI Projects.

]]>
http://projects-raspberry.com/windows-10-iot-core-ultrasonic-distance-mapper/feed/ 0
Projecta: A Solution For PCB Printing http://projects-raspberry.com/projecta-solution-pcb-printing/ http://projects-raspberry.com/projecta-solution-pcb-printing/#respond Thu, 07 Dec 2017 06:53:59 +0000 http://projects-raspberry.com/?p=10208 About this project From USA, Europe, China, and from Japan to India; from the Middle East and Hong Kong, we have been looking to find a creative solution for the most critical issue in electronic design: (PCB Fabrication). When you want to turn your innovation from a mere idea to a real product, you won’t […]

The post Projecta: A Solution For PCB Printing appeared first on Raspberry PI Projects.

]]>

About this project

From USA, Europe, China, and from Japan to India; from the Middle East and Hong Kong, we have been looking to find a creative solution for the most critical issue in electronic design: (PCB Fabrication).

When you want to turn your innovation from a mere idea to a real product, you won’t have to spend days in prototyping or weeks waiting for factories in order to see your dream becoming a reality.

Our dream is to print PCB just like printing a paper, and we are now ready to share it with everyone and let you have your own Projecta.

Projecta A Solution For PCB Printing

We were working on a different project (that will be coming to the world soon!) with a critical deadline. The project needed a lot of tests and trials, a lot of PCB prototyping, and also money and time. Due to shipment delays, our project deadline was missed, and from these hardships, Projecta was born.

We started to think about a permanent solution for this problem (PCB printing), and we came up with the perfect solution: Projecta.

 

Projecta is a desktop CNC machine that engraves an ink layer on the surface of the board to make your beautiful PCB designs ready for acid etching and get the resolution achieved by photo-resist dry films but without especial equipment or chemical developers!

 

Buying an ordinary desktop CNC machine will cost you a lot of money, so we designed the machine with our special spindle to make the price so affordable for everyone.

Plus, in comparison with other PCB methods, Projecta will always be on top of the competition, as it doesn’t require any special tools or materials to produce, and so the running cost is always a BIG ZERO.

The machine is directed to all those who make PCB starting from students and home-inventors to professional engineers.

Working with old-school methods for PCB fabrication, you will take a lot of time working on your PCB, developing a film or transferring the ink, which may take a “while,” while Projecta can make your PCB in minutes.

For more details: Projecta: A Solution For PCB Printing

The post Projecta: A Solution For PCB Printing appeared first on Raspberry PI Projects.

]]>
http://projects-raspberry.com/projecta-solution-pcb-printing/feed/ 0
Pool Controller Using Windows 10 IoT Core project to control pool http://projects-raspberry.com/pool-controller-using-windows-10-iot-core-project-control-pool/ http://projects-raspberry.com/pool-controller-using-windows-10-iot-core-project-control-pool/#respond Thu, 07 Dec 2017 05:39:28 +0000 http://projects-raspberry.com/?p=11714 Hardware components: Raspberry Pi 2 Model B × 1 PNY 16GB Turbo MicroSDXC CL10 × 1 SparkFun Arduino Pro Mini 328 – 5V/16MHz × 1 SainSmart 5V 4-Channel Solid State Relay Board × 1 Tolako 5v Relay Module for Arduino × 1 DS18b20 Waterproof Temperature Sensors × 1 4.7k Ohm Resistors – 1/4 Watt – […]

The post Pool Controller Using Windows 10 IoT Core project to control pool appeared first on Raspberry PI Projects.

]]>
Hardware components: R8326274 01
Raspberry Pi 2 Model B
× 1
PNY 16GB Turbo MicroSDXC CL10
× 1 11113 01
SparkFun Arduino Pro Mini 328 – 5V/16MHz
× 1
SainSmart 5V 4-Channel Solid State Relay Board
× 1
Tolako 5v Relay Module for Arduino
× 1
DS18b20 Waterproof Temperature Sensors
× 1
4.7k Ohm Resistors – 1/4 Watt – 5% – 4K7 (10 Pieces)
× 1
Raspberry Pi USB WIFI Dongle
× 1
A Male To A Female Extension 1-Feet Usb
× 1
American Valve CL40PK6 Number 40 Clamp, 6-Pack
× 1
J-B Weld 8272 MarineWeld Marine Epoxy – 2 oz
× 1
Seat Washer
× 2
Micro USB Power Supply Wall Charger AC Adapter
× 1 Software apps and online services: 10
Microsoft Windows 10 IoT Core
Vs2015logo
Microsoft Visual Studio 2015
Microsoft IIS
Ide web
Arduino IDE
OneWire Library
Dallas Temperature Library
openHAB open source home automation software
Hand tools and fabrication machines:
Printrbot Simple
Used to create enclosure and sensor mounts
Ftdi Usb to Ttl Serial Adapter Module for Arduino Mini Port
Used to upload sketch to Arduino Mini Pro

Pool Controller Using Windows 10 IoT Core project to control pool

STORY

Automated Pool Controller

Twice, in three months time, the timer for my pool pump failed.  This inspired me to create this project. The cost of replacing those timers was over $120 and all I had to show forit was a timer that gave me very little control and a high failurerate. I also suffered a failure of thetemperature sensor on my solar water heater that cost an additional $30.

I knew that I could create a cost-effective automatedpool controller that gave me much more control over when my pool pump ran.  I wanted to have more variables as to when the pump ran instead of the simple time and day of the existing timer. I also wanted to be able to not only automatemy pool pump, but also monitor the status of various aspects of my pool environment. A further goal was to be able toaccomplish these tasks from anywhere using any device.

The project I have created is very cost-effective as it utilizesa Raspberry Pi running Windows 10 IoT Core, Relays, Arduino Mini Pro as well astemperature sensors, wiring and 3D printed components. I completed this project for far less money than I had paid for the two prior timers and solar temperature sensor.

Pool Pump Control

I started my project by controlling solid state relays frommy Raspberry Pi running Windows 10 IoT Core. These relays allow meto control my AC (Alternating Current) components such as the pool pump.  The solid state relays control the existing 30Amp AC relays that the old timer had utilized.  After designing and testing the circuit for the pool pump, I created additional functionality to control other AC components such as my pool waterfall, and my pool and yard lights. With this portion of the project designed, I could control all of these elements remotely.  No longer would my family members or I need to physically open the controlbox in order to turn on the waterfall, turn on the pool or yard lights or set the timerfor the pool pump.

Read More: Pool Controller Using Windows 10 IoT Core project to control pool

The post Pool Controller Using Windows 10 IoT Core project to control pool appeared first on Raspberry PI Projects.

]]>
http://projects-raspberry.com/pool-controller-using-windows-10-iot-core-project-control-pool/feed/ 0