My SEN0188 sensor stopped work after some using - arduino

I bought SEN0188 sensor and I tried to use but it gives the error: "Did not find fingerprint sensor :(". After some search and datasheet checking, I found an error and updated "FINGERPRINT_VERIFYPASSWORD". After some usage and testing I finished the project, I put it in a box and after some trying, I again got "Did not find fingerprint sensor :(". I checked my code, wiring schematic, etc.. But it doesn't work.
Library: github.com/adafruit/Adafruit-Fingerprint-Sensor-Library/
#include <Adafruit_Fingerprint.h>
#if (defined(__AVR__) || defined(ESP8266)) && !defined(__AVR_ATmega2560__)
SoftwareSerial mySerial(2, 3);
#else
#define mySerial Serial1
#endif
Adafruit_Fingerprint finger = Adafruit_Fingerprint(&mySerial);
void setup()
{
Serial.begin(9600);
while (!Serial); // For Yun/Leo/Micro/Zero/...
delay(100);
Serial.println("\n\nAdafruit finger detect test");
finger.begin(57600);
while (true) {
if (finger.verifyPassword()) {
Serial.println("Found fingerprint sensor!");
break;
} else {
Serial.println("Did not find fingerprint sensor :(");
delay(1000);
}
}
}
void loop() {}

Related

Could not find a valid MPU6050 sensor

I am using the below code with arduino-uno, but often getting "Could not find a valid MPU6050 sensor
#include <Wire.h>
#include <MPU6050.h>
MPU6050 mpu;
void setup() {
Serial.begin(115200);
Serial.println("Initialize MPU6050");
while (!mpu.begin()) {
Serial.println("Could not find a valid MPU6050 sensor, check wiring!");
delay(500);
}
}
void loop() {
}
My Arduino is working fine,
So, I checked MPU6050 using below code,
#include <Wire.h>
void setup()
{
Wire.begin();
Serial.begin(115200);
while (!Serial); // Leonardo: wait for serial monitor
Serial.println("\nI2C Scanner");
}
void loop()
{
byte error, address;
int nDevices;
Serial.println("Scanning...");
nDevices = 0;
for(address = 1; address < 127; address++ )
{
// The i2c_scanner uses the return value of
// the Write.endTransmisstion to see if
// a device did acknowledge to the address.
Wire.beginTransmission(address);
error = Wire.endTransmission();
if (error == 0)
{
Serial.print("I2C device found at address 0x");
if (address<16)
Serial.print("0");
Serial.print(address,HEX);
Serial.println(" !");
nDevices++;
}
else if (error==4)
{
Serial.print("Unknown error at address 0x");
if (address<16)
Serial.print("0");
Serial.println(address,HEX);
}
}
if (nDevices == 0)
Serial.println("No I2C devices found\n");
else
Serial.println("done\n");
delay(5000); // wait 5 seconds for next scan
}
Got Output as expected
Scanning...
I2C device found at address 0x68 !
done
From the above output I hope GPU6050 is working
How can I get values from GPU6050?
Your code is working as expected, it tells you in setup() when it can't connect to the device, until it can.
So when it stops printing the message, it is connected.
Now in loop() you should write your code to negotiate with the device.
Here's an excellent place to start with.

Simple HC-05 bluetooth android communication

Im trying too simply communicate between my android phone and my arduino using the HC-05 bluetooth module.
While my module works and i am able too send and receive data on my phone, the data of my btData variable seems too instantly get lost after being received. On my android app i get the input data output like written in my code and then instantly an empty output/line.
Writing "1"/"off" into my console does not trigger my if(btData == "1")... part of the code.
I have attached my code, aswell as the android terminal and my arduino HC-05 connection.
android terminal
arduino with wiring
Hopefully someone is able too help since i cant find any error.
#include <SoftwareSerial.h>
#define rxPin 10
#define txPin 11
SoftwareSerial btSerial(rxPin, txPin);
String btData;
void setup() {
btSerial.begin(9600);
btSerial.println("bluetooth available");
}
void loop() {
if (btSerial.available()) {
btData = btSerial.readString();
btSerial.println(btData);
if (btData == "1") {
btSerial.println("LED on Pin 13 is on");
}
if (btData == "off") {
btSerial.println("LED on Pin 13 is off");
}
}
delay(100);
}
Could it be that the data that is being sent has a new line character at the end of the string?
This is why you are seeing the empty line after the data that you have sent.
A possible solution might be:
void loop() {
if (btSerial.available()) {
btData = btSerial.readString();
btData.trim()
btSerial.println(btData);
if (btData == "1") {
btSerial.println("LED on Pin 13 is on");
}
if (btData == "off") {
btSerial.println("LED on Pin 13 is off");
}
}
delay(100);
}

