Raspberry Pi Controlled Sofa

      4 Comments on Raspberry Pi Controlled Sofa

Since getting married a couple of months ago I’m slowly getting back into the ‘swing of things’! It has been a busy few months as I have also left my school of nine years and will be starting a new role in January. The handover process took quite some time!

New IconThis post differs from my other posts as it is about more of a personal project rather than a school one. It is equally as geeky however and I will be investigating how this can be simplified into a school project around ‘Automating your Home’ in the future. Hopefully you will find it interesting! As you can imagine, married life brings about new challenges and in our household, the first of which was the big question . . . How do we control our new reclining sofa from our mobile devices? Pushing a button next to the seat just seemed too easy for us, so we (mostly my husband) set out on a project to take control over this small part of our living room.

We bought the new sofa from DFS back in September knowing it would not be delivered until after we returned from our honeymoon in November. My husband, Kevin, likes a challenge and thought about controlling it with our Raspberry Pi using the GPIO pins. First he bought a solid state relay module which he powered from the Pi so no external power was needed. Unfortunately this type of relay typically only works with AC current as they switch off at 0 volts so we were not able to use them. He therefore had to buy a normal relay module; this requires 72 mAmps per relay (504 mAmps total) so required an external power supply.

Next, Kevin needed to turn the Pi into a web server so he could access the sofa controls over our home network. He decided to use Ruby to build this as it met all the requirements. Ruby uses modules, known as ‘gems’ and he used the Pi_piper gem, which is widely used to control GPIO pins, and the Sinatra gem to create a RESTful API. The plan was to keep the sofa switches independent and use the Pi as a secondary controller accessed using a smartphone app.

Then the big day arrived (no, not the wedding day, although that was pretty big too . . . but “Sofa Delivery Day!”), before the delivery truck had pulled out of the road Kevin had the sofa on its side and enlisted my assistance to document the pin outputs from the din connectors. At this point we discovered that due to the pin layout it was not possible to keep the relay module and the sofa switches connected at the same time due to the pins being grounded when they are not in use. The only alternative was to plug all the switches into the Pi so that the Pi now has complete control over the sofa.

Prototype using a breadboard

Prototype using a breadboard

Of course with this new method it was important to protect the Pi from the high voltage of the sofa. We used optocouplers to separate the voltages and detect button presses. The sofa position is tracked using time from the upright position. This isn’t perfect but without adding sensors it was the best way possible. Now he understood how the whole system would work Kevin planned Version 1 on a breadboard using Fritzing and used their fabricate service to have the circuit board manufactured.

PiSofa Board V1 Circuit Board

PiSofa V1 circuit board design in Fritzing

The board arrived on 23rd December so on Christmas Eve, while I was cooking up Christmas delights in the form of mince pies, Kevin set to work wiring up and soldering the circuit board.

PiSofaV1

Version 1 of the PiSofa set up behind the sofa

The end result: We now have  a fully functional reclining sofa that we can control using an app on our smartphones (and Kevin’s new Pebble Smartwatch!)

Pebble Watch and Phone App

Kevin modelling the apps he made on his phone and new Pebble smartwatch

The apps are quite simple; they send web requests to the API which switches on relays to move the seats on the sofa. We have even incorporated a few extra modes such as “Crazy Mode” in which the buttons control random seats and “Parental Mode” to deactivate the sofa’s physical buttons (we’ll be trying this out tomorrow when entertaining our young nieces!). To read the full documentation for the project click here.

Future Improvements

Kevin is currently working on an improved version of our PiSofa now he has a better understanding of the electronics involved. These improvements consist of the following:

  • Removing the 5 pin din connectors on the Pisofa board as they are big and take up a lot of space
  • Removing the optocouplers (the voltage doesn’t fluctuate so can be correctly managed with a voltage divider circuit instead)
  • Replacing the large overpowered relay board with lower powered 5mm relays. These run at just 34 mAmps each (238 for all 7). This means the PiSofa board could be powered directly from the Pi
  • The new board will attach directly to the Pi and the board size will only be 2mm bigger

So far, the new circuit board design looks like this:

PiSofa Board V2

PiSofa V2 Circuit Board in Fritzing (currently a work-in-progress)

 

Where has my Summer Gone?

      No Comments on Where has my Summer Gone?

