Open University "Sense" board and the Pi


22 posts
by ITCSW » Thu Jun 07, 2012 5:17 pm
Does anyone else have a "Sense" board from the Open University? I have one, the OU created it to teach basic programming on their TU100 computing course and they re-wrote a version of Scratch to use with it.

It has an IR sensor, Temperature sensor, Motion sensor, 6 LED's, an IR emitter, light sensor and a step motor as well as a plug in 9V battery unit. It's about one and a half times the size of the Pi and I'm wondering about connecting the two together but don't have the electronics know-how to decide whether it's a good idea.

Does anyone have any ideas? Or does anyone know anything more or have a schematic of the Sense board?
Posts: 12
Joined: Tue May 29, 2012 11:00 am
by RichardUK » Thu Jun 07, 2012 9:00 pm
I'm about to start that course in October. I take it you're on this course now? What is it like.
How is it connected to a normal PC?
User avatar
Posts: 131
Joined: Fri Jun 01, 2012 5:12 pm
by ITCSW » Fri Jun 08, 2012 4:22 am
Hi, course is great fun and really interesting, I just finished it at the end of May, just missed out on a distinction! I'm studying for B67 degree "Computing and IT (Software developer) with Design as a second subject, I'm really enjoying it so far and have completed all my 1st year study, moving on to 2 Java programming courses from September and February which I'm hoping will lead me into programming commercially.

I would recommend TU100 to anyone, it's a really well organised introduction to all things IT, I've been a technician in Business to Business for about 14 years and after an accident left me disabled I thought I would study programming so that I can work from home.......so if anyone has any pointers on how to go about that any advice would be well received.

I'll post some photo's of the sense board some time over the next few days, it attaches to Mac, PC or Linux via a USB cable (which might be the simplest option for connecting to the Pi).
Posts: 12
Joined: Tue May 29, 2012 11:00 am
by RichardUK » Fri Jun 08, 2012 2:12 pm
As it's connected via USB it would be very simple to port the Linux drivers, if the source is available. The beauty with Linux is that USB can be accessed from user space via libusb. So you can 'bake' your driver right into your code. An example of this is adb for Android development. Window users have to go look for drivers for their phones, Linux people just add a udev rule to give the current user access to the libusb file for the device and you're done. adb for Linux has the driver implemented in userspace. :) I wish windows had this functionality for usb. No more DDK then.....

That is great news about the course, I've been a software developer for years and thought it's about time I did my degree. As I have so much experience it may not add to my hire ability, I'm doing it because the modules look really interesting.

I have had a couple of jobs working from home and it is as good as you could ever imagine. But the IT industry is a little slow on the take up of this. A lot of companies I have worked for think that to work as a team you need to be sat in the same room. Well from my experience that is so not true. One big company I would recommend perusing, it can be hard to get in, is Canonical the makers of Ubuntu. 70% of their staff work from home. They tend to hire people who have already contributed to the Linux course. So a first step would be to join the Linux foundation and get onto the Ubuntu forums and start to help out with parts of it that you think you can help with. Once you have a body of work you have done that has been helpful to the community, such as just answering questions on the forums or writing some great apps, you can then approach them throw their job site.
User avatar
Posts: 131
Joined: Fri Jun 01, 2012 5:12 pm
by ITCSW » Fri Jun 08, 2012 3:18 pm
Hi Richard, thanks for your response, I will certainly start to try and contribute to the Linux community if it might give me some standing a bit later on. Like you I've been in the IT industry for years and despite MCP and small business specialist status, I've never had any formal qualifications, so when I was injured I decided it would be best to get my degree and use it to learn programming and try to find an in-road. I've also been looking tentatively at software testing, but I would much prefer to be a programmer.
Posts: 12
Joined: Tue May 29, 2012 11:00 am
by jahanshazi » Tue Jun 26, 2012 6:22 am
thanks very nice.........

Abdul Wali Khan University
Posts: 1
Joined: Thu Jun 21, 2012 12:18 pm
by NeilNjae » Wed Jul 04, 2012 10:02 pm
We're working (slowly) on making the Senseboard-specific libraries available to things other than the Open University's Sense environment, probably via SWIG. We'll announce the libraries when they're done!
Posts: 15
Joined: Tue Apr 03, 2012 9:44 am
by simplesi » Mon Aug 13, 2012 9:08 pm
I'm trying to get Scratch to talk to external devices and this looks very interesting as its been ported for Windows and Linux :)