ESP8266 not detectable

It's my first time trying out the esp8266 on the arduino uno, using the ITEADLIB_Arduino_WeeESP8266 library. However I am not able to get anything done, not even wifi.getversion().
Here's the Serial Monitor output
setup begin
FW Version:
to station err
Join AP failure
setup end
(forever loop)
And here's the code
#include "ESP8266.h"
#include <SoftwareSerial.h>
SoftwareSerial mySerial(3, 2); /* RX:D3, TX:D2 */
ESP8266 wifi(mySerial);
#define SSID "AndroidAP"
#define PASSWORD "12345678"
void setup(void)
{
}
void loop(void)
{
Serial.begin(9600);
Serial.print("setup begin\r\n");
Serial.print("FW Version: ");
Serial.println(wifi.getVersion().c_str());
if (wifi.setOprToStation()) {
Serial.print("to station ok\r\n");
} else {
Serial.print("to station err\r\n");
}
if (wifi.joinAP(SSID, PASSWORD)) {
Serial.print("Join AP success\r\n");
Serial.print("IP: ");
Serial.println(wifi.getLocalIP().c_str());
} else {
Serial.print("Join AP failure\r\n");
}
Serial.print("setup end\r\n");
Serial.println("");
delay(10000);
}
I followed the instruction on the github readme, and the led on the esp8266 is on the whole time, so I guess it is not a wiring issue. Is it possible that the 8266 is dead?
You may try this Serial.begin(115200);

simple communication between AtTiny85 and Arduino (I2C)

Hi I want to connect the arduino pro mini to my AtTiny85 over I2C.
The arduino should tell the attiny to switch a LED on or off.
The arduino manages to switch the led on my attiny on but it never goes off.
I don't have any clue why?
Here is my Code for master and slave:
MASTER:
#include <Wire.h>
#define device (1)
void setup() {
// put your setup code here, to run once:
Wire.begin();
}
void loop() {
// put your main code here, to run repeatedly:
Wire.beginTransmission(device);
Wire.write(1);
Wire.endTransmission();
delay(2000);
Wire.write(0);
Wire.endTransmission();
delay(2000);
}
SLAVE:
#include <TinyWireS.h>
#include <usiTwiSlave.h>
#define output (4)
#define I2C_SLAVE_ADDR (1)
void setup() {
// put your setup code here, to run once:
TinyWireS.begin(I2C_SLAVE_ADDR);
pinMode(output, OUTPUT);
}
volatile byte msg = 0;
void loop() {
if(TinyWireS.available())
msg = TinyWireS.receive();
if(msg == 1)
digitalWrite(output, HIGH);
else if(msg == 0)
digitalWrite(output, LOW);
else
msg = 0;
}
I finally found my mistake:
when I do: Wire.write(0); I forgot to start the transmission with: Wire.beginTransmission(device);

How to read SMS from arduino Gboard

// libraries
#include <GSM.h>
// PIN Number
//#define PINNUMBER ""
// initialize the library instance
GSM gsmAccess; // include a 'true' parameter for debug enabled
GSM_SMS sms;
char remoteNumber[20]; // Holds the emitting number
void setup()
{
// initialize serial communications
Serial.begin(9600);
Serial.println("SMS Messages Receiver");
// connection state
boolean notConnected = true;
// Start GSM shield
// If your SIM has PIN, pass it as a parameter of begin() in quotes
while(notConnected)
{
if(gsmAccess.begin()==GSM_READY)
notConnected = false;
else
{
Serial.println("Not connected");
delay(1000);
}
}
Serial.println("GSM initialized");
Serial.println("Waiting for messages");
}
void loop()
{
char c;
// If there are any SMSs available()
if (sms.available())
{
Serial.println("Message received from:");
// Get remote number
sms.remoteNumber(remoteNumber, 20);
Serial.println(remoteNumber);
// This is just an example of message disposal
// Messages starting with # should be discarded
if(sms.peek()=='#')
{
Serial.println("Discarded SMS");
sms.flush();
}
// Read message bytes and print them
while(c=sms.read())
Serial.print(c);
Serial.println("\nEND OF MESSAGE");
// delete message from modem memory
sms.flush();
Serial.println("MESSAGE DELETED");
}
delay(1000);
}
Error: GSM_SMS does not a name type....
so i don't understand what actually error is......plz give me a proper answer.
exactly, i want to read SMS using arduino Gboard and doing led on or off through mobile.
Try to download the last arduino software arduino-1.0.4 and check again the code.
Please try 1.0.4 (http://arduino.cc/en/main/software) , 1.5.2 is beta. If i wrong sorry...

Resources