What is destroying my arduinos?

Hello,

I currently have 2 arduinos and they both were destroyed in less than a week. They both still run the program, but when I try to upload something I get an error and the arduino just resets itself. The only thing they were supposed to do is sending 7 pwm signals , reading a temperature and time(rtc) and controlling 2 transistors (with 1k resistor).
Does anyone knows why they both are broken?

Regards

The only thing they were supposed to do is sending 7 pwm signals

The 328-based Arduinos don't have 7 PWM pins. So, what Arduinos are YOU destroying?

Does anyone knows why they both are broken?

You've abused them.

It are arduino megas

What were / are the PWMs driving?- maybe something drawing too much current, or you got zapped by an inductive load with no flyback diode?

Or you fed to many volts into the Arduino's power supply?

Circuit pic might help. Might be too late to save those boards but might prevent killing another one.

They both still run the program, but when I try to upload something I get an error and the arduino just resets itself.

Sounds like the arduinos are fine! and that the problem is you. No reading the instruction is the normal cause, and don't tell you did as you did not read the instruction for posting on this forum.

Mark

They were driving meanwell ldd drivers. I have a flyback diode on each of the transistors.
The power supply is a 9v 1a power supply.
Is there a manual for arduinos?

Is there a manual for arduinos?

No. We make stuff up as we go along.

Senne:
Is there a manual for arduinos?

The instructions (such as they are) for using Arduinos are in the Reference section of this website and the various example sketches that come with the Arduino IDE. There are also various books you can buy and several online tutorials that Google will find for you.

Let's take your problem right back to basics.

Post a copy of the sketch you are using (and read how to use code tags to format it properly).
Post links to the specifications for any external hardware you are using.
Post a diagram of how you have everything connected - a photo of a clear pencil drawing will be fine.

As @holmes4 has said it is quite likely that your Arduinos are undamaged.

...R

PaulS:

Is there a manual for arduinos?

No. We make stuff up as we go along.

and the neat part is that we can guess what is wrong with someones project without schematics or data sheets !

Senne, post a schematic of how you have your project wired and links to the data sheets for the parts you are working with.

it is most likely some simple fix.

Ok thanks,
Datasheets:
Meanwell drivers: http://www.meanwell.com/search/LDD-H/LDD-H-spec.pdf
Temp sensor: http://www.micropik.com/PDF/ds1820.pdf
Transistors(tip112): Intelligent Power and Sensing Technologies | onsemi

The code:

#include <memorysaver.h>
#include <UTFT.h>
#include <UTouch.h>
#include <UTouchCD.h>
#include <avr/pgmspace.h>
#include "Arduino.h"
#include <Wire.h>
#include <EEPROM.h>
#include "writeAnything.h"
#include <DS1307new.h>
#include <OneWire.h>
#include <DallasTemperature.h>

int gr_out, b_out, w_out, rb_out, r_out, uv_out, moon_out , cy_out;
const int whiteledpin = 7;                // Pin voor witte leds 
const int redledpin = 8;                  // Pin voor rode leds 
const int royalblueledpin = 9;            // Pin voor royal blue leds 
const int blueledpin = 10;                 // Pin voor blue leds 
const int UVledpin = 11;                   // Pin voor UV leds 
const int greenledpin = 12;                  // Pin voor rode leds
const int cyanledpin = 13;                  // Pin voor cyaan leds
const int tempHeatPin = 52;          //Heater on/off (set thermostat on heater to highest desired level)
const int tempChillPin = 48;         //Chiller on/off (set thermostat on chiller to lowest desired level)
const int WaveMakerTop = 42;         //Hydor Koralia Evolution (Top Plug)
const int WaveMakerBottom = 43;      //Hydor Koralia Evolution (Bottom Plug)
const int HoodFansPWM = 44;          //PWM Hood Heatsink Fan (code added so frequency = 25kHz)
//const int SumpFanPWM = 45;           //PWM Sump Heatsink Fan (code added so frequency = 25kHz)
const int HoodFansTranzPin = 47;     //Hood Heatsink Fan on/off
//const int SumpFanTranzPin = = 53;      //Sump Heatsink Fan on/off
const int tempAlarmPin = 49;         //Buzzer Alarm for Temperature offsets
const int autoFeeder = 50;           //Automatic Fish Feeder
const int doseerpomp1pin = A0;
const int doseerpomp2pin = A1;
const int doseerpomp3pin = A2;
const int kalibreerknoppin = 53;
const int afschuimerpin = A8;

