Emilio Ricciardelli
SPAIN • + Follow
Edit Project
Tools, APP Software Used etc.
|
EagleAutodesk
|
Description
BT Smartphone detector
A simple USB device which when energized detects your Smartphone. If not detected, beeps. Used as a reminder in my car as I often forget the phone at home or at the office ;)
Code
Arduino code for ATTINY85 chip
C/C++
/*
1 (PB5) - - (Vcc) 8
2 (PB3) - - (PB2) 7
3 (PB4) - - (PB1) 6
4 (GND) - - (PB0) 5
PB5 -> 10
PB0 -> 11
PB1 -> 12
PB2 -> 13
REV. 2-7-2019
*/
#include <avr/sleep.h> // Sleep Modes
#include <avr/power.h> // Power management
//#include <SoftwareSerial.h>
//SoftwareSerial Monitor(5, 4);
#define POWER 3 //pin 2 - used to turn-on the BT module
#define BUZZER 1 //pin 6
#define PULSE_IN 2 //pin 7
int duration = 0;
void setup() {
pinMode(BUZZER, OUTPUT);
pinMode(POWER, OUTPUT);
pinMode(PULSE_IN, INPUT);
// used for serial
/* pinMode(0, OUTPUT);
pinMode(4, OUTPUT); // --> TX
pinMode(5, INPUT); // --> RX
Monitor.begin(9600);
*/
digitalWrite(POWER, HIGH);
digitalWrite (BUZZER, HIGH);
//wait fot BT to come up
delay(20000);
}
void loop() {
duration = pulseIn(PULSE_IN, LOW) / 100;
if (duration > 0) {
for (int i = 0; i < 30; i++) {
beep(500, 100);
}
//turn off BT
digitalWrite(POWER, LOW);
pinMode(POWER, INPUT);
sleep();
}
else {
//turn off BT
digitalWrite(POWER, LOW);
pinMode(POWER, INPUT);
sleep();
}
}
void beep(unsigned char delay_ms, unsigned char duration) {
analogWrite(BUZZER, duration); // Almost any value can be used except 0 and 255
// experiment to get the best tone
delay(delay_ms); // wait for a delay ms
analogWrite(BUZZER, 0); // 0 turns it off
delay(delay_ms); // wait for a delay ms
}
void sleep() {
set_sleep_mode(SLEEP_MODE_PWR_DOWN);
ADCSRA = 0; // ADC off
power_all_disable();
sleep_enable();
sleep_cpu(); // sleep
}
Schematic and Layout
Nov 02,2021
607 views
BT Smartphone detector
A circuit to detect the absence of a Smartphone. Will beep when plugged in and your Smartphone (or whatever BT device) it's not in range.
607
0
0
Published: Nov 02,2021
BOM(Bill of materials)
Purchase
Donation Received ($)
PCBWay Donate 10% cost To Author
Copy this HTML into your page to embed a link to order this shared project
Copy
Under the
Attribution-ShareAlike (CC BY-SA)
License.
- Comments(0)
- Likes(0)
You can only upload 1 files in total. Each file cannot exceed 2MB. Supports JPG, JPEG, GIF, PNG, BMP
0 / 10000
Remove
It looks like you have not written anything. Please add a comment and try again.
View More
View More
VOTING
0 votes
- 0 USER VOTES
0.00
- YOUR VOTE 0.00 0.00
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
Design
1/4
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
Usability
2/4
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
Creativity
3/4
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
Content
4/4
More by Emilio Ricciardelli
- 8 relay IOT board with ESP32 The board contains:8 relays board1 ESP32-WROOM-32D microcontroller1 onboard power supply. 100-240V A...
- 8 Relay Board for Raspberry Zero, B or 4 Simple 8 relay board to accomodate a Raspberry board5V @ 3A input.Discreate componests.On board powe...
- BT Smartphone detector A simple USB device which when energized detects your Smartphone. If not detected, beeps. Used as a ...
You may also like
-
-
-
3D printed Enclosure Backplate for Riden RD60xx power supplies
82 1 1 -
-
-
-
Sega Master System RGB Encoder Switcher Z80 QSB v1.2
71 0 0 -
18650 2S2P Battery Charger, Protection and 5V Output Board
107 0 0 -
High Precision Thermal Imager + Infrared Thermometer | OpenTemp
531 0 7 -
Sony PlayStation Multi Output Frequency Oscillator (MOFO) v1
148 0 2 -