Evolution of a Blog

This blog has evolved as you can tell by comparing the title with most of my recent posts. The title should really be something like "The Physical Interface Side of Computing". It will still feature Raspberry Pi and Arduino from time to time but my current hardware of choice is a BeagleBone Black with JavaScript and Node.js providing the development environment.

Monday, August 25, 2014

Meltdown!

Printer stopped working and on a little examination this is what I found.  Not sure yet what happened but replacing the RAMPS with new connectors has the printer back and happy.


Sunday, July 27, 2014

Building 'The App' on Arch


Downloaded and install image for Arch: http://archlinuxarm.org/platforms/armv7/ti/beaglebone-black

pacman -Syu
 
 
Timeouts for pacman?
Edit /etc/pacman.d/mirrorlist
Comment out first entry, uncomment Germany 
 
for lcd: 
pacman -S linux-am33x-legacy
 
 
pacman -S lxde xorg-server xorg-server-utils xorg-xinit xorg xorg-twm xterm unzip


Create in /etc/X11/xorg.conf.d/10-screen.conf

Section "Module"
Load "extmod"
Load "dbe"
Load "glx"
Load "freetype"
Load "type1"
Load "record"
Load "dri"
EndSection

Section "Monitor"
Identifier "Builtin Default Monitor"
EndSection

Section "Device"
Identifier "Builtin Default fbdev Device 0"
Driver "fbdev"
EndSection

Section "Screen"
Identifier "Builtin Default fbdev Screen 0"
Device "Builtin Default fbdev Device 0"
Monitor "Builtin Default Monitor"
EndSection

Section "ServerLayout"
Identifier "Builtin Default Layout"
Screen "Builtin Default fbdev Screen 0"
EndSection
Create in /etc/X11/xorg.conf
Section "Device"
   Identifier     "Frame Buffer"
    Driver         "fbdev" 
EndSection

pacman -S midori minicom curl xscreensaver automake autoconf intltool gcc make
 
nano ~/.xinitrc
exec startlxde

pacman -S python2 python2-virtualenv git git-core sudo xdotool
 
  
virtualenv2 env 
source env/bin/activate

get code for node v0.8.26
edit common.gypi
    'armv7%':'1',
    'arm_neon%':'1',

./configure
make
make install


useradd -m -g users -G audio,lp,video,games -s /bin/bash quadmax
passwd quadmax 



visudo
(or nano /etc/sudoers)  
##
## User privilege specification
##
root ALL=(ALL) ALL
quadmax quadmax=/usr/bin/halt,/usr/bin/poweroff,/usr/bin/reboot,/usr/bin/date   

nano ~/.xinitrcexec 
startlxde
mkdir QUADMAX
cd QUADMAX
 


git clone https://github.com/ThamesWill/QUADMAX.git dev


dev/install

sudo usermod -a -G uucp quadmax

In file:
.config/pcmanfm/LXDE/pcmanfm.conf
Update:
wallpaper=/home/quadmax/QUADMAX/screensaver/QUADMAX.jpg

nano /etc/hostname
quadmax
 
nano /etc/hosts
127.0.0.1   quadmax




Implicitly done by the git clone
npm install node-gyp socket.io descriptive-statistics exec-sync zipstream line-by-line serialport

Prepare the EMMC drive 
umount /dev/mmcblk1p1
umount /dev/mmcblk1p1
delete the above
add one from 1 to end of eemc
parted nano /etc/fstab
/dev/mmcblk1p1    /media       ext2  defaults                   0  2

 mkfs.ext2 /dev/mmcblk1p1

mount -a - to test
dd if=/dev/zero of=/media/swap bs=1024 count=524208
mkswap /media/swap
swapon /media/swap
free
autologin 
 
https://wiki.archlinux.org/index.php/Automatic_login_to_virtual_console  
 
Add to /etc/profile: 
# If we are on the console we startx 
clear
[[ -z $DISPLAY && $XDG_VTNR -eq 1 ]] && exec startx > startx.log
/etc/xdg/lxsession/LXDE/autostart

