Gallery

A stiff Englishman

20130508-183527.jpg

Movement

This is work in progress. One of these days I will get around to finishing this and add a clock face.

Hannah the rat

Hannah_3 Hannah_2 Hannah_1

 

Sleeping Dog

Popelige Kiste (Bogey Box)

Foto

Popel is the German word for bogey. The only way to open the box is to exercise all of your your willpower and poke a pinky in the correct, hairy nostril.

Kletterlampe

Going up, going up, going up, up, up

kletterlampe

Popup iBox

Top drawer

Bottom drawer

Phun with Photoshop

Xmas_2010

Three men in a boat

I haven’t tried it in our local pond yet. This is work in progress.

TXT ME

TXT ME

TXT ME receives SMS messages and displays them, one letter at a time, by raising arms with letters on the end. Our world is getting faster and faster, so this deliberately takes its time and slowly “reads out” your message. You have to concentrate or you will miss a letter. You will find it hard to avoid trying to guess what a word will be when only a few letters have been revealed. Patience is required, it will not be rushed. If no one sends any messages, after a while it reads out TEXT ME as an invitation.

IMG_3160

IMG_3159

IMG_3157


How does it work?

There is an Arduino Uno in the box, with a GSM shield. Most of the software was taken from the Arduino examples.


How was it made?

P1080292

I drew the parts in Inkscape and went to the Fablab to cut 5 mm perspex using their 40 Watt Epilog Zing 6030 laser cutter.

IMG_3073

IMG_3074


What was difficult?

IMG_3275The servomotors were challenging. A 5 Euro servo with plastic gearing from Conrad liked to vibrate incredibly violently when the arm was connected to it and I tried to move it. A 20 Euro servo was stable but did not cover the range of angles that I needed. A 10 Euro servo was stable, but … over the course of a busy evening, the servo motor’s precision varied, so that it started missing the “A” arm completely. On the following morning, it was back to normal. I guess that even more money is required to get a servo which has the required precision, or maybe some external sensors could offer regular auto-calibration.

The Arduino was very sensitive to my soldering iron switching on and off as the iron controls its temperature. As I couldn’t do too much about that, once I had understood what was happening, I added a heartbeat LED which flashes for each pass through the main loop, to give me confidence that the Arduino was still running and not hung up, causing me to look for non-existent faults.


Showing it – What’s the response?

IMG_3206

IMG_3215

From the fantastic Instructables web site

Instructables_3_Sept

stnfre001
It would be really cool to add a LED light to each letter, so that it lights up, when that letter is displayed.

KronoNaut
I adore this project.

askjerry
I tried to play the video… but it says “Error playing video, video could not be displayed.” Perhaps you can upload it to YouTube and post a link.

crispernakisan
This is pretty sweet. I like the design on the letters themselves, for sure. Yes, please do add a video… but with a short text for those of us with short attention spans. speaking of short attention spans, I’d probably need to add a “replay previous text” button.

crispernakisan
Oh… there is a video!

rimar2000
Very interesting. Maybe a video…

TheB1
Very creative. Though I can’t imagine what will happen the first time someone decides to text and drive with this device.

MsSweetSatisfaction
Definitely a different take on texting than anything else I’ve ever seen. Nice job, and thanks for sharing!


From Facebook

https://www.facebook.com/instructables
176 people like this.

Brandon Sims
Maybe a laser on the arm to illuminate the letter when it pops up.

Fernando Contreras
que hace

Corinne Whittington
COOL

Anthony Borrie
Cool

Put Likes First

We ought to try this stuffs

Crusieth Maximuss Whoa…

John Smith
Neat


On the first day

Hi englishman_in_berlin!
Congratulations, your Step by Step Instructable “TXT ME” was just featured by one of our editors! Look for it in the Technology category. Being featured means we think you are awesome. Keep up the great work!

Hello englishman_in_berlin!
Your Step by Step Instructable “TXT ME” just became popular on Instructables!
Being popular means that tons of people are checking out your Step by Step Instructable and telling us they really like it. Keep up the great work!

