Peter Smith
Published © MIT

Working Herbert Televox Robot Model

A small-scale replica of the original Herbert Televox robot from the 1920's was a great addition to a presentation on "how to tell stories."

IntermediateFull instructions provided5 hours957
Working Herbert Televox Robot Model

Things used in this project

Hardware components

Photon
Particle Photon
×1
Rotary phone
×1
Buzzer
Buzzer
×1
Phone jack breakout board CZH Labs D-1039
×1

Story

Read more

Code

Simple code for the Herbert Televox demo// This #include statement was automatically added by the Pa

Arduino
This is the wiring code for hooking up the Particle Photon Arduino board to teh devices that make up the Herbert Televox demo.
// This #include statement was automatically added by the Particle IDE.
#include <Adafruit_SSD1306.h>

// Connect to Wi-Fi on the system thread.
// Otherwise if the Wi-Fi network can't be connected to, the
// program doesn't run at all.

SYSTEM_THREAD(ENABLED);
// ------------
// Blink an LED
// ------------

int bluePin = D7; // blue LED
int redPin = D1;
// This one is the little blue LED on your board. On the Photon it is next to D7, and on the Core it is next to the USB jack.
int phonePin = A0;
int measurePin = A1;
int buzzerPin = D0;

int speed = 100;
int phone = 10000;
int measure = 100000;

long hookTimeDelta = 0;
int nbuzz = 0;
int didBeep = 0;

// Display
#define OLED_DC     D3
#define OLED_CS     D4
#define OLED_RESET  D5
Adafruit_SSD1306 display(OLED_DC, OLED_RESET, OLED_CS);

void setup() {
  pinMode(bluePin, OUTPUT);
  pinMode(redPin, OUTPUT);
  pinMode(buzzerPin, OUTPUT);
  digitalWrite(redPin, HIGH);
  
  // by default, we'll generate the high voltage from the 3.3v line internally! (neat!)
  display.begin(SSD1306_SWITCHCAPVCC, 0x3D);  // initialize with the I2C addr 0x3D (for the 128x64)
  // init done
  
  display.display(); // show splashscreen
  display.clearDisplay();   // clears the screen and buffer
  display.setTextSize(1);
  display.setTextColor(WHITE);
  display.setCursor(0,0);
  display.println("ROBOT! YES!");  
  display.display();
}


void loop() {
  // To blink the LED, first we'll turn it on...
  digitalWrite(bluePin, HIGH);
  phone = analogRead (phonePin);
  measure = analogRead (measurePin);
  speed = phone/64;
  // on hook = 4096 off hook = 1680+-50 or so
  int isOffHook = (phone < 2500);
  
  nbuzz = 0;
  if (measure < 3200) nbuzz += 1;
  if (measure < 2690) nbuzz += 1;
  if (measure < 2500) nbuzz += 1;
  
  //isOffHook = 1;
  digitalWrite (redPin, isOffHook ? HIGH : LOW);

  display.setTextSize(1);
  display.setCursor(0,0);
  display.fillRect (0,0,256,80, BLACK);
  display.print(phone);
  display.print ("/");
  display.println(hookTimeDelta);
  display.print ("Dpth=");
  display.println(measure);
    display.setTextSize(2);
  display.print ("Buzz=");
  display.println(nbuzz);
  display.display();    
  if (isOffHook == 1 && hookTimeDelta > 2000 && !didBeep)
  {
      didBeep = 1;
      hookTimeDelta = 0;
      for (int i = 0; i<nbuzz; i++)
      {
          tone (buzzerPin, 40);
          delay (200);
          noTone (buzzerPin);
          delay (500);
      }
  }
  if (!isOffHook) 
  {
      hookTimeDelta = 0;
      didBeep = 0;
  }
  

  // Report the analog phone value via blue LED
  delay(speed);
  if (isOffHook) hookTimeDelta += speed;
  digitalWrite(bluePin, LOW);
  delay(speed);
  if (isOffHook) hookTimeDelta += speed;
}

Credits

Peter Smith

Peter Smith

2 projects • 3 followers
C# Programmer for many years, and a lover of all things IOT and Bluetooth.

Comments