Monday, 12 August 2013

Project 17 (Advance): Ultrasonic Alarm System (Version 2), with Sonar Display

After creating my ultrasonic alarm system, I wanted to map nearby objects onto a screen, similar to radars. To do this, I need another software called Processing. Processing is a programming language which is used to create images, animations and a bunch of other stuff. In my case, I wanted to create a radar screen. Luckily, the programming language and syntax is exactly identical to the arduino IDE. All I had to do is figure out how to draw basic shapes and the rest is just math and coding.

The features in this project is exactly the same as my previous alarm system(version 1). I replaced my LCD screen with a sonar display produced from Processing. The arduino board will be sending data onto my computer serially, which is then picked up by Processing. The arduino will be sending the servo's angle position and the ultrasonic sensor's reading. The sonar screen is produced by using basic trigonometry.

On the sonar screen, the top right hand corner will display the status of the system. On the bottom right hand corner, the distance between the sensor and the object in front of it is displayed and is being constantly updated in real time. The little red dots are the detected objects.

"Normal" indicates that everything is running normally and nothing is within the danger limits.
Also, a green light indicates that the sensor/servo motor is operating as expected.




 "Caution" indicates that either the servo motor or the ultrasonic sensor is not working properly. If someone manages to trespass into the safety limits and attempted to disable the sensor, the caution light will be turned on. In addition, the speaker will produce a loud buzz every second, until the ultrasonic sensor is enabled.

"Danger" indicates that an object is detected within safety limits. The alarm will then be triggered and the sonar screen will no longer update itself. A hard reset will be required to restart the sonar display.





This is my most proudest invention yet and over time, I will add more features. The speaker is not very punishing so I want to add something else that will PUNISH anyone where dares to enter the safety limits. What I have in mind is a sentry bb gun, which will shoot the intruder. The next step is to add motion tracking. Unfortunately, none of this will be accomplished(yet). I'm missing lots of materials and if you were to check my current balance (project 15: Digital Piggy Bank), my wallet is practically empty.

Thursday, 8 August 2013

Project 16 (Moderate): Ultrasonic Alarm System (Version 1)

This is my favorite project yet. I've created a motion detector that scans the room and if it detects any object within 25cm, the speaker will go nuts.


As for the alarm, a piezo buzzer is not very loud. so I went to a local electronics store and bought new speakers + an audio amplifier. An audio amplifier pretty much converts small inputs and outputs something much bigger. The arduino digital pin can only output 5 volts and any more would damage the board. In order to make the speaker louder, I need more voltage. That's where the audio amplifier comes in.












At first, the arduino board was suppling all the power but I noticed that the LCD display was flickering.
Due to the high power requirements, I need an external power source. A 9 volt battery will be powering the audio amplifier, which means the speaker will be even louder than before. 4 AA batteries(about 5 volts) will power the servo motor. The arduino will only be powering the LCD display and the ultrasonic sensor. With this setup, the LCD display is no longer flickering!

Features:
- an ultrasonic sensor, mounted onto a servo motor will scan for nearby objects(can detect objects up to 3 meters away!)
- the distance will be displayed on a LCD display
- once the alarm is triggered, "INTRUDER ALERT!!" will be displayed on the LCD

Parts:
- 1x ultrasonic sensor
- 1x servo motor
- 1x RGB LCD display (16 X 2)
- 1x 8 ohm speaker (0.25 watt)
- 1x 10k potentiometer
- 1x lm386
- 1x 220uf capacitor
- 1x 9v battery and a battery holder (to power the audio amplifier)



Scanner Limits

The ultrasonic sensor has a range from 2cm to 3 meters. Also, I noticed that the sensor has issues detecting corners. This is because the sound waves emitted from the sensor will bounce off the surface at an angle. Instead of going directly back to the sensor, it will then bounce off another surface, and then back. Thus it will take a lot longer for the sensor to read the sound. The longer it takes to read the sounds, the farther the distance is. Also, any object that can absorb sound(ex. sponges) will disrupt the readings.

