Sorry for not posting for a while, we haven’t covered much new material in the last few weeks.
Today we finally nailed down what our projects are going look like and I think we have some very impressive ideas to work on for the next couple of weeks. By the last session we will be displaying devices like a flood gauge, a food and recipe management system, a retro arcade console, a scalextric racing game timer, a survey/voting machine and a device to help the visually impaired recognise the contents of food cans.
Projects are important for two reasons, they encourage Ninjas to work on their own and they will be the basis for awarding belts.
This year for belts in the Raspberry Pi and Electronics group Ninjas will be examined on more than just code, they will also have to speak about the reason they chose to do the project they did, they will have to explain the various hardware components they used and they will have to create a poster for their project.
I’m looking forward to a busy few weeks in the PiDojo group.
Sorry for the delay in posting, I’ve been very busy over the last couple of weeks.
Up until now we’ve mainly looked at what we can do with the GPIO Pins on the Raspberry Pi but over the last two weeks we looked at how we might make information from our scripts available to the world outside.
Two weeks ago (Sat 5th Mar.) we looked at how we might use the internet to share data. Although the Pi is capable of running a web server and we could build a few web pages fairly quickly there are easier ways of getting information to the public. We can use Twitter to broadcast information and we can use Email for more targeted sharing.
The tutorials in my notes Email and Twitter will show you how to set up the Email and Twitter modules for Python on the Raspberry Pi and you can see our code here.
Last Week (Sat 12th Mar.) we learned how to share data using a Spreadsheet. The tutorial in my notes spreadsheets will show you how to install the XLWT(Excel Write) Library for Python and you can use our code here to create the spreadsheet shown below.
Last week we used GPIO Zero’s inbuilt functions to control our robots. These functions allowed us to move or turn our robot using time to control the amount of movement, this week we made our own functions which allow us to control our robot using distance and degrees. A version of the code we used is available here and check out my slides here Robot Functions.
We had another enjoyable session this week, we especially enjoyed the drone demo by Chris Tierney.
We began our ownsession by looking at using input from our keyboard with Pygame to control our robot. We then returned to last week’s challenge, programming our robot to follow a defined path. We continued to have issues with the robots going off in arcs rather than straight line so we started to build corrections into the code. We will continue with this next week and we will learn to use functions to tell our robots what distance we want them to travel or the angle we want them to turn instead of using times to control them.
Here are my notes from today pygame robot and our code is available here
For more on Pygame there’s a very good tutorial here
This week the PiDojo group started to experiment with building our own robots.
To build a basic robot all you need is motors, a driver chip, some batteries and of course a Raspberry Pi.
IMPORTANT: Do not connect a motor, no matter how small directly to the Raspberry Pi, it will damage your Raspberry Pi.
We use a L293B motor driver chip which is like is a little current amplifier that takes a low-current control signal and then turns it into a higher-current signal that can drive a motor.
I would also recommend using separate batteries to power the Raspberry Pi and the Motors as the motors can sometimes draw a lot of power from the batteries for example when starting up and this could cause the Raspberry Pi to restart. We used a “Power Bank” from Penneys to power the the Raspberry Pi and four AA batteries to power the motors. Here is a drawing of our circuit.
We wired up our circuit and placed it into a container that had the motors attached to it.
Once we had our robot assembled we loaded up this code and tested it out then we tried to program our robots to follow a preset path but the lack of a third wheel made this very difficult, something we will have to improve for next week.
This week was also our first time using Gpio Zero which is a new Python library for controlling the GPIO pins on the Raspberry Pi. It makes physical programming much more straight forward and really helped to speed up our work this session.
In the Raspberry Pi group we had planned on everybody building some small projects together before the Christmas break and then moving on to bigger individual projects after Christmas. Unfortunately we’re a little behind on our small projects due to the taster sessions in the beginning of the year and the fact we didn’t have a proper session in December but we’ll catch these up in the next couple of weeks.
However as the difference between a good project and a really great project is sometimes the idea behind it I decided to spend most of this week’s session looking at ideas for our projects. I asked the Ninjas to ask themselves the following questions if they were stuck for ideas.
- What do I like to do?
- What/Who do I care about?
- Is there something I’ve always wanted?
- What’s going on? (In the news, in my community etc.)
As you can see from the picture we had loads of ideas to start with and I’m sure we will come up with many more before we finally have to start working on our project.
We also discussed the Coolest Projects Competition but as we’re planning on sharing information with the whole Dojo soon I won’t say much about it for now but here’s a picture from last year’s competition.
This week was a very exciting week for us Raspberry Pi fans with two major announcements from the Raspberry Pi Foundation.
- The Raspberry Pi Zero
- GPIO Zero
Raspberry Pi Zero
The Pi Zero is a fully fledged Raspberry Pi that measures 65mm x 30mm x 5mm and only costs $5. It has the same chip as the Model B that we use every Saturday but it’s clocked to 1GHz (40% faster than Raspberry Pi Model B) .
It will be really useful for what we’re trying to achieve at PiDojo due to it’s size and cost. We will be able to leave our projects assembled when we are finished building them due to the low cost of replacing the Raspberry Pi.
A new Python API for Physical Computing
The idea behind GPIO Zero is to make using the GPIO pins easier. It provides simple interfaces to everyday components like LEDs and buttons, to make playing around with common components much more accessible. It’s designed with education in mind, to help teachers and kids get going with physical computing without the friction of worrying about pull ups, edges and all the setup. But most people will find it very handy. So we should be able to code our projects easier and with less code.
For more information on the Pi Zero click here and for GPIO Zero click here.
Some of the PiDojo Ninjas got their Measuring Devices working and we will continue debugging the rest at our next session. There will be no PiDojo next week so the next PiDojo session is on the 12/Dec/2015 and if the Components I have ordered arrive we will start building Robots. Here is our code from today.
The HC-SR04 Ultrasonic Distance Sensor
Today we used the HC-SR04 Ultrasonic Distance Sensor. The HC-SR04 is a cheap sensor that is used in lots of electronics projects.
Next week we’ll connect up the sensor to our LCD Display to make a measuring device. Our code from today can be found here and here are my slides Distance Sensor
Today we used a 20×4 Alphanumeric LCD Module to output information from our Raspberry Pi. These modules are cheap and easy to interface to the Raspberry Pi. We only need to use 8 pins on our Pi leaving loads of pins to connect input devices to.
We used Matt Hawkins’ LCD Test script to test our displays. Then we imported some code from that script to write some jokes to our displays. We will finish off these next week and we will start working on code for an ultrasonic distance sensor.
You can view our code on Dropbox and here are my slides from this week LCD_Display
This week we finished off the project we started in the taster session. We had a few difficulties with the network but we managed to get our Reaction Game working. We finished the session with the First Annual Coderdojo Athenry Reaction Game Championships. Our code from today is available here and these are my slides from today Reaction Game.