sudo nano /etc/xdg/lxsession/LXDE/autostart:
add
@/home/quadmax/.quadmax

Setup Desktop and Screen Save from the Desktop

git clone https://github.com/ajaxorg/cloud9.git cloud9


cd cloud9
npm install
 
create start
cd /home/quadmax/cloud9
bin/cloud9.sh -l 0.0.0.0 -w /home/quadmax/QUADMAX/dev

Autostart in LXDE:
nano   /etc/xdg/lxsession/LXDE/autostart
@/home/quadmax/cloud9/start



adhoc
pacman -S  hostapd
/etc/hostapd/hostapd.conf
ssid=QUADMAX
wpa_passphrase=thechair
interface=wlan0
channel=7
driver=nl80211
hw_mode=g
logger_stdout=-1
logger_stdout_level=2
max_num_sta=5
rsn_pairwise=CCMP
wpa=2
wpa_key_mgmt=WPA-PSK
wpa_pairwise=TKIP CCMP
In .quadmax:
sudo -S sudo hostapd -B /etc/hostapd/hostapd.conf < /home/quadmax/sudo.driver >> ~/QUADMAX/startup.log
sudo -S ifconfig wlan0 192.168.1.1 netmask 255.255.255.0 broadcast 192.168.1.255 < /home/quadmax/sudo.driver >> ~/QUADMAX/startup.log
set manual ip address on client to 192.168.1.x with gateway 192.168.1.1
 
+====================
 
pacman -S iw wireless_tools  
 
added to /etc/profile 
 timedatectl set-timezone Europe/London
 
git clone http://github.com/tias/xinput_calibrator xinput_calibrator
 
pacman -S libtool gettext pkg-config autoconf
run as Python2
 
./autogen.sh --with-gui=x11   ??
make
sudo make install
 
 

Tuesday, July 15, 2014

Heat and Gas Monitor / Switch

This device was originally designed to monitor a 3D printer for temperature or gas (e.g. smoke) above a certain threshold at which point the printer would be powered down.   The circuit consists of an Arduino Nano connected to a temperature sensor and a gas sensor.   Two LEDs and a buzzer provide feedback.  The circuit drives a relay that can close the PS_ON circuit of an ATX type power supply (or a relay that is part of the power supply circuit for the printer).

There are two different boards with one being 50x50mm that would have the relay mounted off the board as shown in the picture to the right.   The two sensors are also mounted off the board as is the buzzer (upper right of photo).

The other board configuration is 50x100mm and has room for the relay on the PCB.  The relay could be part of a power supply circuit (DC or even AC) but the PCB is really designed to be part of an PS_ON circuit of an ATX power supply as it has an bypass switch that can be used to close that circuit.

Both of the boards are available in a kit form as there are a wide variety of ways that they could be mounted and as many ways to connect the board to sensors.

The PCB also has a connection point for the serial port of the Arduino for diagnostic information output by the sketch that drives the monitor.

As stated above, the monitor was designed for a 3D Printer but it could be used to monitor just about anything for heat and gas where a relay needs to be triggered.  I used the MQ-2 sensor looking for smoke but other MQ sensors could be used for other gas types.

Below is a documentation index for the Heat and Gas Monitor / Switch PCB:

Part 1 - Introduction
Part 2 - Hardware Configuration Options
Part 3 - Operation
Part 4 - Software Configuration
Part 5 - Assembly

Monday, July 14, 2014

3D Printer (RepRap) Monitor - Part 5 - Assembly

Choosing the Right Board

The larger board allows for a relay to be mounted on the board itself.   This is the configuration that works best for a power supply, such as an ATX, that has a "PS_ON" (or switch on) circuit.   The larger board could also be used for a single relay, of sufficient amperage, that provides power via a single bus.   However, DO NOT wire the "PS_ON" connection on the PCB to anything but a PS_ON circuit!

Choosing the Mounting Location

Two examples of mounting are shown here though others are certainly possible.  The major question will be one of where the two sensors need to be located relative to where the PCB can be mounted.   If the PCB can be mounted where the sensors need to be located then the sensors can be surface mounted on the PCB.   If not then leads will be required to connect the sensors to the PCB.   Likewise the monitors LEDs, reset, and bypass switch can all be surface mounted on the PCB or run remotely depending on placement of the PCB.