I know nothing about such things but it'd would be great to get Sense working on a RPi and see if it would be the tool to control external hardware - can someone "convert" it to work on the Rpi- can I do it? (and where would I start??) :)

regards

Simon
Seeking help with Scratch and I/O stuff for Primary age children
http://cymplecy.wordpress.com/ @cymplecy on twitter
Posts: 2053
Joined: Fri Feb 24, 2012 6:19 pm
Location: Euxton, Lancashire, UK
by berry120 » Thu Sep 06, 2012 4:21 pm
The OU haven't released a protocol document for the board, but the squeak source file is available on the OU website, so (while not trivial) it's possible to reverse engineer it to work out how to talk to it over USB.

We've actually been doing this to get the Sense board talking to Greenfoot, and now have a working implementation in Java in the form of a Greenfoot scenario.

It's not 100% stable at the moment (I blame the horrendously buggy RXTX libraries) but if you select the correct COM port in the SenseWorld class, it should fire up. Briefly tested on Windows and Linux, though not on the Pi yet (RXTX fiddling may well be needed as demonstrated here.).

In the process of doing so we also produced a protocol document which describes the protocol in full - it should be useful to anyone wanting to implement another library with the sense board. Once the protocol is known it's really not that hard to implement - pretty simple stuff just sending and receiving groups of bytes over a serial port (over USB.) You can grab it here, but please bear in mind it's not an official OU document, just what we've worked out from reverse engineering the Squeak code (so may contain inaccuracies accordingly.) If anyone does notice anything that's wrong, or has any questions, let me know and I'll try to help!
Posts: 5
Joined: Thu Sep 06, 2012 4:01 pm
by simplesi » Thu Sep 06, 2012 8:55 pm
What might be easier (to start with) is instead of trying to port the OU Linux version to RPi, just use normal Scratch as shipped with the RPi and make a Python buffer program to feed info to/from the SenseBoard.

This is what I use in my simple approach to talking to the GPIO pins - all ( :) ) that is needed is to implement the serial protocol that @berry120 has published above.

regards
Simon

See here for my old ramblings
http://cymplecy.wordpress.com/2012/07/2 ... pberry_pi/
and where I'm up to now
http://cymplecy.wordpress.com/2012/08/2 ... spberrypi/
Seeking help with Scratch and I/O stuff for Primary age children
http://cymplecy.wordpress.com/ @cymplecy on twitter
Posts: 2053
Joined: Fri Feb 24, 2012 6:19 pm
Location: Euxton, Lancashire, UK
by berry120 » Thu Sep 06, 2012 9:39 pm
You could (possibly?) modify the board in theory to talk via GPIO, but that would be much more effort (for no good reason other than perhaps freeing a USB port - even then you can just use a hub) than just using it over USB.

Of course, unless you really want to there's no reason why it has to be Scratch you use to interface with the board; the protocol description attached above could be just as easily implemented in any other language of your choice.
Posts: 5
Joined: Thu Sep 06, 2012 4:01 pm
by simplesi » Thu Sep 06, 2012 9:44 pm
You could (possibly?) modify the board in theory to talk via GPIO, but that would be much more effort (for no good reason other than perhaps freeing a USB port - even then you can just use a hub) than just using it over USB.


I think you've misinterpreted my post - I'm suggesting using same method of using normal Scratch going through a Python handler that talks to the serial using the reverse engineered protocol - not trying to use the GPIO :)

All anyone needs to do is replace my GPIO handling code with serial handling code :)

Simon
Seeking help with Scratch and I/O stuff for Primary age children
http://cymplecy.wordpress.com/ @cymplecy on twitter
Posts: 2053
Joined: Fri Feb 24, 2012 6:19 pm
Location: Euxton, Lancashire, UK
by berry120 » Thu Sep 06, 2012 9:47 pm
Ah, gotcha. Yes, I was wondering what you were planning to do with the board to communicate over GPIO (visions of trying to solder cables to the FT232RL chip and run them to the Pi's inputs!)

That makes much more sense however :-)
Posts: 5
Joined: Thu Sep 06, 2012 4:01 pm
by Heater » Thu Sep 13, 2012 7:38 am
Wow,

That TU100 digital life course is £2500 in Enland, or Finland where I happen to be now. Only £810 for those lucky people in Wales and such.

Has anyone done this course? How was it?

