Artificial pancreas for diabetics run by a Raspberry Pi

This blew me away when I read it.

Seattle-based Dana Lewis suffers from Type 1 Diabetes, and has done since she was 14. One of the issues facing diabetics is that during the night, despite having all kinds of different monitoring equipment, it is all too easy for the sufferer to not be woken by the alarm, leading to them feeling unwell in the morning, or possibly even dying during the middle of the night. To solve this, Lewis and her then-fiance (now husband) Scott Leibrand concocted a monitoring system that would keep an eye on her glucose levels and then recommend an insulin dose to the injection device she wears. After prototyping the device, which they dubbed the DIY Pancreas, and requiring Lewis to press a button to administer the dose, they realised that they had an algorithm they could use that could learn from her habits and get the dose right 100% of the time. They used a Raspberry Pi to receive data from the monitor, control the algorithm and then issue commands to the insulin pump automatically, thus enabling Lewis to sleep soundly.

They are now supporting other diabetics who are seeking to ‘close the loop’ on their treatment.

Read more on this amazing project at Business Insider and take a look at their blog for the full story.

Upcoming events in Cambridge for @Raspberry_Pi enthusiasts

Hi everyone. Just wanted to share news of a couple of upcoming events in Cambridge. You probably already know about them, but just in case!

Cambridge Raspberry Jam – 12th September

First up, we have our traditional CamJam on the 12th of September at the Institute of Astronomy. We’ve got a great line-up of talks which should be fun, educational and informative. The timetable of talks is available here. We also have a soldering workshop going on throughout the day – Pimoroni are running that. Our Marketplace will be bustling with the following vendors: The Pi Hut, 4tronix and Pimoroni. And, of course, we have Show and Tell going on all day with various projects from art to robotics. You can book tickets here.

Pi Wars – 5th December

Our challenge-based robotics competition will take place on 5th December at the Cambridge Computer Laboratory. 32 teams will compete for prizes over 7 different main challenges, with lots of other side-challenges happening at the same time. We will have a robotics Show and Tell all day and there will be an extensive Marketplace area with all your favourite vendors. You can find out more about the competition from our website here. You can buy spectator tickets for the day here.

 

Myself and co-organiser Tim Richardson really hope a lot of you can make it to these events!

Bathroom moisture extraction controlled by a Raspberry Pi

Dave Hunt’s bathroom didn’t have extractor fans fitted when the house was originally built. He decided to overkill the problem by having a Raspberry Pi control some new fans he fitted. He uses AM2302 humidity sensors to detect the moisture levels in the air. The readings get fed back to a Raspberry Pi in his attic which then controls the extractor fans via relays. In the picture above you can see the perspex plate the electronics are fixed to for mounting above the bathroom ceiling. Read more here.

Walnut-cased Raspberry Pi model A+ gaming consoles

Love Hulten is a Swedish designer and craftsman who loves to fuse together technology and more traditional materials. He’s just unveiled his latest two creations. The first is called the PE358 and is inspired by the Game Boy Advance.

It features all the expected buttons and cross-pad from the Nintendo machine and is based on a Raspberry Pi A+. It has a walnut case and folds down into an innocuous wooden block.

The second device is called the Battlecade and is a two-player version with proper joysticks and back-to-back 12″ LCD screens. It includes a compartment for the joysticks and power adapter and, again, folds up into a wooden block when not in use.

Really lovely old-fashioned craftsmanship and some great tech know-how.

Martian adventures for the Raspberry Pi

Exploring Mars is likely to be the most exciting scientific project of this century. Whenever it happens, it will capture the imagination of adults and children alike. There are just a few hurdles to overcome first! Like getting there… One of the issues explorers will face is the need for natural resources on the red planet, particularly water. Curiosity and the Phoenix Mars Lander indicated that there was water on Mars, frozen into the soil. The current thinking is that instead of transporting vast amounts of water to the planet (infeasible due to space and weight), a device will be used to retrieve the water that is already there.

The Mars Aqua Retrieval System (MARS) is a proof-of-concept for a water-extraction robot developed by the Singapore University of Technology and Design, and Australia’s Gilmour Space Technologies. The Raspberry Pi- and Arduino-powered robot has been designed to travel to a set of co-ordinates, microwave the soil and then collect the water vapour, condensing it back to liquid form. Its current rate of conversion is 4 grams per 4 minutes, so it’s unlikely to go to Mars in its present form, but as a proof-of-concept it works. It was built for a budget of $10,000 and is designed to work in the Martian atmosphere.

Read a bit more here.

SenseHAT launched by the @Raspberry_Pi Foundation – an extensive first look

#Camu

This morning, the Raspberry Pi Foundation announced the immediate availability of the SenseHAT. The SenseHAT is the guts of the Astro Pi and has an inherent space-aged coolness built in. The board you hold in your hands is the same hardware that is going into space (enormous metal flight case not included). I was fortunate enough to be given one to look at and review.

