Showing posts with label GPIO. Show all posts
Showing posts with label GPIO. Show all posts

Sunday, 28 August 2016

Raspberry Pi GPIO: Gambas + pigpio library

There are now a number of ways of controlling the Raspberry Pi general purpose I/O.


Libraries such as wiringPi and pigpio are written in the C programming language, but can also be used with other languages including Gambas.


I have covered wiringPi previously, and this short post is just a basic introduction to using the pigpio library with Gambas.

Friday, 12 February 2016

PWM on RaspberryPi with Gambas

The Raspberry Pi has a PWM (pulse width modulation) mode which can be put to use in Gambas with the help of Gordon's wiringPi library.

 

The wiringPi library allows access to the hardware controlled PWM feature which is output on wiringPi pin 1.


So here are some notes and a small Gambas test program to help explore its capabilities.

Saturday, 23 May 2015

Raspberry Pi Serial Comms: Gambas + wiringPi

I've been playing around with serial comms on my Pi/Picaxe dev rig.


Using Gordon's wiringPi library makes it easy to open the gpio serial comms port on the Pi and write code with Gambas.


So this post involves writing a simple Picaxe program, and then using wiringPi and Gambas on the Pi to communicate with the Picaxe.

Saturday, 2 May 2015

RaspberryPi, Serial Comms & PHP

I've been playing around with serial comms on 2 Raspberry Pi computers for the last couple of days.


And I now understand a little of the black-art required to get this working, including how to send serial data via a PHP web page.


So I thought I'd write up the details before I have time to forget it all again!

Wednesday, 22 April 2015

Raspberry Pi GPIO control with PHP

When I setup my Raspberry Pi server 8 months ago, one of its potential uses was for me to play with PHP and hopefully learn more about this language.


I found a bit of time this week, so decided to try making a minimal PHP program to control the Pi gpio from a remote computer or phone.


What I've come up with is a simple file using HTML and a few lines of PHP code.

Wednesday, 1 October 2014

RaspberryPi inputs: to poll or to interrupt?

One of the best features of the RaspberryPi is the GPIO (General Purpose Inputs & Outputs).


Reading the input levels on the GPIO is pretty easy, especially using Gordon's wiringPi library.


But you need to think carefully about how best to do this in the software for your chosen project.

Sunday, 14 September 2014

RaspberryPi Web server: GPIO access

Controlling the RaspberryPi GPIO remotely, over a network or across the internet, seems like an interesting trick.


I copied some code from the net and gave it a try, but unfortunately it didn't want to play.


So I went back to basics and created my own simple test routine.

Saturday, 30 August 2014

RaspberryPi + DS18B20 Temperature Sensor

The DS18B20 is a low cost, simple to use, 1-wire temperature sensor which is ideally suited for use with the Raspberry Pi.


Up to 10 of these sensors can be wired in parallel to a single Raspberry Pi GPIO pin, each giving a reasonably accurate indication of temperature.


The current Raspbian image includes support for these devices, so its quite easy to get them up and running.

Sunday, 6 April 2014

SE-10 Passive InfraRed sensor (PIR) & the RaspberryPi

The SE-10 is a commonly available PIR sensor produced by Hanse Electronics.


Having bought one of these from HobbyTronics, I tried to use it on a Raspberry Pi, but ran into problems.


A search of the net just reveals confusing and often contradictory information, so I did some investigation of my own.

Wednesday, 22 January 2014

BirdBoxPiCam 2014; #2b Activity Based Power Control Details

Progress has been very slow through December, due to both project related issues, and real-life getting in the way (which is actually not a bad thing).


Project issues include a cmos 555 timer with a strange fault, a damaged RaspberryPi USB socket, and discovering my choice of relay was a bad one.


Although the relay had a 1A contact rating and looked suitable for a Raspberry Pi drawing less than 500mA, this rating is for a purely resistive load. (see earlier post for relay circuit details.)

Saturday, 16 November 2013

BirdBoxPiCam 2014; #2a Activity Based Power Control Details

Following on from an earlier post, I now have a prototype circuit undergoing testing.


This seems to be behaving as expected, and draws very little current when in standby.


Just to recap, this circuit will power-up my RaspberryPi when activity is detected at the entrance to a bird box (e.g. a bird or an insect breaking the beam between an infrared source and a detector).

Friday, 8 November 2013

Maplin's RaspberryPi GPIO Breakout Board

Just bought one of these little kits to connect my RaspberryPi to a breadboard.


Well, it was cheap...only £3.39.


I was actually looking for a set of jumper leads, and wondering whether I needed male-female, female-female or some other sexual combination, when I spotted this kit from Maplin.

Wednesday, 6 November 2013

RaspberryPi Case; add a GPIO slot

Our Computer Science students have just started hanging components on the RaspberryPi GPIO.


However, the nice cases that protect the RaspberryPi also make it difficult to connect wires to the P1 connector.


Rather than removing the lid from all boxes completely, I decided to cut a slot in the top, just large enough for nimble young fingers to connect insulated jumper wires.

Sunday, 3 November 2013

RaspberryPi GPIO; Using Gambas

The digital IO on the RaspberryPi is very useful for reading switches and turning on relays, lights and driving small motors....


...and controlling the digital IO with Gambas turns out to be really easy.


Here is a very basic example which makes use of the wiringPi library written by Gordon Henderson.

Friday, 1 November 2013

Class notes; How To Drive LEDs From A RaspberryPi


I was asked recently to help with a RaspberryPi training session for a group of young Computer Science pupils.

 

So this post is simply the hand-outs from this session.