VCR’s are analog TV transmitters

Any VCR with antenna output has a built-in RF modulator.

Generally they transmit on channels 2-4. Here are the US frequencies:

from wikipedia http://en.wikipedia.org/wiki/Television_channel_frequencies

The signal is weak, not intended for broadcast. Not legal to broadcast… but hypothetically, amplifiers and antennas could be connected.

This audio signal is from an iPod playing through a VCR received by rtl-sdr in Max on 65.75 MHz. (channel 3) using a random length wire connected to the antenna output.

 

Notes about RF modulators:

I have tried this with some small RF modulator boxes. One of the problems is that you need to send a signal to the video input, or the modulator won’t run. You can get a rough signal by patching one of the audio channels into the video input jack. Or a better signal by using the video composite output of a raspberry-pi. Although the VCR gives a much cleaner signal

Arduino electric eye and musical stairs

Summary of experiments with IR beam detection.

Initial testing with Radio Shack sensors and IRremote library: https://reactivemusic.net/?p=4027

musical stairs project

Built by students at Gould Academy, Bethel, Maine 2013.

Detects movement on stairs using individual IR sensor pairs on each step. When an IR beam is broken, a note is triggered and status LED lights up. Using an Ethernet shield, the data is tracked in a feed at xively.com

materials

Adafruit IR emitters and receivers

https://www.adafruit.com/products/157

https://www.adafruit.com/product/388

construction of sensor units

IR transmitters and receivers wired into terminal strips (no soldering):

transmitting unit:

schematic:

receiving unit:

schematic:

layout of stairs

Arduino connections and code

code:

[wpdm_file id=19]

(local file: musicalStairsVersion3tz2)

notes

FM audio transmitter using NTX2

Transmit FM audio on 434.65 Mhz. by substituting a Radiometrix NTX2  for a crystal oscillator in this circuit:

http://scitoys.com/scitoys/scitoys/radio/am_transmitter.html

Radiometrix: http://www.radiometrix.com/content/ntx2

NTX2 datasheet: http://www.radiometrix.com/files/additional/ntx2nrx2.pdf

On the NTX2, the connections are:

  • 5V to the NTX2 VCC pin 4
  • 5V to the NTX2 EN pin 5
  • GND to the NTX2 GND pin 6
  • Upper lead of audio transformer to the NTX2 TXD pin 7

A voltage divider input coupler will also work. See this post for a simple circuit: https://reactivemusic.net/?p=12263

notes

  • Audio modulation level is very low. This circuit would benefit from a preamp. For example, as in this circuit by Amanda Ghassaei: http://www.instructables.com/id/Arduino-Audio-Input/
  • Connect an antenna wire to NTX2 pin 2 (and 1 for RF ground)
  • The circuit worked with 3.3 volts and would probably be fine with less.
  • Used line out of an iPod touch for an audio source. Volume was up fairly high.
  • You can also receive using AM mode using ‘edge’ detection
  • In the US, you need a ham license to transmit on 434.65 Mhz.

xively.com feed with Arduino

[Note: xively.com is gone. This system doesn’t work. Post is here for historical reasons only]

Bi-directional communication from Arduino to a xively.com feed using an ethernet shield.

  • Initializes an internet connection (DHCP)
  • Connects to xively.com servers every minute
  • Stores random value in the feed using HTTP PUT
  • Retrieves current feed value using HTTP GET
  • Lights up LED when transmitting
By the way, xively used to be cosm used to be pachube… 
Arduino circuit
  • Use an ethernet shield.
  • Connect ethernet cable. (I am using a Netgear WNCE2001 ethernet to wiFi adapter)
  • LED is connected to pin 5 and ground. The shorter lead connects to ground.

download

[wpdm_file id=18 title=”true” ]

files
  • xively_test1 (Arduino sketch)
Arduino files and libraries

Copy the xively_test1/ folder to Documents/Arduino. This puts it in the Arduino sketchbook.

Notes on installing xively/cosm/pachube libraries for arduino: https://reactivemusic.net/?p=4900

Instructions

  1. Connect Arduino to Macbook via USB.
  2. Open the Arduino serial monitor to initialize the ethernet connection and display the IP address.
  3. Every minute data gets send to the feed
  4. Monitor feed data here: https://xively.com/feeds/98281/workbench
Arduino sketch


