Recent Posts

Pages: [1] 2 3 ... 10
This motor runs at 3.7V and I added a voltage divider between the oinboard 5V regulator and the motor to drop it. Unfortunately, this does not work and the motor causes the voltage to drop for some reason.
The "some reason" is that the servo tries to draw a fairly large current through the top resistor of the voltage divider and all the voltage drops across that resistor. Voltage dividers only work if the current drawn from them is very low compared to the current going through them.

All the examples of the IDE on MPU6050 work when the AD0-pin of the sensor is connected to GND. That means that the MPU6050.h file has keyed 0x68 as the device address.

Because you have the DS3231 in the project with the same address, you may try to do the following to change the address of MPU6050 to 0x69. I have tried this and it works.

File Explorer ---> C:\ ----> Users ---> GM (your computer name) ---> Documets ---> Arduino ---> libraries ---> Arduino-MPU6050-master ---> MPU6050.h and click to open

Down somewhere you will find this line :
#define MPU6050_ADDRESS             (0x68) // 0x69 when AD0 pin to Vcc

Just write 0x69 in palce of 0x68, save the file and exit.

Don't forget to connect AD0-pin of MPU6050 with 5V.

This is the test program with device address 0x69 to monitor room temperature and show on Serail Monitor..
Code: [Select]
    MPU6050 Triple Axis Gyroscope & Accelerometer. Temperature Example.
    Read more:
    (c) 2014 by Korneliusz Jarzebski

#include <Wire.h>
#include <MPU6050.h>

MPU6050 mpu;

void setup()
  Serial.println("Initialize MPU6050");

  while(!mpu.begin(MPU6050_SCALE_2000DPS, MPU6050_RANGE_2G))
    Serial.println("Could not find a valid MPU6050 sensor, check wiring!");

void loop()
  float temp = mpu.readTemperature();

  Serial.print(" Temp = ");
  Serial.println(" *C");

It assumes that the complete message is in fullMsg and that you've declared an array of strings called msgField.
It is not a good idea to use the String (capital S) class on an Arduino as it can cause memory corruption in the small memory on an Arduino. Just use cstrings - char arrays terminated with 0.

Hello, I need to do a project in which the camera OV5640 Camera Board (B) is connected to the NodeMCU board in order to take pictures with the camera and then see them in a web page with the wifi function of the ESP8266MOD. Before writing this publication I tried to gather information, but I did not find anything similar in terms of connections and, most importantly, the sketch. My knowledge of Arduino is quite limited. I hope that one of you will help me carry this out. If anyone knew how to make the sketch and the connections, I would appreciate it if you would pass it on to me. Next, I show you a picture of the two modules I have.
Storage / Adding an unrelated simple IF ...
Last post by DanielSolis - Today at 10:05 am
Hi there,

I've been working on a people counter. I am using (all generic Arduino compatible devices from Banggood) an Arduino Nano, a couple of IR receiver and a micro SD module. The involved library is SD.h v1.2.2   The section I would like to focus is this one (I deleted code that is not useful to see what the issue I ran into):

