Hot answers tagged

14

Sorry, no Arduino required, but you probably already have a web cam on your desktop. If you don't mind being observed like Schrodinger's Cat, you can use a small utility like YawCam in Windows or Motion on Linux to trigger the screen lock when you are no longer visible at your console.


9

Bluetooth! In the same vein as Gerben's comment, it is quite easy to use your phone for this, assuming that both your PC and your phone have bluetooth (and you take your phone with you, when you leave your seat). Moreover, if your PC does not have BT, cheap BT dongle will solve this. Next step is writing a script that gets a list of all nearby/found BT ...


8

RFID (NFC) might be the way to go. Have an RFID tag in a wristband and an RFID reader by the side of (or under) your keyboard. As long as you keep your hands close to the keyboard the RFID reader should detect your wristband. When it doesn't sense it for a pre-defined period of time send a signal to the PC to trigger it to lock. It could then trigger the ...


6

If you chair has a gas cylinder to adjust height, it sinks a bit when sat in. My dip is about a centimeter. That's more than enough for a beam-interruption or reflection sensor, a hall effect sensor, or even a dead-simple magnetic reed switch, like those used by home alarms to monitor windows. You could have the reed switch turn on/wake up a micro like an ...


5

You need to solder those headers to the breakout. Just inserting them into the plated-through-holes doesn't give a reliable connection.


5

At a previous job we also had the rule that the screen had to be locked (usually done by pressing Win+L). However, there was no pizza; instead, the computer was used to send mass e-mails to colleagues. The topics of the e-mails was as varied as the imaginations of people: invitations to various events; invitations to various celebrations at the desk of ...


5

