Is the Key There?

by regele in Circuits > Microcontrollers

327 Views, 0 Favorites, 0 Comments

Is the Key There?

FSNOIHGKUTTAHHF.jpeg

It is often the case that several people use a common key for a device, e.g. car key, locker key, cellar key. It’s annoying when I go for the key but it’s not in the closet. To solve this problem, our idea is to ask remotely with our cell phone if the key is in it's place?

There is a sensor in the key box that monitors if the key is in front of it. The micro: bit to which the sensor is attached, sends a signal to the phone via bluetooth. On the mobile phone, a green key image is displayed if the key is there, red if it is not there.

Supplies

micro_bit_V2.png
TCRT5000.jpg
samsung.png
crocodile_clip_wire.png
  1. BBC micro:bit - 1 pc
  2. TCMT5000 IR tracking sensor - 1 pc
  3. Crocodile clip wire - 3 pcs
  4. Mobilphone - 1 pc

Installing the Sensor

sensor.jpg

Buy or make a key box. Drill under the key hanger so that the sensor can detect the presence of the key. The TCMT5000 sensor emits an infrared light beam and its sensor detects rays reflected from the key. Position the sensor so that the blue and the black tracking sensor can light into the hole.

Attach the Microbit

microbit.jpg

Attach the microbit to the top of the cabinet.

Assembling the Circuit

Line-Tracking-Sensor_legs.jpg
circuit.PNG

Use crocodile clamp wires to connect the sensor to the microbit. Connect the VCC or V + pin of the supply voltage to 3V, the G pin of the ground to GND, and the S pin of the signal to P0.

Microbit Programming

microbit1.PNG
microbit2.PNG
microbit3.PNG

The goal of the microbit program is to send the read sensor's value P0 feet via UART channel to the mobile phone via Bluetooth. The sensor gives 0 if it does not see the key, 1 if it feels hooked there.

I also attached the program in * .HEX.

Mobile Phone Application

mobil1.PNG
mobil2.PNG
mobil3.PNG
mobil4.PNG
mobil5.PNG

The aim of the application is to receive the signals coming from the UART and change the color of the key on the display accordingly. The characters come in ASCII code, enclosed in parentheses. For example, the signal is transmitted: 0 as (48) and 1 as (49).


And it's done! Have fun building!

György Regele

Hungary