Congratulations englishman_in_berlin!
“TXT ME” has been featured to the Instructables homepage! Being featured by our editors means your Instructable stands out and represents one of the best we have.
Projects like yours make Instructables a great place, and we really appreciate your time and effort. As a thank you, we’d like to give you a 3 Month Pro Membership to Instructables.

Thanks for being part of our community!

Instructables Team @ Autodesk | http://www.instructables.com/


Credits


How would I have done this without ?


Source code


Sorry, the spaces get zapped so this is a bit of a mess.
/*
TEXT ME

This sketch, relying on the Arduino GSM shield, waits for an SMS
message and displays it through the serial port and on Kim's
TEXT ME machine.

Some code from Javier Zorzano / TD
http://arduino.cc/en/Tutorial/GSMExamplesReceiveSMS

*/
/******************************************************************************************
* T H E C I R C U I T
*
* An external power supply is mandatory, otherwise the GSM unit doesn't work
*
* The GSM shield is plugged onto an Arduino Uno
* There are two servos both connected to GND and +5V
* The rotary servo control line goes to pin 5
* The vertical servo control line goes to pin 10
* The ready LED goes to pin 11 via a 200 ohm resistor
* The cathode of the ready LED goes to GND
*
******************************************************************************************/
#include // Include the GSM library
#include // Include the servo library

#define PINNUMBER "XXXX" // PIN number for the GSM SIM card - replace XXXX with actual value
#define rotaryPin 5 // Connect pin 5 to the rotary servo do not use 9 -unstable
#define verticalPin 10 // Connect pin 10 to the vertical servo
#define readyLed 11 // Connect pin 11 to LED which shows that GSM unit is connected

GSM gsmAccess; // Initialise the library instances
GSM_SMS sms;
char senderNumber[20]; // Array to hold the number that an SMS is retrieved from
Servo rotaryServo; // Create servo object to control rotary servo
Servo verticalServo; // Create servo object to control vertical servo

// This is where the "calibrated" values are entered so that the rotary servo moves to the right place to find the letter concerned

int rotation [] = {
161, 154, 148, 142, 136, 130, 124, 118, 112, 105, 99, 92, 85, 78, 72, 66, 60, 54, 48, 42, 36, 30, 24, 19, 12, 7};

int numberOfLetters = 26;
int currentServoPosition;
int newServoPosition;
int up = 170; // Two extremes of vertical servo
int down = 117;
int inactivityTimer = 0;

/**************************************************************************************
* Set up
**************************************************************************************/
void setup()
{
Serial.begin (9600); // Initialise serial communication at 9600
rotaryServo.attach (rotaryPin); // Attach the rotary servo
verticalServo.attach (verticalPin); // Attach the finger servo

boolean notConnected = true; // GSM connection state
parkArm(); // Move to a safe space if not there already
prompt();
parkArm(); // Move to a safe space

while (notConnected) // Wait until GSM connection is established
{
digitalWrite(readyLed, LOW); // Turn the ready LED off

if (gsmAccess.begin (PINNUMBER) == GSM_READY)
notConnected = false;
else
{
Serial.println ("Not connected");
delay (1000);
}
}

Serial.println ("GSM initialized"); // Confidence building message
Serial.println ("Waiting for messages");
digitalWrite(readyLed, HIGH); // Turn the ready LED on
}

/**************************************************************************************
* Main loop
**************************************************************************************/
void loop()
{
char c;

// If there are no SMSs available at regular intervals make a show

inactivityTimer = inactivityTimer++; // Count up for each loop
if (inactivityTimer > 300) // Approx. 1 sec per loop
{
inactivityTimer = 0; // Reset the tomer
prompt(); // Draw attention to yourself
}

// Heartbeat on LED to show that loop is still looping

digitalWrite(readyLed, LOW); // Turn the ready LED off
delay(100); // Time that LED is off
digitalWrite(readyLed, HIGH); // Turn the ready LED on

// If there is an SMS available

if (sms.available())
{
inactivityTimer = 0; // If message then reset inactivity timer
Serial.println("Message received from:");

// Read message bytes and print them
while(c=sms.read())
{
raiseLetterArm (c); // "Print" to perspex arms
}
sms.flush(); // Delete message from modem memory
}

delay(1000);

}

