Saturday, August 29, 2015
Hall Effect Sensor Test
I purchased five Hall Effect sensors (3144) and was able to test their operation by connecting an LED to the "output" pin...only the output actually goes low when in the presence of a magnet. This means you connect the LED cathode to the output. When I held a fridge magnet close to the sensor, in the proper orientation, the LED illuminated. Simple test!
Monday, August 17, 2015
Servos and Interrupts
I got my daily fix of eBay parts in the mail so I hooked up my shiny new limit switch to D2 and attached a CHANGE interrupt to it. The interrupt stopped a servo that was running Sweep.
#includeServo myservo; // create servo object to control a servo // a maximum of eight servo objects can be created int pos = 0; // variable to store the servo position volatile int state = LOW; void setup() { myservo.attach(9); // attaches the servo on pin 9 to the servo object attachInterrupt(0, pressed, CHANGE); } void loop() { for(pos = 0; pos < 180; pos += 1) // goes from 0 degrees to 180 degrees { // in steps of 1 degree myservo.write(pos); // tell servo to go to position in variable 'pos' delay(15); // waits 15ms for the servo to reach the position while(state == HIGH) { delay(15); } } for(pos = 180; pos>=1; pos-=1) // goes from 180 degrees to 0 degrees { myservo.write(pos); // tell servo to go to position in variable 'pos' delay(15); // waits 15ms for the servo to reach the position while(state == HIGH) { delay(15); } } } void pressed() { state = !state; }
Saturday, August 8, 2015
Added PiR and MQ-2 to the Arduino
Last night we did some more component testing. First up, testing the DS18B20 with 20' of Cat-5 cable to see if remote communications would be a problem. Sensor "Tom" performed flawlessly. After that I connected up the MQ-2 and watched it stabilize after a couple of minutes of heating. I do wonder how much current draw it has. Finally we experimented with a passive IR motion sensor and it was able to spot us moving 20' away!
Wednesday, August 5, 2015
Connecting Arduino Uno to Bluemix via MQTT
After some fits and starts, I was finally able to get my new Ethernet shield connected to the IBM Quickstart by using one of big blue's receipes. I'm not sure why my Netgear router wouldn't work, but once I switch to my ISP's router, I was able to get on the network.
Sunday, August 2, 2015
MQTT and the Big Blue IoT
I'm grateful to IBM for advertising on Google in the MQTT search results. If they didn't, it might have taken far longer for me to discover their Bluemix offerings. Following an IBM tut on getting an Arduino talking MQTT to their service. So far I've only had time to setup the local Mosquito MQTT broker running. Tomorrow, I hope to get my new Ethernet shield onto the network and providing temperature readings to the Bluemix service.
Subscribe to:
Comments (Atom)