I was glued to the Open University broadcasts on TV in the 70s as a teenager and ever since have pondered taking a course or two for fun. But that is a lot of money.
Posts: 1260
Joined: Tue Jul 17, 2012 3:02 pm
by mawds » Thu Oct 25, 2012 10:10 am
hi

sense is bug ridden and they know it, lecturers also know it yet they will still take your money. Stay clear of sense if you have any.
Posts: 1
Joined: Thu Oct 25, 2012 10:06 am
by specsdude » Thu Dec 27, 2012 10:38 pm
Hi, my friend has the Sense and he says it works great.. I may be buying it off him soon to use with my Raspberry Pi, which is exciting :D

Has anyone actually got their Pi and Sense talking?

Thanks for any info!

Dave
Arise! Arise, riders of Théoden! Spears shall be shaken, shields shall be splintered - a sword day, a red day, ere the sun rises! Ride now! Ride now! Ride! Ride to ruin, and the world's ending! Forth Éorlingas!
Posts: 52
Joined: Sat Jan 21, 2012 2:15 pm
Location: In a small English village, far from the eyes of Mordor
by spetty » Tue Jan 08, 2013 9:22 pm
Heater:
That TU100 digital life course is £2500 in Enland


I did the TU100 last year in England for £770. It was the last year before the rates were jacked up to £2500 (thank you Mr Cameron). There is absolutely no way I would/could have done it at the current price and feel lucky to have got into university studying at the old rate by the skin of my teeth. I wonder how many others out there now feel priced out of studying, settling instead for a life of unskilled work...

We now have to rely on charity projects such as the rpi to make learning affordable in a developed country such as ours. This strikes me as a very sad state of affairs.
Posts: 1
Joined: Tue Jan 08, 2013 9:11 pm
by deaf-lama » Wed Feb 20, 2013 5:59 pm
I have mu OU SenseBoard working on the RPi and running it with Sense programs.

It is fully explained how to set it up on the OU labspace website with a little Sense program that makes all the LEDs flick on and off.

http://labspace.open.ac.uk/mod/ouconten ... &section=2

Saves you needing another sensor board as it has temperature, sound, a slider, a stepping motor a switch and an infra red LED that can all be programmed using Sense.
Posts: 5
Joined: Wed Jul 25, 2012 3:22 pm
by puthi » Thu Jul 18, 2013 10:50 pm
Last edited by puthi on Wed Oct 30, 2013 1:59 pm, edited 5 times in total.
Posts: 1
Joined: Thu Jul 18, 2013 10:49 pm
by berry120 » Fri Jul 19, 2013 12:13 am
mawds wrote:hi

sense is bug ridden and they know it, lecturers also know it yet they will still take your money. Stay clear of sense if you have any.


The software may be - I honestly haven't tested it thoroughly, I spent the vast majority of the time looking at the source code! On the hardware side however, using the protocol document and sending raw bytes it appeared pretty stable to me - the only bug I found was to do with the stepper motor moving more than 128 steps, but there are workarounds to this (you have to group the steps in multiples of 128 and send them a couple of seconds apart until you're done.) That's a relatively easy workaround to produce in a library by doing some concurrent stuff in the background that the user doesn't need to know about.
Posts: 5
Joined: Thu Sep 06, 2012 4:01 pm
by losojos » Tue Aug 27, 2013 8:49 pm
Hi all,

I don't know how you all got on with getting your R-Pis and SenseBoards to talk, but I've just written a post about my foray in to it on my website, plus a bit of code showing how it's done.

If anyone is interested, the post is here: http://www.joshjohnson.edutechhosting.c ... lk-python/

BTW, berry120 your article was extremely helpful!
Posts: 2
Joined: Tue Dec 06, 2011 9:26 am
by berry120 » Tue Aug 27, 2013 9:47 pm
Glad the article was useful for you! Sorry about the link - I'll get that fixed ASAP.

I too took stumbled across various other baud rates and settings in the code that didn't work - but yes, it appears there's at least partially complete code there for another similar board that operates with a different protocol, and distinguishing the two from each other was at times rather tricky!

You mention the fact that you had to send the bytes individually rather than as an array - I must admit this wasn't the case with Java and RXTX, and I suspect you're probably hitting cases where the buffer isn't being fully flushed rather than an array and individual bytes being handled differently (I could be completely wrong there though, my knowledge of Python is rather limited so it could just be handling the byte stream in a way that I'm not used to.)

Either way, glad it was useful and that you've managed to get something up and running with it - good work!
Posts: 5
Joined: Thu Sep 06, 2012 4:01 pm