// DS18B20 Temperature sensors plugged into pin 51 (Water, Hood, & Sump)
OneWire OneWireBus(51);     //Choose a digital pin 
// Pass our oneWire reference to Dallas Temperature. 
DallasTemperature sensors(&OneWireBus);   
// Assign the addresses of temperature sensors.  Add/Change addresses as needed.
DeviceAddress waterThermometer = { 0x28, 0xD5, 0x49, 0x5D, 0x04, 0x00, 0x00, 0xF0 };
DeviceAddress hoodThermometer = { 0x28, 0x55, 0xA3, 0xAB, 0x03, 0x00, 0x00, 0x7F };
DeviceAddress sumpThermometer = { 0x28, 0x72, 0x22, 0x37, 0x03, 0x00, 0x00, 0xB9 };

float tempW = 0;                     //Water temperature values
float tempH = 0;                     //Heatsink temperature
float tempS = 0;                     //Sump heatsink temperature
int TempToBeginHoodFanInDegC = 29;   //Temperature to Turn on Hood Fans (in Degrees C)
float TempToStopHoodFanInDegC = 27.5;    // Temperatuur om fans te stoppen
int TempToBeginSumpFanInDegC = 29;   //Temperature to Turn on Sump Fan (in Degrees C)
float FanOn = 0.2;                   //Starts Fan(s) at 20% Duty Cycle
int HoodTempInterval = 0;            //Used for PWM Duty calculations
int SumpTempInterval = 0;            //Used for PWM Duty calculations
float HoodFanSpeedIncrease = 0;      //Used for PWM Duty calculations
float SumpFanSpeedIncrease = 0;      //Used for PWM Duty calculations
float HoodPWM = 0;                   //Used for PWM Duty calculations
float SumpPWM = 0;                   //Used for PWM Duty calculations
int temphoog;
int tempwhoog;
float setTempC = 0.0;                //Desired Water Temperature (User input in program)
float setTempF = 0.0;
float offTempC = 0.0;                //Desired Water Temp. Offsets for Heater & Chiller (User input in program)
float offTempF = 0.0;
float alarmTempC = 0.0;              //Temperature the Alarm will sound (User input in program)
float alarmTempF = 0.0;
boolean tempCoolflag = 0;            //1 if cooling on
boolean tempHeatflag = 0;            //1 if heating on
boolean tempAlarmflag = 0;           //1 if alarm on
long intervalAlarm = 1000 * 30;      //Interval to beep the Alarm (1000 * seconds)
float temp2beS;                      //Temporary Temperature Values
float temp2beO;                      //Temporary Temperature Values
float temp2beA;                      //Temporary Temperature Values
int setTempScale = 0;                //Celsius=0 || Fahrenheit=1 (change in prog)
String degC_F;                       //Used in the Conversion of Celsius to Fahrenheit 
int zonneschema(int opkomst, int ondergang , int maxwaarde, int uur, int minuut, int secon)
{
  float uren = uur;
  float minuten = (float)minuut/60;
  float seconden= (float)secon/3600;
  float totaal = (float)uren+minuten+seconden;
  float a;
  float midden = (float)(ondergang+opkomst)/2;
  int ledwaarde;
  a= (float)maxwaarde/((midden-opkomst)*(midden-ondergang));
  ledwaarde=round( a*((totaal-opkomst)*(totaal-ondergang))); 
  if(ledwaarde> 0)
 {
   return ledwaarde;
 }
 else {return 0;}
}
float opkomst = 8;
float ondergang = 22;
long vorigemillis;
void checkTempC()
{ 
  sensors.requestTemperatures();   // call sensors.requestTemperatures() to issue a global 
                                   // temperature request to all devices on the bus
  tempW = (sensors.getTempC(waterThermometer));  //read water temperature
  tempH = (sensors.getTempC(hoodThermometer));   //read hood's heatsink temperature
  tempS = (sensors.getTempC(sumpThermometer));   //read sump's heatsink temperature

  if (tempW<(setTempC+offTempC+alarmTempC) && tempW>(setTempC-offTempC-alarmTempC)) {
    tempAlarmflag = false;
    digitalWrite(tempAlarmPin, LOW);                           //turn off alarm
    }
if (/*tempW< (setTempC+offTempC) && */tempW>(setTempC-offTempC))  //turn off chiller/heater
      {
  //     tempCoolflag=false;
       tempHeatflag=false;
       digitalWrite(tempHeatPin, LOW);
  //     digitalWrite(tempChillPin, LOW);   
       }
       if((tempW == setTempC) && (tempwhoog == 1))
       {
         tempCoolflag=false;
         digitalWrite(tempChillPin, LOW); 
        tempwhoog = 0; 
       } 

  if (offTempC>0)
    {
     if (tempW >=(setTempC+offTempC))            //turn on chiller
       {
        tempCoolflag=true;
        digitalWrite(tempChillPin, HIGH);
        tempwhoog = 1;
       }
     if (tempW<=(setTempC-offTempC))             //turn an heater
       {
        tempHeatflag=true;
        digitalWrite(tempHeatPin, HIGH);
       }
    }
  //Fan Controller for Hood
  HoodTempInterval = (tempH - TempToBeginHoodFanInDegC);   //Sets the interval to start from 0
  HoodFanSpeedIncrease = HoodTempInterval*0.1;   //Fan's speed increases 10% every degree over set temperature
//  digitalWrite(HoodFansTranzPin, HIGH);  
  if ((tempH < TempToStopHoodFanInDegC) && (temphoog==1))          //If Temp's less than defined value, leave fan off
    { HoodPWM = 0;
      digitalWrite(HoodFansTranzPin, LOW);
    temphoog =0;}
  if ((tempH  >= TempToBeginHoodFanInDegC) && (HoodFanSpeedIncrease < 1))   //For every degree over defined value, increase by 10%
    { HoodPWM = FanOn + HoodFanSpeedIncrease;
    digitalWrite(HoodFansTranzPin, HIGH);
    temphoog = 1;  }
  if (HoodFanSpeedIncrease >= 1)                 //If the temperature is 10 or more degrees C higher than user 
    { HoodPWM = 1;}                              //defined value to start, leave it at 100%
 
  //Fan Controller for Sump
  SumpTempInterval = (tempS - TempToBeginSumpFanInDegC);   //Sets the interval to start from 0
  SumpFanSpeedIncrease = SumpTempInterval*0.1;   //Fan's speed increases 10% every degree over set temperature
  //digitalWrite(SumpFanTranzPin, HIGH);  
  if (tempS < TempToBeginSumpFanInDegC)          //If Temp's less than defined value, leave fan off
    { SumpPWM = 0;
     // digitalWrite(SumpFanTranzPin, LOW);
   }
  if ((tempS  >= TempToBeginSumpFanInDegC) && (SumpFanSpeedIncrease < 1))   //For every degree over defined value, increase by 10%
    { SumpPWM = FanOn + SumpFanSpeedIncrease;}
  if (SumpFanSpeedIncrease >= 1)                 //If the temperature is 10 or more degrees C higher than user 
    { SumpPWM = 1;}                              //defined value to start, leave it at 100%   
}
void setup()
{ Serial.begin(9600);
   pinMode(doseerpomp1pin, OUTPUT);                  // pin voor vlotter hoog voor bijvullen
 pinMode(doseerpomp2pin, OUTPUT);                  // pin voor vlotter laag voor bijvullen
 pinMode(doseerpomp3pin, OUTPUT);                  // pin voor vlotter kalkreactor
 pinMode(whiteledpin, OUTPUT);  
 pinMode(redledpin, OUTPUT);
 pinMode(royalblueledpin, OUTPUT);
 pinMode(blueledpin, OUTPUT);
 pinMode(UVledpin, OUTPUT);
 pinMode(greenledpin, OUTPUT);
 pinMode(cyanledpin, OUTPUT);
 pinMode(kalibreerknoppin, INPUT);
 pinMode(afschuimerpin, OUTPUT);
  pinMode(HoodFansTranzPin, OUTPUT);
  //pinMode(SumpFanTranzPin, OUTPUT);
  
  pinMode(tempHeatPin, OUTPUT);
  pinMode(tempChillPin, OUTPUT);
  pinMode(tempAlarmPin, OUTPUT);
  
  pinMode(WaveMakerTop, OUTPUT);
  pinMode(WaveMakerBottom, OUTPUT);
  
  pinMode(autoFeeder, OUTPUT);  

    RTC.getTime();
    gr_out = zonneschema(opkomst, ondergang, 80, RTC.hour, RTC.minute, RTC.second);
    b_out = zonneschema(opkomst, ondergang, 215, RTC.hour, RTC.minute, RTC.second);
    w_out = zonneschema(opkomst, ondergang, 200, RTC.hour, RTC.minute, RTC.second);
    rb_out = zonneschema(opkomst, ondergang, 200, RTC.hour, RTC.minute, RTC.second);
    r_out = zonneschema(opkomst, ondergang, 80,  RTC.hour, RTC.minute, RTC.second);
    uv_out = zonneschema(opkomst, ondergang, 100,  RTC.hour, RTC.minute, RTC.second);
    cy_out = zonneschema(opkomst, ondergang, 80, RTC.hour, RTC.minute, RTC.second);
  analogWrite(blueledpin, b_out);
  analogWrite(whiteledpin, w_out);
  analogWrite(royalblueledpin, rb_out);
  analogWrite(redledpin, r_out);
  analogWrite(UVledpin, uv_out); 
  analogWrite(greenledpin, gr_out);
  analogWrite(cyanledpin, cy_out);
  checkTempC();

}
void loop()
{unsigned long currentmillis = millis();
if(currentmillis-vorigemillis>5000)
{    vorigemillis = currentmillis;
 RTC.getTime();
  gr_out = zonneschema(opkomst, ondergang, 80, RTC.hour, RTC.minute, RTC.second);
    b_out = zonneschema(opkomst, ondergang, 215, RTC.hour, RTC.minute, RTC.second);
    w_out = zonneschema(opkomst, ondergang, 200, RTC.hour, RTC.minute, RTC.second);
    rb_out = zonneschema(opkomst, ondergang, 200, RTC.hour, RTC.minute, RTC.second);
    r_out = zonneschema(opkomst, ondergang, 80,  RTC.hour, RTC.minute, RTC.second);
    uv_out = zonneschema(opkomst, ondergang, 100,  RTC.hour, RTC.minute, RTC.second);
    cy_out = zonneschema(opkomst, ondergang, 110, RTC.hour, RTC.minute, RTC.second);
  analogWrite(blueledpin, b_out);
  analogWrite(whiteledpin, w_out);
  analogWrite(royalblueledpin, rb_out);
  analogWrite(redledpin, r_out);
  analogWrite(UVledpin, uv_out); 
  analogWrite(greenledpin, gr_out);
  analogWrite(cyanledpin, cy_out);
  checkTempC();
}
}