Surface Mount or Headers

Two strips of breakable headers can be used to provide mounts for most of the components and connection points on the PCB.   This can allow for easy removal of the Arduino Nano as one example. 

Extensibility

There are solder points on the PCB that expose a number of available pins (including power) on the Arduino Nano.   These could be used for a variety of purposes such as connecting additional sensors and/or relays. 

Assembly

Actual assembly is straightforward.   Either solder the components (or leads) to the board in the places marked or solder on the appropriate headers!  Header strips can be easy broken into the proper lengths using a small wire cutter positioned on top of the pin where a cut needs to be made.  A pin is lost with each cut.  Edges can be sanded to make a smooth end to the header.

Polarity and/or Pin Positioning

The short lead on the LED is the ground.   The PCB shows how the Nano should be mounted as it does for all of the components and connections.  The reset button should be mounted as shown by the picture to the right.

The larger PCB provides a place where a relay can be mounted.   Small cable ties are provided for this purpose.   The larger PCB also allows for a bypass switch that mechanically closes the "PS_ON" circuit assuming that circuit is connected to the PCB.   Do NOT connect anything but a PS_ON circuit to the PCB.

Documentation Index

Below is a documentation index for the Heat and Gas Monitor / Switch PCB:

Part 1 - Introduction
Part 2 - Hardware Configuration Options
Part 3 - Operation
Part 4 - Software Configuration
Part 5 - Assembly


Friday, July 11, 2014

3D Printer (RepRap) Monitor - Buy One


An assumption is made that the buyer of this product is familiar with their RepRap printer, has a solid level of electronics knowledge, an ability to do fairly detailed soldering, and is also familiar with the programming and use of Arduino micro processors!   This is a build it yourself kit running open source software and sold as-is.

Available Configurations


Price includes shipping to destinations within the UK.  Shipping outside of the UK will entail an additional charge.

Kits do not include a relay as this is an implementation specific item.  Nor are wires included as part of the kit option.   See the below pictures for details of what is included in each kit.

Shipments will be made during the first week of August.

Software for the monitor is available on GitHub.   The Nano shipped with the kit is bare of any sketch.   They buyer must configure the sketch for their specific environment and then download it to the Nano on the RepRap Monitor.

DISCLAIMER

This product is sold AS-IS with the assumption that the buyer will properly assemble the device, configure and load the appropriate software sketch, and will then assume responsibility for its operation.  If on receipt of the product the buyer is not comfortable with the "as-is" nature of their purchase they can return the product (at their cost for shipping) for a full refund.

The seller will NOT be responsible for prints terminated by the monitor triggering as the result of bad parameter input or any other malfunction of the monitor.   Likewise the seller will NOT be responsible for the monitor missing a shutdown circumstance that results in damage whether due to bad parameter input or any other malfunction of the monitor.

In no event shall the seller be liable for any direct, indirect, putative, incidental, special consequential damages, to property or life, whatsoever arising out of or connected with the use or misuse of this product.
In no event shall our company be liable for any direct, indirect, punitive, incidental, special consequential damages, to property or life, whatsoever arising out of or connected with the use or misuse of our products." - See more at: http://injury.findlaw.com/product-liability/are-product-liability-disclaimers-effective.html#sthash.AY18do9v.dpuf

In no event shall our company be liable for any direct, indirect, punitive, incidental, special consequential damages, to property or life, whatsoever arising out of or connected with the use or misuse of our products." - See more at: http://injury.findlaw.com/product-liability/are-product-liability-disclaimers-effective.html#sthash.AY18do9v.dpuf

Large PCB Kit Contents
Small PCB Kit Contents
The micro controller is a "Nano V3.0 Controller Board Compatible with Arduino Nano CH340 USB Driver" sourced from China.   The other electronic components are also sourced from China though everything will be shipped from the UK.  Headers are provided in two 40 pin strips that can be cut to size for components that you wish mount on a header rather than on the surface of the PCB.