I just wanted to add a quick post as it dawned on me that I’d almost vanished from the Internet (well Twitter at least) all summer! I have also neglected my blog so apologies if you have added comments, to which I have only just replied. The reason? I am planning a wedding! I got engaged to my long-term partner at Christmas and we are due to get married in only a few weeks. As a result I dedicated my summer holiday to making papercraft table centre-pieces, the intention being to actually finish them over the summer affording me a stress-free start to term! Ha ha! Well things didn’t quite go to plan as the papercrafting turned out to be a lot more time-consuming that I had originally planned and as a result I am still spending most evenings and weekends, in between lesson planning, working on them with only one more left to do (Lara Croft)!

Being the geek that I am I’m sure you will not be surprised to hear that we are having a geeky theme to our wedding in the form of computer games with each table being named after one of our favourite games (yes, my future husband is a bit of a geek too!). So here is the result of my summer of hard work:

I should also mention another success of my summer which was being featured on television with some of my students, you can check out the condensed version of Propellor TV’s Business World here:

Again, apologies if you post comments or email me and I take a long time to respond! Please be patient! Once I return from my honeymoon in early November I’ll be back to business!

 

The Kodu Kup

      4 Comments on The Kodu Kup

Throughout this year I have been working with Stuart Ball from Microsoft one day per week on their UK Kodu Kup competition. Before the launch I was responsible for producing a lot of the teachers’ resources and was part of the launch event at BETT back in January. Since then I have been out and about visiting schools, delivering teacher-training sessions and have even visited the House of Lords promoting the competition (alongside my other mission of girls in Tech!).

My role also entailed downloading, playing and collating each of the entries ready for the final judging and I was later honoured to be asked to form part of the judging panel on the day which I was really excited about; although I underestimated how difficult this job would be!

Final 11

After a long wait, on Friday the final of the Kodu Kup had at last arrived  and took place at Microsoft HQ in Reading. Eleven teams were competing to receive the Kodu Kup Gold award along with an Xbox 360 each! The teams took it in turns to present themselves and their games one by one and I have to say I was blown away by the quality of the presentations by all of the groups. Each had prepared video trailers of their games and many had put a lot of detail into their presentations, some even talked about costings, research, testing and future plans!

The Kodu Kup judges

The team of judges (pictured on the left) consisted of myself, Gary Carr of Lionhead Studios, Theo Chin of Indie Skies and Ray Chambers, Head of ICT at Uppingham Community College. As the displays were so fantastic we had a really tough time judging and even ran over our allotted time trying to decide! Our “final three” remained a “final five” up until the last few minutes and then we had the difficult job of deciding the order of the final three. After much deliberation we finally decided on the winning teams as follows:

  1. Afon Taf High School – Dark Side of Mars
  2. Lister Community School – Hyper Space Invaders
  3. Putney High School – Cycle and the Jetataur

The Kodu Kup winners from Afon Taf School

Each of these not only had superb games but also gave very good presentations and I was touched to be the one to present them with their awards. I particularly liked how the girls from Afon Taf High School talked about how they wish to inspire more girls to go into the gaming industry and had even prepared questions for us as judges. They have set up their own Game Studio called Artemis Games and I know they have lots of plans for the future; I am very keen to see what they produce next! The boys from Lister Community School made an excellent remake of Space Invaders with multiple levels and were clearly passionate about the work they had produced. The group from Putney High School was another all-girl group who produced a remake of the arcade game, Labyrinth, but with a Greek Mythology twist, I really liked how they plan to expand their game empire with more Mythology-themed games to educate other children.

I have been so impressed with the standard of games produced for this competition, it’s very inspiring to see so many schools are now using Kodu Game Lab as a tool for teaching programming. I know this competition will be even bigger and better next year as more schools hear about it. You can view all of the final 11 entries on the Kodu Game Lab website.

Toxic Pandas Tshirt

Lastly, some particular highlights for me that I wanted to mention include another entry from Afon Taf High School called Nexus, a Mars-themed game with a great storyline. I also enjoyed playing a game called Kodu Koldasack by the team at Cadaxton Primary, a very addictive remake of Frogger which after many attempts I still have yet to complete! There were also two lovely water-themed games that I really liked which were  ‘Desert Breakdown‘ from Bushfield School and ‘Factory Pollu‘ by Barlows Primary. I also loved the way Barlows Primary had created a whole house style and company logo for themselves with their team being called the Toxic Pandas, they even prepared a goodie-bag for each of the judges which included biscuits, a mug and a t-shirt (which I am proudly modelling on the right!)

