Showing posts with label induinox. Show all posts
Showing posts with label induinox. Show all posts

Tuesday, July 9, 2013

Twitter Sentimental Bulbs + Ruby!

I presented at the RubyConfIndia 2013 on the topic of Arduino + Ruby and had planned to show 2 Demo's to the attendees.


  1. A bubblino clone and
  2. A webpage controlling a Car.
Unfortunately, both of them stopped working just a day ago because of various reasons. And hence, we came up with a quick hack 'Sentimental Bulbs' which made it to the conference and luckily worked! 

Here is how we built it.

What does sentimental bulbs do?

- It looks for a specific hash-tag on twitter, if the words in that are happy it turns on the green bulb else turns on the red bulb.

How does it work?

- A ruby script runs on the computer tracking tweets and when find a happy tweet sends a message to the Green bulb to light up.

Let's see what does it take to build this.

  1. 2 Bulbs - 1 Red , 1 Green
  2. A relay control board
  3. Ruby Installed + Gem Dino.
  4. Single Strand Wires
  5. Holder for bulbs + plugs to put in mains.


Circuit


  1. Pin no. 12 from Arduino to RL1 pin on Relay control Board
  2. Pin no. 13 from Arduino to RL2 pin on Relay control Board
  3.  + of Relay to +5V on Arduino
  4.  - of Relay to GND on Arduino
  5. Connect the cut wire for green bulb into RL1 and  for red bulb into RL2

Program Logic

  1. Ruby program would listen on twitter with help of tweetstream gem.
  2. Once it detects the pattern of happy words, it sends a signal to switch ON the pin 12. sleeps for some time and then switch it OFF.

Code Repository





Friday, June 14, 2013

Arduino based Light Following Rover

Ah, what a fun!!! :) Today we built the “Light following rover” a variant of what +Unmesh suggested in one thread on Internet of Things Pune group discussion.

We bang-on-started (Thanks to Dhiraj) with first understanding basic circuitry and designed a simple circuit to check the light signals in six directions i.e. Three in-front and Three in-back. i.e. left, center, right in clock wise direction on Front and Back side of the rover. Based on this understanding we proceed to build the rover. Our requirement was simple "The bot should move to direction where there is maximum light among all the directions".

Then second thing was to calibrate the LDRs so as to understand the variations in light (high, low and normal values), also normalize the values of LDRs as each might give different values for same amount of light. We checked each LDR ad-hoc way, normalized the values in program directly.

Now, the big problem was, we need to control/drive Geared DC motor(s) using our Induino board. As you know, It’s difficult to control the motors directly (motors require more current and voltage than the typical output values and we needed special circuit for the same).So, we needed some Motor driver circuit. Thankfully Dhiraj has already built an Arduino shield "2-Channel Actuator Controller" which is capable of controlling upto 4 DC motors. Here, We have used the same Actuator controller shield to drive the motors of the rover. So, using this shield, We are actually controlling two motors via a single actuator channel.   You can also build ckt using L293D/ L298 or buy a circuit to control the motors popularly known as HBridge/ DC motor controller.

Now, we needed the power source and few 1K resistors to build the sensor circuit. Sensor ckt is very simple as shown in the diagram below.  Each LDR’s signal will be inputted to Induino on Pins A0 to A5. Also motors are controlled via Digital Pins in Output mode 2, 3, 4, 5, These are directly interfaced via the actuator shield.





As mentioned, Motors on each side of the chassis are shorted together. That means motor connected on Left side of chassis are shorted and connected to one output socket of ‘Actuator controller shield’ while other side to other socket.  This Shield has 4 relays, 2 relays are used to control single socket’s current direction. Make sure all the motors move in one direction before screwing. J

Sketch below is loaded and Fun begins… Here we are controlling the forward motors with Pins 2, 4, so code is written in such way. Your pins might differ so do take care of those.

We are looking forward to add collision detection soon....so stay tuned!!!

Saturday, May 11, 2013

Arduino based Tic Tac Toe with TV Remote

This was my first time attending the Internet of Things Pune Group. It was such a fun learning experience!

At today's meetup, Dhiraj and Nishant started out by introducing the InduinoX and Arduino Uno boards along with the Processing IDE that is used to write the code.

After playing around with couple of sensors on the InduinoX we thought of doing a micro project together and finally settled on doing a Tic Tac Toe!

All those other ideas would hopefully make it into our next meetups!

Following spec was decided for our micro-project.

  1. A tic-tac-toe game with a mesh of 3x3 LEDs.
  2. Controlled via a TV Remote. (IR). 1-9 keys on remote denote the position of the LED.
  3. A player alternates using the TV Remote.
  4. The first player's LED is always bright (solids) and the second player's LED blinks. (a novel idea considering we had only 1 color LED's.)

Building It

  1. We connected pins 2-10 of the Arduino Uno to a breadboard mounted with LED's. Also the ground PIN was connected using jumpers. (as seen in the below pic.)



  2. Code 
  3. A video below shows the game play!

This would have been impossible without these awesome people. A big thank you to all of them..

   

@Unmesh@Pratik@dihrajjadho@nishantmodak, prashant and prakash!

@myselfsud Sudam.

P.S: If you want to join our local group. You can subscribe to this IOT google group and also join the meetup page!