If you prefer to get your information from a video, jump straight to the video demo.

If you don’t want to read everything and want to know where to buy one from, jump to the Pricing section.

Background

As I said above, the SenseHAT is the heart of the Astro Pi. British astronaut Tim Peake will be launching on 15th December on a mission known as “Expedition 46” (or Soyuz TMA-19M). Part of the payload of the spacecraft will be two Raspberry Pi model B+s with SenseHATs attached, wrapped in a metal flight case. Also contained within each case is a Pi camera: one is a regular camera, the other is a PiNoIR. The Soyuz spacecraft will lift off and travel to the International Space Station and return on 5th May next year. During the mission, Peake (and possibly other astronauts) will trigger experiments on the Pis that school children have written.

Hardware

The SenseHAT has the following features:

  • A temperature and humidity sensor.
  • A pressure sensor.
  • A sensor combining a 9-degrees-of-freedom accelerometer, gyroscope and magnetometer.
  • An 8×8 matrix of bright LEDs controlled by an onboard Atmel Tiny 88 chip.
  • A 4-way digital joystick with a push button in the middle.

For full technical specifications, take a look at the Foundation’s blog post. For the technical schematic, take a look here.

Software

The software was easy to install. I won’t go into the method I used to install as the ‘official’ way is slightly different. According to the GitHub repository (which hadn’t been updated when I took the other route) says installing is as simple as this:

sudo apt-get update
sudo apt-get install sense-hat
sudo pip-3.2 install pillow
sudo reboot

You only need “pillow” if you’re going to program in Python 3.

* If you have any problems getting it working after these installs, try enabling I2C through raspi-config.

The main bulk of the software is a Python library that I believe works in both Python 2 and Python 3. You use the library by first of all importing the package:

from sense_hat import SenseHat

and then instantiate the module as an object:

sense = SenseHat()

You can then use the in-built functions to access data from all the sensors and display information on the 8×8 matrix.

All the software is on GitHub in case you need to look at it and there is an API guide over at PythonHosted.org – pay particular attention to the API documentation (most notably set_imu_config() if you want to get the compass working correctly!)

Examples

The software comes with a few examples to get you going. They are:

  • colour_cycle.py – lights up the 8×8 matrix and cycles through a lot of the colours available to you when programming it.
  • compass.py – by holding the Pi in the right orientation, the 8×8 matrix shows a dot pointing North.
  • pygame_joystick.py – a PyGame script that takes input from the joystick on the SenseHAT and lights up in the appropriate position. The joystick mimics the up-down-left-right arrows and carriage return, making it easy to pick up on the ‘key presses’ in Pygame.
  • rainbow.py – a simple test of the 8×8 matrix – it displays an animated rainbow (see picture below – thanks to Alex Eames for the photo as my one didn’t show it off very well!).
  • rotation.py – displays a ? symbol and rotates it through 4 different orientations. Rotation is really easy using the library.
  • space_invader.py – loads an image file of a space invader icon and displays it on the 8×8 matrix.
  • text_scroll.py – scrolls a message across the 8×8 matrix. Again, the library makes scrolling text very simple.

Astro2comp_sm

Photo credit: Alex Eames

Taking things further

I wanted to try out a few things on the board but didn’t have the time to create something myself. So, I took to Google and GitHub and found these terrific examples.

If you try these examples, you may have to change library references from “AstroPi” to “SenseHat”.


Video demo

You can see a video of some of these examples as well as a general overview of the board below. I apologise for the abrupt cut-off – I ran out of space on my mobile phone!

If you’d like to see Matthew Timmons-Brown’s take on the board, view his video below:


Price

The RRP for the board is $30 and that works out (ignoring the exchange rate disparity!) at £25. It is available now in the UK from The Pi Hut, Pimoroni, the RPF Swag Store and CPC. If you’re in the States, take a look at MCM Electronics.

Conclusion

The SenseHAT is a real stunner. It is stuffed with functionality. It has the killer three things that you want: control (the joystick), display (the matrix) and lots of sensors. The price is very reasonable for what you get, especially if you compare it to something like the Unicorn HAT which just has the 8×8 matrix. For effectively the same price, you get all this extra stuff to use! (Admittedly, the Unicorn does have bigger, brighter LEDs. You pays your money, you takes your choice).

The only negative thing I can think of is that the unused GPIO pins are not broken out. However, that’s not unusual for HATs in general so I don’t feel like marking the SenseHAT down at all. You could just about use the other pins by soldering onto the surface-mount points on the top.

Above all, the thing you should remember is that this hardware is going into SPACE. You’ll be able to use it to replicate the code that is being used on the International Space Station as well as develop your own experiments! As an educational tool, I can imagine it being used in a wide variety of different subjects and the price point makes it an attractive prospect for schools.

I have no hesitation in awarding this board a rating of 10/10.