Showing posts with label GPIO. Show all posts
Showing posts with label GPIO. Show all posts

2018/10/25

How to make 20 Easy Pies

Well actually "20 Easy Raspberry Pi Projects" is a book from Nostarch Press and takes the user through a variety of projects that can be built around the Raspberry Pi.

  • Table of contents
  • Introduction
  • Primer

  • LEDs
  • Project 1: Blinking an LED
  • Project 2: Pushbutton LED Flashlight
  • Project 3: LED Dimmer Switch
  • Project 4: A Graphical User Interface for a Multicolor LED
  • Project 5: Rainbow Light Strip

  • Displays
  • Project 6: An LCD Reminder
  • Project 7: Mini Weather Forecaster
  • Project 8: Pong with a Sense Hat

  • Sensors
  • Project 9: All-In-One Weather Sensor Station
  • Project 10: Intruder Alarm with Email Notifications
  • Project 11: Gas and Smoke Alarm
  • Project 12: Temperature and Humidity Data Logger

  • Cameras
  • Project 13: Burglar Detector with Photo Capture
  • Project 14: Home Surveillance Camera

  • Web Applications
  • Project 15: Building Your First Website
  • Project 16: Connecting Your Electronics to the Web
  • Project 17: Internet of Things Control Center with Node-Red

  • Games and Toys
  • Project 18: Digital Drum Set
  • Project 19: Make a Game in Scratch: Hungry Monkey
  • Project 20: Wi-Fi Remote-Controlled Robot

  • Appendix A: Raspberry Pi GPIO Pin Guide
  • Appendix B: Decoding Resistor Values

All the projects are built using the Pi, some external hardware and then programming the Pi using Python or Node Red.

You don't really need to fully understand programming and in-depth Python to get the most out of the projects, the book goes through the code and explains what the various code segments do.

Node Red is more complex and also simpler as it runs on the Pi and is accessed via a web browser and then the various actions are all performed by wiring bits together. All the actual programming is done behind the scenes. Some libraries and other bits and bobs have to be installed to support various bits of hardware, but the book goes into enough details of how to do it.

Each chapter ends with some tasks that the user can extend the project and though the basic knowledge of programming in the chapter should give these enough of a background to modify/extend the code, to really extend it, it;'s probably learning Python more fully.

All in all if you want to hook a Raspberry Pi up to some hardware, access the hardware through Python (or Node Red), then this book is no doubt a good starting point. However it is just that a starting point and doing more complex things with both the hardware and Python in particular will require more in0-depth knowledge and a more in-depth programming knowledge.

Saying all that, it's a great start and easy to follow and even with a basic knowledge of Python (just basing code on examples from the book) it should be possible to build all the projects and extend most of them without too much fuss.

2015/12/22

Intel Edison, jack of all trades, but maybe master of none

The Intel Edison is a small system-on-chip (SoC) that measures about 35.5 × 25.0 × 3.9 mm (on its carrier PCB) which has a connector on it allowing it to be plugged into other things (it is possible to get the SoC on just the PCB without the edge connector).

The SoC board can then be plugged on to various boards from Intel, one is a breakout board which exposes various pins and has some USB sockets, there's also an Arduino compatible PCB allowing Arduino shields to be used.

The Edison tries to be everything to everyone, but doesn't always succeed. It actually has two processors inside, a dual thread dual core Atom running at 500MHz and a Quark 32 bit micro-controller running at 100MHz. The Atom runs Yocto Linux and the Quark a Real-time Operating System (RTOS).

It has 1GB of RAM and 4GB of Flash, 802.11 a/b/g/n WiFi and Bluetooth 4.0

There's a total of 40 I/O pins that can be configured to be: -

  • SD card - 1 interface
  • UART - 2 controllers, 1 with full flow control
  • I2C - 2 controllers
  • SPI - 1 controller with 2 chip selects
  • I2S - 1 controller
  • GPIO - 12 with 4 capable of PWM
  • USB 2.0 - 1 OTG controller
  • Clock output - 32 kHz, 19.2 MHz

Intel provide multiple ways of programming the system: -

  • Arduino IDE (v1.6+, no longer requires an Intel specific build)
  • Eclipse supporting: C, C++, and Python
  • Intel XDK supporting: Node.JS and HTML5

There are other environments that also support Edison (in Arduino or direct mode) such as the node.js Johnny-Five system. Node-red can also be installed directly on the Edison and accessed through its web server. Google's Brillo is also an option now.

Running Linux does have benefits if you're into Linux environments as there's lots of packages that can be downloaded for it or indeed built as required.

You'll either love or hate Intel's development environment (XDK).

Integrating Edison into your own projects does give you a lot of flexibility, though the power requirements aren't as low as some other Arduino types (but by the time shields have been added to give the same functionality, power requirements increase with them). In theory it is possible to put the Atom to sleep and have the Quark micro controller do background non CPU intensive tasks and then it can wake the Atom up to do some hard processing or data transfers through WiFi say, but it's not meant to be 'easy' to actually implement.

The basic Edison (just the board) is around £42, on the small breakout board it's about £72 and on the Arduino base it's £96 though on-line pricing varies.

Overall the Edison really does tries to be everything to everyone and it's a pretty powerful computer (well 2), but it may be too generic for lots of things and the variety of programming modes etc can be confusing.