Tuesday, 6 August 2013

Project 15 (Moderate): Digital Piggy Bank

Detecting a coin and its weight can be complicated and expensive. I came up with several solutions to this problem. One of which, I tried to create a switch out of aluminum foil. Whenever a coin is inserted, it will cause the aluminum foil to come in contact, and therefore completing the circuit. However, this switch is too big for my tiny piggy bank.












I decided to use a photoresistor as a "coin detector". When the arduino is powered up, it will go through a calibration state. During this phase, the arduino will be recording the light intensity for about 5 seconds and after that, it will calculate the average light intensity. Finally, the arduino will now accept coins. Once coin is inserted, the light intensity will change. This is a very basic way of detecting a coin. 









As of right now, I don't know how to create a simple and efficient way to detect what kind of coin is inserted. So instead, I'll create a user interface to record the deposit. This will consist of 5 buttons. Each button will represent a state (see picture on the left). The LED will indicate which state you are in. From left to right, the states are $0.05, $0.10, $0.25, $1.00 and $2.00.

Once the state has been determined, simply insert the coin and your deposit will be incremented by the amount specified.




features:
- 5 buttons (5 cent, 10 cent, 25 cent, 1 dollar, 2 dollar)
- 5 LED's will represent each button to identify the current state  
- current balance will be displayed on LCD
- savings will be recorded and saved (unless the power is turned off)
- a photoresistor will be used as a coin detector



Parts:
- 5x red LEDs
- 5x 330 ohm resistor
- 5x pushbuttons
- 6x 10k ohm resistor
- 1x photoresistor
- 1x RGB LCD (16 x 2)
- 1x 10k potentiometer


Using a photoreisstor as a coin detector can cause some problems. For example, suppose the arduino is running its calibration in a very bright room. When the calibration period is over, turning off the lights will confuse the arduino and it will think that a coin is constantly being inserted. This is because the arduino is comparing the average light intensity during the calibration period with the current light intensity. When there is a significant difference between these light intensities, the balance will be incremented. 

Sunday, 4 August 2013

Project 14 (Novice): Ultrasonic Distance Sensor

My ultrasonic sensor finally arrived in the mail. Time to make a reliable distance sensor.

features:
- capable of detecting an object up to 3 meters!
- the distance (in cm) will be displayed on a LCD

parts:
- 1x ultrasonic sensor
- 1x RGB LCD (16 X 2)
- 1x 10k potentiometer













 I have great plans for this magnificent sensor.

project 12 (Novice): stopwatch

I finally got my LCD to work and used it to make a simple project.


Features:
- a pause button, which pauses time
- a reset button, sets the timer to 00:00
- the reset button can also start the timer


Parts:
- 1x RGB LCD (16 X 2)
- 2x pushbuttons
- 2x 10k ohm resistor
- 1x 10k potentiometer
 

Using an LCD display was a lot easier than using a 7 digit segment display. Also, the LCD is simply stunning, so I don't think I'll use a 7 digit segment display again.




Project 11 (Moderate): TV-B-GONE

This is one of the coolest gadgets I've ever made. For those who didn't know, tv-b-gone is a device that turns off ANY tv. Visit the tv aisle at best buy, whip this gadget out and watch as each tv shuts down. If you are brave enough, go to a sports bar during a very important match and .... (you get the idea).

If you want to make your own tv-b-gone, visit this link. The author made an excellent tutorial and even provided their code!


Project 10 (Novice): Annoying Beep

After salvaging an IR receiver from an old satellite receiver, I came up with a simple application with some annoying results.


Features:
- Press any button on the remote and an annoying beep will be heard















Parts:
- 1x piezo buzzer
- 1x IR reciever


This is what the camera sees
This is what our eyes see







How does it work? It's actually very simple. Once the IR receiver detects infrared light, (in this case, the IR light comes from the remote control) the arduino will trigger the buzzer. Our eyes cannot see infrared light but the IR receiver and most cameras can.