This is the end for the Kodu Kup 2013 but keep an eye out for more competitions in the future by checking the Microsoft Teachers’ Blog and following Kodu Kup on Twitter and Facebook!

Nicki Maddams and Stuart Ball

Girls’ Game Workshop

      4 Comments on Girls’ Game Workshop

Geeky BarbieOn Monday I ran my first Girls’ Game Workshop at my school. This involved 16 girls taking the role of game developers for two days. The girls in question had been nominated by their IT teachers as suitable candidates and they worked in pairs over the two days. The first day of this workshop began by designing the storyline for their games and the accompanying artwork. We later moved onto developing the artwork on the computers.

I was extremely impressed by the artwork produced by the girls, both on paper and on-screen. They worked really hard on this and most were very pleased with the outcomes. Here are some snapshots of what they produced (click to enlarge).

Artwork

On Tuesday the girls developed their games using the new web-based version of Scratch, first they imported the graphics they had developed the day before. I guided them through each of the development stages and they completed workbooks throughout the workshop, including entrance and exit questionnaires.

Using ScratchThey struggled a little bit when it came to coding their games on the Tuesday. I think this was largely because there were so many great ideas for the games, some were perhaps a little ambitious. In hindsight I should have homed-in their ideas a little bit at the design stage, I was quite blown-away by their enthusiasm at the time and so hadn’t want to stifle them! I had shown them an example game the previous day so they knew the main idea was to produce a game with multiple scenes to unveil a storyline. Many of them chose zombie-style games which surprised me! (I hadn’t realised the trend had moved away from vampires!).

In running the workshop this week I have made a note of some ideas and points to consider for next time:

  • Try to recruit a colleague to help with the coding on the day, as I ran this on my own I felt I kept a lot of the girls waiting when I was going around individually helping each group.
  • Smaller group size – my group had 16 girls working in pairs and I felt this was too many for a workshop environment. It may be different with an extra member of staff, but ideally I would maybe cut the number down to around 12 next time so I can spend longer working with individuals.
  • Perhaps run the sessions as larger groups (maybe 3 or 4) working together as mini “game studios” and get the students to pitch their ideas to a panel. With this they could simply produce a game-prototype rather than a fully finished game; each member of the group could have their own role, such as marketing, finance etc.

The quotes were mostly positive, although some requested more time and extra staff, echoing what I have stated above. Here is what the girls had to say about the day:

  • “It was awesome”
  • “We learnt teamwork, creativity and how to code the Scratch characters”
  • “I learnt what people that design games go through”
  • “I learnt how to develop the storyline and artwork for games”

From the questionnaires I received back; before the workshop none of the girls stated they would consider a career in either IT or gaming which I found very surprising. Upon completing the exit questionnaires 4 answered “yes” or “maybe” to the same question. I must point out that a fair number had already chosen specific career paths, such as paleontology, performing arts, child care, teaching etc. but I was very surprised that so many did not see the IT industry as a potential career option. I took the ideas for my entrance and exit questionnaires from Belinda Parmer’s book, Little Miss Geek (a recommended read if you’re interested in this issue). I will do a more detailed write up  on my findings from this questionnaire and other research at a later date

Running this workshop has certainly highlighted, again, what a huge issue this is and has motivated me even further to pursue my quest in inspiring girls into the industry!

Scratch Resources from EiS Training

      No Comments on Scratch Resources from EiS Training

This is just a quick post for me to share my resources from the Scratch training I delivered today on behalf of EiS Kent.  You can view the PowerPoint Presentation below:

[iframe src=”https://skydrive.live.com/embed?cid=4AF0FC556AE5AF3F&resid=4AF0FC556AE5AF3F%216109&authkey=ANT4pEOiqHiGKkQ&em=2″ width=”402″ height=”327″ frameborder=”0″ scrolling=”no”]

and here is the Scratch game we made (if it’s not displaying correctly on the page click here to view on the Scratch site):

[iframe allowtransparency=”true” width=”485″ height=”402″ src=”http://scratch.mit.edu/projects/embed/11114449/” frameborder=”0″ allowfullscreen]