/**************************************************************************************
* Prompt any users
**************************************************************************************/
void prompt()
{
raiseLetterArm (84); // "Print" TEXT ME to perspex arms
raiseLetterArm (69);
raiseLetterArm (88);
raiseLetterArm (84);
raiseLetterArm (77);
raiseLetterArm (69);
}

/**************************************************************************************
* Put the arm out of harm's way
**************************************************************************************/
void parkArm()
{
rotaryServo.attach (rotaryPin); // Attach the rotary servo
newServoPosition = 180; // Park where the arm can do no harm when switched on/off
currentServoPosition = 9; // Make sure that it is clear that a move is needed
rotateServo(); // Move the rotary servo
delay(2000); // Wait for the servo to get there
rotaryServo.detach (); // Keep things quiet
}

/**************************************************************************************
* Raise the letter arm specified
**************************************************************************************/
void raiseLetterArm (int charEntered)
{
rotaryServo.attach (rotaryPin); // Attach the servo on pin

// 'A' is 65 'a' is 97 'Z' is 90
if ((charEntered < 65) || ((charEntered > 91) && (charEntered < 97)) || (charEntered > 123))
{
// Then is not A to Z so do nothing - wait a bit
}
else
{
// Make lower case into upper case
if (charEntered > 96)
{
charEntered = charEntered - 32;
}
if ((charEntered > 64)&&(charEntered < 91)) { newServoPosition = rotation [charEntered - 65]; // Set where to turn the arm to rotateServo(); } // Show what was sent: Serial.print("You sent me: \'"); Serial.write(charEntered); Serial.print("\' ASCII Value: "); Serial.println(charEntered); pressDown (); } rotaryServo.detach (); // Stop random movements } /********************************************************************************* * Push the finger down - make sure it is up before returning ! *********************************************************************************/ void pressDown() { verticalServo.attach (verticalPin); // Attach the finger servo delay(500); for (int i= 0; i < up-down; i++) { verticalServo.write (up-i); // Finger down one degree at a time delay(10); } delay(2000); for (int i= 0; i < up-down; i++) { verticalServo.write (down +i); // Finger up one degree at a time delay(10); } delay(500); verticalServo.detach (); // Stop random movements } /********************************************************************************* * Move the arm around - make sure that the finger is up before using it *********************************************************************************/ void rotateServo() { int difference; int noOfSlowSteps = 5; // No of degrees to move slowly was 5 int waitForServo = 20; // Do not reduce too much or it misses steps verticalServo.attach (verticalPin); // Attach the finger servo verticalServo.write (up); // Make sure it's out of the way verticalServo.detach (); // Detach difference = newServoPosition - currentServoPosition; if (difference > noOfSlowSteps)
{
rotaryServo.write (newServoPosition - noOfSlowSteps); // Quickly move
currentServoPosition = newServoPosition - noOfSlowSteps; // Note new position
}
if (difference < -1*noOfSlowSteps) { rotaryServo.write (newServoPosition + noOfSlowSteps); // Quickly move currentServoPosition = newServoPosition + noOfSlowSteps; // Note new position } difference = newServoPosition - currentServoPosition; // Recalculate difference if (difference > 0)
// Then slowly increase current position until difference is 0
{
for (int i = 0; i < difference+1; i++) { rotaryServo.write (currentServoPosition + i); delay (waitForServo); } } else // Then slowly decrease current position until difference is 0 { for (int i = 0; i < (-1*difference)+1; i++) { rotaryServo.write (currentServoPosition - i); delay (waitForServo); } } currentServoPosition = newServoPosition; // Remember where arm is } /********************************************************************************** * windscreen wiper test **********************************************************************************/ /* for (letter=0; letter < numberOfLetters; letter++) { newServoPosition = rotation [letter]; // Set where to turn the arm to rotateServo(); // Serial.print("rotation [letter] "); // Serial.println(rotation [letter]); } delay(5000); for (letter=numberOfLetters; letter +1 > 0; letter--)
{
newServoPosition = rotation [letter]; // Set where to turn the arm to
rotateServo();

// Serial.print("rotation [letter] ");
// Serial.println(rotation [letter]);
}
delay(5000); */

/**********************************************************************************
* To calibrate the rotary servo
**********************************************************************************/
/* - commented out, define potpin and uncomment to use
val = analogRead(potpin); // Reads the value of a potentiometer connected between +5 and GND on potpin (value between 0 and 1023)
val = map(val, 0, 1023, 0, 179); // Scale it to use it with the servo (value between 0 and 180)
rotaryServo.write(val); // Sets the servo position according to the scaled value
delay(15); // Waits for the servo to get there
// print out the value you read:
Serial.println(val); */

The Edward Snowden Academy of Observation

IMG_3208

These penetrating observers are meant to peer at whoever is standing nearby. In 2014, everyone knows who Edward Snowden is and what he told us.

Can it see around corners?

IMG_3229

How should it work

An Arduino Uno is connected to two HRLV-MaxSonar®-EZ1 ultrasonic sensors, which should measure the range of the nearest objects they can find. By simple triangulation, the single servo controlling the eyes should point them in the right direction.

What’s the problem?

The servos do not provide a stable range reading. The value jumps around for no discernible reason. Maybe the two servos interfere with one another? Theoretically, they are enabled one after the other to prevent that from happening. I need to spend more time diagnosing this. Maybe I should change to a Raspberry Pi and use face recognition?

Strong suspicion

Arduino serial i/f and servo i/f are interfering with one another.

Search using “https://duckduckgo.com/?q=arduino+serial+servo+problem+interrupt&t=osx”

See ServoTimer2 http://forum.arduino.cc/index.php/topic,21975.0.html

Source code
/****************************************************
* Read the serial output from two ultrasonic sensors
* See http://www.maxbotix.com/Ultrasonic_Sensors/MB1013.htm
* Kim Aug 2014
****************************************************/
#include // Include the library for serial interfaces
#include // Include the library for servos

// Which pins are used for what?
#define txPinLeft 3 // Pin configured but not used as nothing is sent to sensor
#define rxPinLeft 8 // Pin used for serial interface for left MB1013 ultrasonic sensor
// — connects to TX on the ultrasonic sensor
#define txPinRight 5 // Pin configured but not used as nothing is sent to sensor
#define rxPinRight 9 // Pin used for serial interface for right ultrasonic sensor
// — connects to TX on the ultrasonic sensor

#define pinToControlLeftSensor 13 // Pin to enable the left sensor
// — connects to RX on sensor
#define pinToControlRightSensor 12 // Pin to enable the right sensor
// — connects to RX on sensor
#define pinToControlServo 10 // Pin to control the servo
// — connects to orange on the MC410 servo
// — brown on MC410 connects to GND
// — red on MC410 to +5 V
/******************************************************
* MB1013 Ultrasonic pins
* GND connect to GND
* +5V connect to +5 V
* TX left connect to Ard pin 2 right to Ard pin 4
* RX left connect to Ard pin 13 right to Ard pin 12
* AN not connected – analogue output
* BW held low to enable serial interface
******************************************************/

SoftwareSerial serialLeft (rxPinLeft, txPinLeft, true); // Serial port to receive data from left sensor
SoftwareSerial serialRight (rxPinRight, txPinRight, true); // Serial port to receive data from right sensor
// MB1013 output is inverted, so true must be set.

Servo myservo; // Create servo object to control a servo

int lastRangeLeft, lastRangeRight, newRangeLeft, newRangeRight; // Help to elimate odd values
int lastServoPosition =0; // Where the servo was last left least time it was moved

void setup ()
{
Serial.begin (9600); // Start serial port for debug output
serialLeft.begin (9600); // Start serial port for left ultrasonic sensor
serialRight.begin (9600); // Start serial port for right ultrasonic sensor
pinMode (pinToControlLeftSensor, OUTPUT); // Initialize the control pins as outputs
pinMode (pinToControlRightSensor, OUTPUT);
myservo.attach (pinToControlServo); // Attach the servo to the servo object
}

void loop()
{
int servoPosition;
int rangeDifference;
int rangeLeft = readLeft (); // Read left US sensor
int rangeRight = readRight(); // Read right US sensor

Serial.print (“L “); // debug output
Serial.print (rangeLeft); // debug output
Serial.print (” R “); // debug output
Serial.print (rangeRight); // debug output

/*********************************************
* Calculate difference between the sensors
*********************************************/
rangeDifference = rangeLeft – rangeRight; // What’s the difference in range from the two sensors?
rangeDifference = constrain (rangeDifference, -10, 10); // Limit range difference
Serial.print (” range difference “); // — debug output —
Serial.print (rangeDifference); // — debug output —
servoPosition = map (rangeDifference, -10, +10, 60, 135); // Scale the offset to use it with the servo (value between 0 and 180)

if (lastServoPosition != servoPosition) moveServoTo (servoPosition); // Don’t wake up the servi if there is no need
Serial.print (” servoPosition “); // — debug output —
Serial.println (servoPosition); // — debug output —
}
/********************************************************************
* Function to move the servo at a reasonable speed & keep it quiet
********************************************************************/
void moveServoTo (int servoPosition)
{
int servoDelay = 20; // 10 is OK
myservo.attach (pinToControlServo); // Activate the servo output
if (lastServoPosition > servoPosition)
{
while (lastServoPosition > servoPosition)
{
myservo.write (lastServoPosition–);
delay(servoDelay);
}
}
else
{
while (lastServoPosition < servoPosition)
{
myservo.write (lastServoPosition++);
delay(servoDelay);
}
}
myservo.detach (); // Seems to stop the servo from chattering
}
/***************************************************************
* Function to read the left ultrasonic sensor via a serial port
***************************************************************/
int readLeft()
{
char inData [4];
int index = 0;

digitalWrite (pinToControlLeftSensor, HIGH); // Start the sensor ranging
serialLeft.listen (); // To listen on a port, select it:

while (serialLeft.available () == 0) // Wait for char to be available http://arduino.cc/en/Serial/available
{
}
// Then keep reading serial input until an R appears marking the start of data
char rByte = serialLeft.read ();
while ( rByte != ‘R’)
{
rByte = serialLeft.read ();
}

// Keep looping until four range characters read from sensor
while (index < 4) { if (serialLeft.available () > 0) // When a character is available, put in the array
{
inData [index] = serialLeft.read ();
index++;
}
}
digitalWrite (pinToControlLeftSensor, LOW); // Stop the sensor ranging
return atoi (inData); // Change array of string data into an integer for return
}

/****************************************************************
* Function to read the right ultrasonic sensor via a serial port
****************************************************************/
int readRight ()
{
char inData [4];
int index = 0;
digitalWrite (pinToControlRightSensor, HIGH); // Start the sensor ranging

serialRight.listen (); // To listen on a port, select it

while (serialRight.available () == 0) // Wait for char to be available
{
}
// Then keep reading serial input until an R appears marking the start of data
char rByte = serialRight.read ();
while ( rByte != ‘R’)
{
rByte = serialRight.read ();
}

// Keep looping until four range characters read from sensor
while (index < 4) { if (serialRight.available () > 0) // When a character is available, put in the array
{
inData [index] = serialRight.read ();
index++;
}
}
digitalWrite (pinToControlRightSensor, LOW); // Stop the sensor ranging
return atoi (inData); // Change array of string data into an integer for return
}

/************************************************************************************************************
HRLV-MaxSonar®-EZTM pins – see http://www.maxbotix.com/documents/HRLV-MaxSonar-EZ_Datasheet.pdf
*************************************************************************************************************
Pin 1

Temperature sensor connection
—————————–
Leave this pin unconnected if an external temperature sensor is not used.

Pin 2

Pulse width output
——————
This pin outputs a pulse width representation of the distance with a scale factor
of 1 uS per mm. The output range is 300 uS for 300 mm to 5000 uS for 5000 mm.
The pulse width output is up to 0.5% less accurate then the serial output.

Pin 3

Analog voltage output
———————
On power-up, the voltage on this pin is set to 0V, after which, the voltage on this pin corresponds to the
latest distance measured. The scale factor is (Vcc/5120) per 1 mm. The resolution of the distance is 5 mm.
This is typically within ±10 mm of the serial output.

Using a 10 bit analog to digital convertor, one can read the analog voltage bits (i.e. 0 to 1024) directly
and just multiply the number of bits in the value by 5 to yield the range in mm.
For example, 60 bits corresponds to 300 mm (where 60 * 5 = 300),
and 1000 bits corresponds to 5000-mm (where 1000 * 5 = 5000-mm).
A 5 V power supply yields~0.977 mV per 1 mm.
When powered with 5 V, the output voltage range is 293 mV for 300 mm, and 4.885 V for 5000 mm.

Pin 4

Ranging start/stop
——————
This is internally pulled high. If high, the sensor will continually measure and output the range data.
If low, the sensor will stop ranging.
Take high for 20 uS or longer to initiate a range reading.
If the sensor sees that the RX pin is low after each range reading, then the range can be obtained every 100 mS.
If pin 4 is constantly high, the sensor will range every 100 mS, but the output will pass through a 2 Hz filter.

Pin 5

Serial output
————-
By default, the serial output is RS232 format (0 to Vcc) with a 1 mm resolution.
The output is “R”, followed by four ASCII characters representing the range in millimeters,
followed by a carriage return (ASCII 13). The maximum distance reported is 5000.
The serial output is the most accurate of the range outputs.
Serial data is sent at 9600 baud, with 8 data bits, no parity, and one stop bit.

Pin 6

V+

Positive Power

Pin 7

GND

*/
/* The MC 410 standard servo from Conrad

1 brown wire Gnd
2 red wire VCC
3 orange wire PWM signal

*/

Crystal Ball

Prototyp_1

The Crystal Ball

You can’t have it all
But a crystal ball
Shall reveal all
With no embroidered shawl
But fisheyes two
A Raspberry Pi three
Ultrasonic sensors four
And PIRs on each wall  
A projector quite small
Processing then does it all

Sample_starscape

Only the initiated can see through this 21st century crystal ball. Approach it in the right frame of mind and your gestures will reveal all, even if you can only ever see half of the story. For the first time, its secrets are revealed here for all true believers.

The Raspberry Pi software

What does the Raspberry Pi software have to do?

  • Boot Raspbian operating software from a 32 Gbyte plug-in MicroSD card
  • Display the user interface image via an HDMI interface
  • Support WiFi access
  • Allow FTP access via WiFi to copy image files
  • Allow VNC access via WiFi to allow a remote user interface
  • Read out 4 ultrasonic sensors meant to detect hands
  • Read out 4 passive infrared sensors meant to detect people
  • Supply a sound signal via the HDMI interface
  • Support the Processing software

Block diagram

Crystal_ball_block_diag2_512

First steps

  1. Download  the experimental image including Raspbian and Processing onto your desktop computer.
  2. Unpack the downloaded file (double-click on file).
  3. Copy the unpacked image onto a 32 Gbyte MicroSD card
  4. Put the MicroSD card into your Raspberry Pi3.
  5. Temporarily connect the Pi3 to any display with an HDMI interface
  6. Temporarily connect a keyboard & mouse to the Pi3 USB ports
    (Once remote access is possible these temporary items won’t be needed.)
  7. Power up the Pi3.
  8. Change the Raspbian preferences to match the keyboard connected under Menu->Preferences->Keyboard settings.
  9. From the Pi3 log in to the same WIFI network used by your desktop computer
  10. Install X11vnc on Raspbian. Using X11vnc means that you can directly view/control the same session as you see on the screen connected via HDMI.
  11. Download the Real  VNC Viewer onto your desktop computer to access the Pi3 screen, keyboard & mouse remotely.
  12. Check that the iMac can access X11vnc properly e.g. use address 192.168.2.111
    A fixed address would be good. How to set up a fixed IP address
  13. Check that the your FTP client can access Pi3 with
    IP address – e.g. 192.168.2.111
    user – pi
    password – raspberry
    protocol  – SFTP.
    (SFTP is easier to setup than FTP as Raspbian has SSH enabled by default)
    If your FTP client complains about change in the Pi’s key, delete the old entry for Raspberry Pi in ~/.ssh/known_hosts.
  14. Remotely log in to Pi3 from Mac using VNC Viewer
  15. Configure X11VNC to start automatically (use nano not vim).
  16. Expand the Pi3 file system to use the full SD card capacity
    Open a terminal window on the Pi3 and enter
    sudo raspi-config
    to open the Pi3 configuration and “Expand Filesystem” to ensure that all of the SD card is used.
  17. Update Raspbian.
  18. Reboot the Pi3
  19. In a Pi3 terminal window enter
    sudo raspi-config
    and enable SPI to allow access to the 8 analogue inputs for the Pi
  20. Update the Processing software in a Pi3 terminal window
    curl https://processing.org/download/install-arm.sh | sudo sh
  21. This loads the software to e.g.
    /usr/local/lib/processing-3.2

The hardware

  • Wire up the SPI bus to the MCP3008

 

Help with Processing

Daniel Shiffmann has a Youtube channel called Coding Rainbow.

Abe Pazos has a great web site call Fun Programming.

Camera

https://github.com/processing/processing/wiki/Raspberry-Pi#video-library-capture

Problems

Raspberry Pi 2 software is not compatible with Raspberry Pi 3 software

  • The OS Raspbian is different
  • The Processing image is different
  • Arduino has lots of support for sensors
  • Raspberry Pi supports some sensors but they are not integrated into Processing
  • Processing has a GPIO library but I haven’t found ready-made ultrasonic sensor support. I could use a serial interface but there’s only 1 on the Pi.
  • Using a Raspberry Pi and an Arduino seems too much, but maybe it’s the path of least resistance.

Preparing Raspberry Pi 3 – OLD

  1.  Download  the experimental image including Raspbian and Processing that supports Raspberry Pi3 to iMac.
  2. Unpack the downloaded file (double-click on file).
  3. Copy the unpacked image onto a 32 Gbyte MicroSD card
  4. Put the MicroSD card into Pi3
  5. Connect Pi3 to TV with full HDMI interface
  6. Connect Pi3 to local WLAN
  7. Change Raspbian preferences for correct keyboard
  8. Open Epiphany web browser
  9. To configure Pi3 for 7 inch HDMI LCD panel (LCD won’t work otherwise)
    Enter command

    sudo su

    Go to boot directory

    cd ../../boot

    Use the nano editor

    nano config.txt

    to add the following code to the end of /boot/config.txt:

    max_usb_current=1
    hdmi_group=2
    hdmi_mode=1
    hdmi_mode=87
    hdmi_cvt 1024 600 60 6 0 0 0
  10. The laser projector doesn’t need that. The HDMI interface must either tell Pi3 what size the display is, or it must be configured. The 7″ LCD display doesn’t support this so either the projector must be connected first as it doe support that, or set the projector’s pixel size in config.txt.
  11. Install X11vnc on Raspbian
  12. Download Real VNC viewer onto iMac to access the Pi3 screen remotely.
  13. Check that the iMac can access X11vnc properly use address 192.168.2.111
    Question. use fixed IP address? How to set up a fixed IP address
  14. Check that the Viscom FTP client can access Pi3 with
    IP address – 192.168.2.111
    user – pi
    password – raspberry
    protocol  – SFTP.
    (SFTP is easier to setup than FTP as Raspbian has SSH enabled by default)
    If FTP client complains about change in the Pi’s key, delete old entry for Raspberry Pi in ~/.ssh/known_hosts.

See if Pi speeds up when x11vnc disconnected


A/D converter

MCP3008 (datasheet)

Adafruit suggestion

Processing code suggestion

Enable the SPI interface in the P3 config.

Ultrasonic sensors

LV-MaxSonar EZ MB1010
www.maxboxit.com

Processing software

How to embed Processing onto a web site
[processing]
/***************************************************************
* Kims tree also known as Jack and the beanstalk
* Fish appear instead of fruit
* Make bunches of fruit
* Flower before fruit?
* last change 11 April 2016
* See http://drifkin.net/processing/beziereditor/
***************************************************************/
float loopCount;
float oldxStemStart=0;
float oldyStemStart=0;
int standStill=0;
void setup()
{
fullScreen();
background(0);
}
/***************************************************************
* The loop
***************************************************************/
void draw()
{
color leafColour;
float xStemStart, yStemStart, xStemEnd, yStemEnd;
int growthSpeed=150; // bigger = slower

// Draw stems
xStemStart= mouseX;
yStemStart= mouseY;
xStemEnd= random(xStemStart-100, xStemStart+100);
yStemEnd= random(yStemStart-100, yStemStart+100);
stroke(#745106); // Brown
strokeWeight (7);
line (xStemStart, yStemStart, xStemEnd, yStemEnd); // Draw stem for 1 leaf
line (oldxStemStart, oldyStemStart, xStemStart, yStemStart); // Draw main stem

// Draw berries
if (oldxStemStart == xStemStart) // Check whether mouse is moving
{
standStill++; // If not moving increment standstill counter
if (standStill>4) // If long pause, grow berries
{
noStroke();
fill(#CE063C,150); // red, slightly transparent berries
ellipse (xStemStart, yStemStart + (standStill-4)*40, 40, 40);
fill(255); // with a white highlight
ellipse (xStemStart+5 , yStemStart-10 + (standStill-4)*40, 10, 10);
if (standStill==14) standStill=0; // stop after 10 berries
}
} else
{
standStill=0; // reset counter
}
oldxStemStart = xStemStart; // remember where last mouse position was
oldyStemStart = yStemStart;

// Draw leaves
leafColour = color(random(0, 100), random(150, 255), random(0, 190)); // Greenish colours
drawLeaf(xStemEnd, yStemEnd, random(100, 200), random(360), leafColour);

// Fade old content
if (loopCount++ %4==0) // make old stuff fade. Bigger number fades more slowly
{
noStroke();
fill(0, 12);
rect(0, 0, width, height);
}
delay(growthSpeed); // Control fertilizer
}

/***************************************************************
* Draw one leaf
***************************************************************/
void drawLeaf(float x, float y, float leafLength, float theta, color leafColour)
{
pushMatrix();
translate(x, y); // Reset 0,0 to wherever the leaf is to start
rotate(radians(theta));
fill(leafColour); // fill colour
stroke(#045A1E); // stroke colour
beginShape();
vertex(0, 0); // Leaf root is always at origin
bezierVertex(
0.15*leafLength, 0.3*leafLength, 0.4*leafLength, 0.45*leafLength,
leafLength,
-leafLength*0.05
);
bezierVertex(
0.6*leafLength, 0, 0.45*leafLength, -0.45*leafLength, 0, 0);
endShape();
popMatrix();
}
[/processing]

Jack & the Beanstalk

My first Processing experiment on Sketchpad.
Experimenting with Bezier curves. Thanks to Abe for his great instructional site – http://funprogramming.org

Kim’s Amazing Ant Circus

There is an online version to try yourself. It’s best with Firefox, mostly works with Internet Explorer, doesn’t work at all with Safari.

It is a small Processing sketch using sound and the computer’s camera. The online version uses p5.js.

Sleeping Dog

An old English saying says that you should let sleeping dogs lie. Wake this one up at your peril!

Climbing lamp

 

Climbing_lamp

It’s hard getting to the top …

Door trumpet

Take wireless doorbell for the connection to the existing bell

Pushbutton + Receiver

Strong servomotor 

Torque at 7.4 V = 268 Ncm

 

DS8203 MG servo from Reely (Conrad link)

Spotted wagtail

The Spotted Wagtail




 


Making a spotted wagtail

This is related to twelve tweeters, so check them out for more detail on the birds. Guaranteed completely free from electronics. The only digits involved here are those that you were born with.

Bird’s eggs are tricky devils to hold still while drilling carefully angled holes, so a jig to hold them still is a real help.

A vice is OK to cut balls in half, but you need another jig to hold the hemispheres while you chisel or drill holes.


You need a box to put the mechanism in. Note the bar at the bottom to stop the paddles from dropping out.

You need two paddles, one to push the head and one for the tail. There is nothing to stop the head from twisting so its paddle has a little extra to stop the brass rod from turning too far. The cylindrical pieces stop the springs from slipping.


The bottom of the box with the paddles inlace, held by the brass rod which goes from side to side of the box.

One of two springs, at the end closer to the hinge to reduce the force.

The bits to make a tail with a hinge hole and a push hole.

It’s tricky to bend the push rods in the right place.

Crest and eyes glued in place. The feet have to wait until the box has been painted.


Watch that tail wag! 100% digitally operated.