Thursday, June 23, 2016

The barest fundementals

This post is written to be a pre-introduction to Arduino for an absolute novice (i.e. someone without a background in computer science, engineering, or calculus based physics).  We will discus the simplest electrical concepts that will be expanded upon as future lessons progress.

The water in pipes analogy

Imagine a water tower with a water wheel at the base, piping between the tank and the water wheel, and a valve to allow or stop flow.

Let's start by saying the valve is closed.

In physics, the water in the tower is said to possess 'potential energy.'  The water isn't doing anything; it is just sitting there.  But it is up high, and because of gravity it has the potential to be used below to turn the water wheel.


Now suppose we open the valve.

When the valve is opened, the speed of the water coming down the pipe will depend on the height of the tower and the water level in the tank, as well as whether the valve is fully open or only part way.

The speed of the water flow will influence how fast the water wheel turns, and correspondingly, how much energy can be extracted from it (if, for instance it were connected to a generator, or a device used for grinding grain, or whatever one uses a water wheel for).  

Here we have already touched on the fundamentals necessary to talk about electricity.
  • Voltage is a measure of electrical potential, similar to the height of the water level.
  • Current is a measure of how much electricity is flowing, similar to the rate of water flow through the pipe.
  • Resistance is a measure of how much the wires and electrical components slow down the electrical flow (current) similar to the way the valve passes more or less water based on how open it is.

Circuits


A circuit is a loop.  Outside of the field of electronics, a race car might be said to be completing a circuit as it goes around a loop-shaped track. When talking about electrical systems, the term circuit is used to describe the path the electricity travels on when moving from a location with higher potential (voltage) to one of lower potential, and a simple diagram will show that that path is also a loop.


The circuit diagram above is for a flashlight.  A legend for the icons is bellow. 

Switch


Resistance
Light Bulb
Battery

The lines connecting the icons are the flashlight's wiring. 


Current flows on the wiring out of the positive side of the battery (marked "+"), through the switch (when the switch is closed), and through the light bulb to the negative side of the battery (marked "-").  So altogether it forms a loop or circuit.


Although in the diagram the resistance is marked as a single icon, in real life there is resistance all along the wire, inside the battery, in the switch and in the light bulb.  The resistance is marked as a single icon because it makes analysis of the circuit easier; if you want to know why, ask how in the comments, but it requires a bit of explanation that I didn't intend to get into here.

Bringing it all together

The concept of a circuit diverges from the water in pipes analogy a bit: In the water tower example, the water could just dump out on the ground after hitting the water wheel, and maybe it would run into a river or wherever.  A loop could be formed by having a collecting pool and a pump that charges water back to the tower, perhaps, but that does nothing to illustrate a fundamental difference between water and electricity: If a circuit is not connected by wire or some other current carrying material (light bulb filament, or the material from which the switch is made) the break is equivalent to an opened switch: current won't flow.  In terms of water flowing through pipes, if a pipe is severed, water will blow everywhere until a valve is closed stopping flow into the pipe upstream. 

In physical terms, a disconnected circuit experiences infinite resistance to (electrical current) flow, whereas a severed pipe presents zero resistance to (water) flow.  The implication of this is that when we are working with electricity, for anything to happen the current will need a way in (a path from high potential), and a way out (a path to low potential)


 





Thursday, June 9, 2016

How to make Retropie work

This post is for visitors to my family's VRBO house.

In the downstairs bedroom I've provided a RetroPie, a Raspberry Pi micro-computer configured to emulate Nintendo Entertainment System and Super Nintendo for playing each respective systems' video games.


The RetroPie is fairly straightforward to use, but these instruction may help if any problems are encountered.
  • Turn on the TV, tuned to video input and plug in the micro USB cable.
    • If nothing happens, unplug and try again, as sometimes it doesn't take on the first power up.
    • When plugged in you can see a couple LEDs shining through the vent on the side.  When it is working right the red will be illuminated, as well as the green; when it isn't working the red will be on but not green.
  • If things are going correctly, a screen with four raspberries will be displayed, followed by some computer script, a 'Retropie' splash screen, a bit more script, an 'Emmulation Station' splash screen, and finally the main interface.
    • On rare occasions a guest may be prompted to configure the controller.  Follow on-screen prompts to configure the buttons.  The 'L' and 'R' shoulder buttons should be configured to the 'bottom L' and 'bottom R' buttons, respectively.  Buttons not found on the controller can be skipped by holding down any button for a few seconds.
  • On the main interface you can use either USB controller to select Nintendo Entertainment System or Super Nintendo by pressing left or right on the controller 'D' pad, and pushing the 'A' button. You will find long lists of games you can try.  
  • If you get tired of one game while playing you can press 'start' and 'select' at the same time to exit from that game.
  • The other options probably won't be of much interest to a casual user, but if you find something you like please leave me a comment, as I haven't spent a lot of time exploring the games and such that come with the default RetroPie distribution.  I think there is Doom and Minecraft, but I haven't spent any time on them.
All Super Nintendo and Nintendo Entertainment System ROMs are legal copies of games from my collection, procured between ~1987-2005.

Fully configured devices are available for purchase on my ebay store (link), but the micro SD card that comes with it will necessarily not contain the game ROMs (we aim to avoid unlawful distribution of those files).   If the micro SD card goes missing during your stay a $20.00 replacement fee will be assessed from the credit card that was used to make the deposit for the house.  If the entire system is removed the replacement fee is $100.00.

Incidentally, this system is capable of playing games from systems as powerful as the original Playstation.  A more powerful version capable of emulating Nintendo 64 titles will be made available when the Raspberry Pi 3 becomes more available.