Monday, December 18, 2017

How to setup a Raspberry Pi SenseHat...

You know you're in-between semesters when you just want to catch up on writing how-to tutorials.  Here's one for my new favorite toy:  The Raspberry Pi "SenseHat".

The SenseHat is an add-on to the main Pi that includes an LED matrix, a mini-joystick, and six different sensors - all programmable.  They are:

  • Gyroscope
  • Accelerometer
  • Magnetometer
  • Temperature
  • Humidity
  • Barometric Pressure

You can get it from Amazon for $49.99 or from for $34.99 (plus $9.95 for shipping).

It was even used on the International Space Station last year.

Easy steps for connecting the SenseHat to the Pi:

1.  Unplug the Pi and take it out of its case if it's in one.

2.  Push four of the screws up through the bottom of the Pi.  Connect them above-board with the black cylinders.

3.  Connect the black pin base to the Pi's pins.  Make sure they're lined up well before pushing down, but once they are, push down all the way.

4.  Connect the SenseHat to the new pins.

5.  Screw in the remaining screws to anchor the SenseHat to the Pi.  Your Pi now looks like a double-decker device.  When you plug the Pi back in, the SenseHat will light up in a rainbow pattern if it's installed correctly.  And you're done.

Now to actually start using it:

1.  Make sure the Python library you'll need is installed (and install it if not).  At the Pi's terminal window, type:

sudo apt-get install sense_hat

2.  From the Raspbian Start button on the Desktop, click "Programming" --> "Python 3 (IDLE) --> In the window that opens, click "File" --> "New File" --> and type the following code:
from sense_hat import SenseHat
sense = SenseHat()
sense.show_message("Hello World!")

3.  Save the file, then from the top menu click "Run" --> "Run Module".  Quickly take a look at the Pi/SenseHat at you should see the text scroll across the LED screen like this:

Now you're completely set up and ready to program anything you want.  The API Reference can be found here.  Some starter ideas I plan on exploring using the sensors include programming a compass, a backyard weather station, an actual joystick for PyGame, and a motion-activated alarm system.  I also plan on creating a new GitHub page to share with you some of these scripts that I'm going to write soon.  Play!



At 2:54 AM, Blogger vinothika said...

These blog is conveys a useful information to viewers. I like your article is nice.

Python Training in Chennai

At 5:53 AM, Blogger Nicole Bolton said...

It’s the best time to make some plans for the future and it is time to be happy. I’ve read this post and if I could I want to suggest you few interesting things or suggestions.You can write next articles referring to this article. I desire to read even more things about it..
RFID Solutions
Sports Analytic Software
Logistic ERP
Athletic Management Software

At 8:20 AM, Blogger Edmund said...

Really Good blog post.provided a helpful information.I hope that you will post more updates like this.

Vehicle tracking system
Fleet management software

At 1:34 AM, Blogger Digital Marketing said...

hello sir,
thanks for giving that type of marketing company in delhi

At 3:06 AM, Blogger akash thakur said...

Laminated Doors manufacturer in hubli

At 1:38 AM, Blogger Digital Marketing said...

nice topic which you have choose.
second is, the information which you have provided is better then other blog.
so nice work keep it up. And thanks for sharing.
outdoor led wall lights in delhi

At 3:59 AM, Blogger مروة محمد said...

شركة عزل اسطح بخميس مشيط

At 3:46 PM, Blogger رجب البرنس said...

بسم الله الرحمن الرحيم نحن فى شركة الكمال تقوم بافضل انواع التنظيف العام وتنظيف الفلل بافضل

انواع العالميه التى تحافظ على السيراميك
شركة تنظيف منازل بحائل
شركة تنظيف بالطائف
شركة تنظيف بجازان
شركة تنظيف بحائل
شركة تنظيف مجالس وكنب بحائل
ونحن فى خدماتكم اربعه وعشرون ساعه وكل هذا بافضل الاسعار واقل التكلفة

At 2:28 AM, Anonymous Cara Mengobati Ablesio Retina Tanpa Operasi said...

Nice Article ;)

Pengobatan Efektif Atasi Masitis
Pengobatan Infeksi Kulit Selulitis
Cara Mengobati Sistitis Sampai Tuntas
Cara Alami Mengobati Radang Rahim
Pengobatan Atasi Aritmia
Pengobatan Untuk Mengatasi Infeksi Rahim

At 5:26 AM, Blogger John Grace said...

Bitcoin bulls are optimistic again and for good reason we have seen the price trading around $10k support level strongly, Nevertheless, for some days bitcoin has been moving in a close range between $9,800 and $10,200 area and If bulls are able to push the Bitcoin price above this resistance level in the near-term, it will likely ignite an upwards movement that would send it straight towards $11k – $12k level. Well bitcoin has been one of my source of income and it’s been successful because i was smart enough to find the right strategy/daily signals to trade with ever since the last bear market, alex has been providing me with his daily signals and also guidance to trade, again i was able to grow my 1.5btc to 8btc within three weeks of trading with Alex daily signals, i must say no time is ever too late to buy and start trading. Alex can be reach via E-mail:
  WhatsApp: +1(929)390-8581 for inquiries into profitable trading systems.  


Post a Comment

<< Home