/*
5/20/2014 - Arduino/xively feed interaction
Uses Ethernet Shield and and LED connected between pin D5 and ground
Sends a random value to a xively.com feed every minute
The LED lights up during data transmissions
demonstrates:
HTTP PUT - send data to xiveyly feed and store
HTTP GET - read xively feed value
*/
#include <SPI.h>
#include <Ethernet.h>
#include <HttpClient.h>
#include <Cosm.h>
int ledPin = 5;
int upCount = 0; // counters for number of times going up and down
#define API_KEY "96PqSh4rj7HzNif3WtTpN7GjX96SAKxrWms3SUhwaDFGUT0g" // your Cosm API key
#define FEED_ID 98281 // your Cosm feed ID
// MAC address for your Ethernet shield
byte mac[] = { 0x90, 0xA2, 0xDA, 0x0D, 0x0B, 0xCE };
// note that pins 0 and 1 are used by the Ethernet shield
unsigned long lastConnectionTime = 0; // last time we connected to Cosm
const unsigned long connectionInterval = 60000; // delay between connecting to Cosm in milliseconds
// Initialize the Cosm library
// Define the string for our datastream ID
char sensorId[] = "count";
CosmDatastream datastreams[] = {
 CosmDatastream(sensorId, strlen(sensorId), DATASTREAM_FLOAT),
};
// Wrap the datastream into a feed
CosmFeed feed(FEED_ID, datastreams, 1 /* number of datastreams */);
EthernetClient client;
CosmClient cosmclient(client);
void setup() {

 // initialize the detector pins 

 pinMode(ledPin, OUTPUT ); // internet transmitting indicator
 // start the Monitor (console) serial port

 Serial.begin(9600);
// display happy messages 

 Serial.println("Xively test");
 Serial.println("==========================");
// Keep trying to initialize the Internet connection
 // Note - we should eventually timeout of this and just run the stairs independently

 Serial.println("Initializing network");
 while (Ethernet.begin(mac) != 1) {
 Serial.println("Error getting IP address via DHCP, trying again...");
 delay(15000);
 }
Serial.println("Network initialized");
 Serial.println();
 // print your local IP address:
 Serial.print("Arduino IP address: ");
 for (byte thisByte = 0; thisByte < 4; thisByte++) {
 // print the value of each byte of the IP address:
 Serial.print(Ethernet.localIP()[thisByte], DEC);
 Serial.print("."); 
 }
 Serial.println();
 Serial.println();

} // end of setup function
//////////////////////////// control loop ///////////////////////////
void loop() {
 // main program loop

 ////////////////////////////// Internet sending/receiving code ////////////////////////////////

 if (millis() - lastConnectionTime > connectionInterval) {

 // uncomment this to just send a random value...
 upCount = random(256);

 digitalWrite(ledPin, HIGH ); // turn on transmitter light
 sendData(upCount);
 // read the datastream back from Cosm - comment out to save time
 getData();
 digitalWrite(ledPin, LOW );
 // update connection time so we wait before connecting again
 lastConnectionTime = millis();

 }

 ///////////////////// end of internet send/receive code /////////////////

} // end of main loop code
/////////////////// additional functions //////////////////////////
////////////////////////////////////////////////////////////////////
// send the supplied value to Cosm, printing some debug information as we go
void sendData(int sensorValue) {
 datastreams[0].setFloat(sensorValue);
Serial.print("Read sensor value ");
 Serial.println(datastreams[0].getFloat());
Serial.println("Uploading to Cosm");
 int ret = cosmclient.put(feed, API_KEY);
 Serial.print("PUT return code: ");
 Serial.println(ret);
Serial.println();
}
// get the value of the datastream from Cosm, printing out the value we received
void getData() {
 Serial.println("Reading data from Cosm");
int ret = cosmclient.get(feed, API_KEY);
 Serial.print("GET return code: ");
 Serial.println(ret);
if (ret > 0) {
 Serial.print("Datastream is: ");
 Serial.println(feed[0]);
Serial.print("Sensor value is: ");
 Serial.println(feed[0].getFloat());
 }
Serial.println();
}

 

basic Arduino connections to Max

  • Dim an LED from Max.
  • Read the value of a potentiometer in Max.

download

https://github.com/tkzic/max-projects

folder: arduino-basics

patches:

  • arduino-dimmer.maxpat
  • arduino-serial-read.maxpat

Arduino dimmer

dim an LED from Max

From the Arduino playground

http://playground.arduino.cc//Code/MaxCommunicationExamples

circuit

Connect an LED to pin 9 and ground. The shorter lead goes to ground.

sketch

Load the Arduino example sketch: communications | dimmer

Max
  1. open arduino-dimmer.maxat
  2. Click the “print” message to print the list of ports to the Max window. Then set the port in the serial object, using the port message. For example: “port c”.
  3. Move the slider to dim the LED

Arduino serial read

Read the value of a potentiometer

This patch is a bit more involved. Refer to the Max Communications Tutorial 2: Serial Communication. In fact, much of this code was lifted from the tutorial.

circuit
  • Connect an LED to pin 9 and ground. The shorter lead goes to ground.
  • Connect a potentiometer (center lead) to Analog pin 0. The side leads connect to +5v and ground.
sketch

Load the Arduino example sketch: Analog | analogInOutSerial

Max
  1. Open arduino-serial-read.maxpat
  2. Click the “print” message to print the list of ports to the Max window. Then set the port in the serial object, using the port message. For example: “port c”.
  3. Activate toggle to start polling serial port
  4. Activate toggle number 3 to view formatted output in the Max window
  5. Turn the potentiometer to send data to Max

general suggestions:

  • Try not to get discouraged.
  • If weird things happen, close Max, reconnect Arduino, the re-open Max