Code: [Select]
void loop() {
   for (int i = 0; i < RECEIVERS; i++)
    statusPin[i] = digitalRead(2+i);
    if (statusPin[i]==0)
     if ((millis()-previousMillis[i]>150)&&(millis()-previousMillis[(i+1) % 2]>150))
          if (i==0)

void LogToSD(){
    DateTime now =;   
[b]    File dataFile ="dwvisit.csv", FILE_WRITE);
[/b]  if (dataFile) {
    Serial.println("error opening dwvisits.csv");

Everything was working like charm, but I had room for improvement in terms of accuracy, so that I added a third condition in an IF:

Code: [Select]
if ((millis()-previousMillis[i]>150)&&(millis()-previousMillis[(i+1) % 2]>150)[b]&&(previousMillis[i]<previousMillis[(i+1) % 2])[/b])

and voila! Most of the time, it cannot initialize the micro SD card, when it does, it cannot create the file or creates it but then cannot write on it. If I delete the third condition or add a dummy condition, like 2<3, it works again. I did it a several times with the same result: without the 3rd condition, it works, with the 3rd condition, this part in LogToSD() doesn't work:

Code: [Select]
    File dataFile ="dwvisit.csv", FILE_WRITE);

I cannot make sense of it. The micro SD worked fine in the computer and with my camera.

Now it becomes weirder. After a week switching between codes, the one that worked started to stop working just after re-loading it, I had to upload it twice in order for the SD to work (after that, it kept working). Today, after giving up searching solutions and trying lots of tweaks, I decided to come back to the original code, but it no longer worked (not even with a good brand micro SD I borrowed from my camera). I decided then to try formatting the SD with the Formatter utility recommended in this forum (Note: the SD was working, I could open and edit the files in it), but after starting the formatting (BTW, I didn't find any single format option in the software, while here, several are mentioned), error message, and that was it. I tried again, nothing. I tried to format it with the Windows utility, nothing, error. I ended up with no counter and a broken SD.

I already ordered a new SD and different SD Module from different manufacturer. Do you think it can be related to defective hardware? I read that generic SD module from Banggood is problematic, but that doesn't explain why a logic condition in an IF affects the SD and why Formatter killed my micro SD.





On trouve sur les sites Chinois classiques à des prix  bas des cartes avec des relais et optocoupleurs qui font parfaitement l'affaire pour commander des unités de puissance (statiques ou mécaniques).

Le mode "historique" qui est celui paramétré par défaut sur le linky est le même que pour les anciens compteurs électroniques (Landys...).

Par contre, sur demande, le linky peut être paramétré en mode "standard" qui est fort différent.
Je vous invite à lire le doc "Enedis-NOI-CPT_54E".

On peut aussi prévoir pour la suite des entrées de capteurs de courant pour compléter un système complet de gestion de l'énergie.


If you run the Uno from a 10-12V supply via the 2.1mm power jack the this voltage (less a 0.6V diode drop) is available at the VIN pin on the Uno to power your sensor. Don't forget to add a 47k ohm load resistor between the sensor output and ground as per the sensor data sheet.

The following code will work:-

Code: [Select]

int sensorVal = 0;

sensorVal = analogRead(sensorPin);

if (sensorVal > 205) {
   digitalWrite(digitalOut, HIGH);
else {
   digitalWrite(digitalOut, LOW);

But this will be more stable as it requires a distinct change in the value before the output changes state (this is known as hysteresis):-

Code: [Select]

int sensorVal = 0;

sensorVal = analogRead(sensorPin);

if (sensorVal > 210) {
   digitalWrite(digitalOut, HIGH);
if (sensorVal < 200) {
   digitalWrite(digitalOut, LOW);

Any value between 200 and 210 will leave the current state unchanged. Adjust the boundary values around the 205 figure to suit you application.

Hope this helps.


Software / Re: gps logger a comando
Last post by gpb01 - Today at 10:04 am
NON entro nel merito del tuo pogramma, ma ti segnalo che stai usando gli "interrupt" in modo errato ...

Una ISR (la routine chiamata dall'interrupt) DEVE essere la più breve possibile, NON deve usare delay, porta seriale ed altro (... studia QUI) e deve terminare il prima possibile ... con queste premesse capisci da solo che, la cosa migliore, è che la ISR, quando scatta, semplicemente alzi una "flag" per indicare l'avvenuto interrupt ed esca.

E' poi nel loop() che si controlla tale "flag" e che si fa ciò che si deve fare se la si trova attiva.

Vedi quindi di modificare in tal senso il tuo programma ed inserisci un "debouncing" hardware sul tuo pulsante, dato che, con le ISR, NON si deve fare via software.

Hardware / Re: Nuvola Rilevatori Temperat...
Last post by Riker1312 - Today at 10:04 am
Devi solo chiarirti le idee:
se usi un sensore come il DHT22 puoi collegarlo "anche" a un centinaio di metri da Arduino, ma se usi un sensore I2C allora hai solo qualche centimetro...

La mia idea è questa:
realizzare un "oggetto" da collegare in prossimità di fonti di alimentazione esistenti (lampade di emergenza) che tramite la WiFi che copre tutto il capannone invii con scadenze determinate i dati sul server.

Quindi mi immagino un Wemos + un sensore (da decidere quale) + un mini alimentatore tutto racchiuso in un piccolo contenitore.

Quindi il sensore sarà comunque "vicinissimo" al WeMos devo solo decidere come cablarlo nel contenitore perché rilevi temperature non falsate dal resto dell'hardware.

Oggi dovrebbe arrivarmi il WeMos e inizio le prove...
Code: [Select]
  char buf[1024]
Are you sure that the buffer is big enough? What configuration information requires a buffer that big? Do you have a stupidly long password?

Code: [Select]
    //no free/disconnected spot so reject
    WiFiClient tcpConfigClient = tcpServer->available();

There are no available connections, so get an available one, and stop it. How is THAT supposed to work?

Code: [Select]
The epitome of stupidity.

You might have better luck at
Pages: [1] 2 3 ... 10