As @Majenko commented, the A0 input has a fixed voltage divider (see NodeMCU Schematics) that connects the A0 input to a 220kOhm resistor, then to the ADC pin of the ESP8266, then to ground via a 100kOhm resistor. This effectively fixes the resistor values that can be used to scale the input of the NodeMCU. For a 0-5.0V input range (with sufficiently low ...


4

A signal is just a varying voltage. A wire is just a (very long) small resistor. The device reading the signal is just a current sink. That's three terms there: voltage, resistance, and current. Three terms you should know are related by Ohm's Law. Also, some simple rules: The thinner the wire the bigger the resistance The longer the wire the bigger the ...


4

First things first; please INDENT YOUR CODE. The code you posted is a mess and I took at least double the time to fix that. First, you have an extra closing curly bracket at line 17 and the if (Fire == High); should be changed to if (Fire == High){ Fixed code: int Led = 4; int Buzz = 7; int Sensor = 11; int Fire = HIGH; void setup() { Serial.begin(9600)...


4

A single distance sensor, properly placed, should be enough to detect when you leave. That's the arduino part. With python you can then use the serial over USB to read the output from the arduino. And run the command to activate the screen lock, according to your reading.


3

The 9V wall adapter is in most cases a switched power regulator with a high frequency. That's like a radio transmitter direct beside the wire. So there is nothing mystical, when the smooth USB Voltage does not show problems but the "radio transmitter" does. There are two ways the power supply can impact: over radio wave or as ripples over the regulated ...


3

You are wasting a lot of power in your system. You need to be far more efficient when running off battery. Don't boost your battery voltage to 5V. Instead use a system that runs entirely at 3.3V. Never use a linear voltage regulator like the AMS1117 since it just wastes power as heat. Instead use a switching "buck" regulator. Turning off modules when not ...


3

This looks like something out of an Arduino n-part “sensor kit”. It’s hard to tell because the quality of the image is not very good. My guess is, this is an analog temperature sensor, like in this link, part number 18. You can also find an example sketch there.


3

You need either a memory extension for your UNO - projects like Arducam did this way back 2016 and then used an OV2640 module. If you want to develop something yourself these are the steps (hurdles) to take: Get a datasheet of the camera Design a circuit including plug for Camera and a memory module (min 512Kb) Attach it to the UNO Write a library/...


2

In the specification sheet linked to in the post we find this: -30+/-10nA/ppm This is a very small amount of current. The Arduino ADC is a voltage sensing device and (unless modified) has a range of 0 to the operating voltage of the Arduino. Usually 3.3V or 5V. Converting nano Amps to that range of voltage will require additional hardware. A stock ...


2

As I googled the sensor, I found various sites stating, that a JSN-SR04T behaves exactly like the HC-SR04. The difference is mainly the water prooving. So the answer is: No, you can't do this. The square wave, which drives the ultrasonic transducers, is generated by a hardware circuit and is not meant to be changed. To output a chirp wave you would need to ...


2

If the sensor does provide two defined voltage levels, you do not need a pullup or pulldown resistor, but if it's only a switch: either (closed) connected to Vcc or GND, or (open) not connected, you need a pullup or pulldown resistor to get a defined voltage level in case there's "nothing else" (except the wire to the switch catching noise out of the air) ...


2

I realize that power is flowing the entire time the switch is open, which may (or may not) drain the battery. No, it doesn't. You get a small spike as the switch is opened or closed, as the gate capacitance is charged or discharged, but other than that there is negligible current draw by a pin, which remains static regardless of the direction of the biasing ...


2

The input current does not depend on the pin level. Have a look at this discussion from avrfreaks. The input impedance of a digital pin is extremely high. The leakage current of the Atmega328P (here as example chip) is mentioned to be 1uA for both pin states. So this current is both unavoidable and neglectable from a normal view. But the input impedance of ...


2

If the provided source is cut down to the lines that have to do with the temperature, it is just this. If you try this sketch it should behave equally "wrong": const int sensor = A5; int tempc; float vout; void setup() { vout = analogRead(sensor); pinMode(sensor, INPUT); } void loop() { lcd.print(tempc); tempc = (vout * 500) / 1023; } In ...


2

GPIO12 must not be pulled high during boot. It's possible there's a pull-up resistor on the BME680 breakout board you're using that's pulling SCK high and interfering with the boot process. I would avoid using GPIO12 here. If you're out of pins on the ESP32 you can connect the BME680 via I2C rather than SPI. I2C only needs SDA and SCK (and power and ground, ...


2

Here is an example of some code I used to read two encoders using pin change interrupts. This is possible to do with one ISR since they all share a common port. The key is it has to be short. As long as you can keep all 6 pins from your encoder on the same port, this should be easy to extend to 3 encoders. It might even work for four on one port. Or you ...


2

Place a ultrasonic distance sensor HC-05 close to your monitor, facing towards your chest. Check the distance measured against a defined threshold (potentiometer?) and send a key press to your PC to lock it if it is exceeded. I can go into more details if wanted, it's actually a project I thought about implementing before. Edit: Whoops, @Eduardo Trápani ...


2

Most PIR sensors provide a simple relay output. That means they are nothing more than a switch as far as the Arduino is concerned. You can connect hundreds of switches to an Arduino. With judicious use of diodes and a matrix arrangement you can hundreds with not many IO pins. For example an 8x8 matrix of switches gives you 64 PIR sensors with just 16 IO ...


2

Can you make Arduino Uno send information through a WiFi module to a server? Yes, I can. The simplest way is through an HTTP "GET" request. Every time you request a web page (and there are plenty of examples of that) you are sending data to the server to tell it both what web page to get (/foo/bar.php) and what data to submit to that web page (?baz=4). It'...


2

your updateDirection logic doesn't quite work the way you think it does. after a bit of code formatting and comments it looks like this: void updateDirection() { if (distanceInchR < minDistanceInch && distanceInchL < minDistanceInch) { if (movement != BACK) { backUp(); } else if (distanceInchR < ...


2

About the fingerprint sensors from mobile phones: You might find the answers to this question useful. They explain in detail, why it is not really worth the effort to try interfacing such a fingerprint sensor with Arduino. How to use any module that has no library for arduino? You need to read the datasheet of the module. It should explain in detail, how ...


2

You have far too many variables and unknowns there. Primarily you need to know what the average current draw for your circuit is. Secondly you need to decide how long the solar powers are allowed to take to recharge the battery. You have to think not only about runtime but also charge time. The charge time dictates the maximum capacity of the battery, and ...


2

there are a few DIY, open source armband or watch models like : https://www.tindie.com/products/ttgo/t-wristband-diy-programmable-smart-bracelet/ which has the sources and tutorials on : https://github.com/Xinyuan-LilyGO/LilyGO-T-Wristband it's based on ESP32 and is Arduino ready.the space constraint may not allow for adding a new sensor, but it already ...


2

This is not a complete answer, but an idea of how to accomplish the task. I just typed it in without testing the code. Use arrays to hold variables. That way a loop can be used to service the three sensors and the three LEDs.. for (i = 0; i<3; i++) { currentTime = millis(); // ...


Only top voted, non community-wiki answers of a minimum length are eligible