and the error message!

Mark

What are those boxes that pins 13 etc connect to?

Please complete the circuit for pins 47, 48.

In order to guess whether the circuit is likely to damage the Arduino, we need to understand the electrical characteristics of the circuit that each pin is connecting to.

Senne:
I have a flyback diode on each of the transistors.

Then why are there NO diodes or indeed transistors in the schematic you posted!!

If you do not tell the truth the people can't help you.

What is destroying my arduinos

You are.

This is the tranistor circuit:


Those boxes are the Meanwell ldd-1000h drivers , the pwm signal goes into the pwm input.

And there is no error message , when I hit upload the arduino just resets itself and the RX blinks one time. The computer keeps trying to upload but the arduino does not receive anything.
I've already let it running like this all day long but it doesn't help

The Arduino it reset whenever you upload code to it. If there is no error message, then it is probably uploading the code correctly.

In the warm weather this week, I got more "problem uploading to board" messages than usual and narrowed that down to
with nano v3
on 2m usb cable with about 4.6V reaching the arduino and other loads,
if ambient T > 29C, about half of uploads fail with "problem uploading to board"
if ambient T > 35C, most uploads fail with "problem uploading to board"
That turned out to be a reversible problem. Cool to < 25C ambient and it went back to normal.

But the arduino resets before it receives anything?
The room temperature in here is about 24°C