Battery Temperature Warning Buzzer

Hello Everyone,
I am starting my very first Arduino project, fairly new to programming, totally new to Arduino but have played around with micropython on a pi pico. I am just beginning a C language course but I have to admit I am not picking it up very well. So I need help here writing my first program. My bigger issue is I need to install this project into a vehicle this Saturday!

So let me break down the project and see what folks here can do to get me going in the right direction. I am hoping this won't be too terribly difficult.

Project Scope:
2014 Mercedes Sprinter Van. Electronics Cabinet containing: 4 x 100ah Lithium Iron Phosphate Battery Array, 200 Watt Solar Input, 3000 Watt Inverter/Charger.

So we have some serious power generation in a closed space so we are going to generate some heat. Now there are 2 x 120mm 12v vent fans and 2 additional open vents. The 2 fans are on a manual switch that I would like to integrate into the project to automatically kick on and off based on temperature.

I want to be able to monitor the temperature in the cabinet with the sensor placed above the battery array. In the event of potential overheating I want to be able to warn the occupants of the van of a impending problem. I also want to kick on above mentioned vent fans on and off.

Hardware:
Arduino Nano Everything
Grove TH_02 Temperature/Humidity Sensor
Basic Pezio Buzzer
2 x 120mm PC fans

Expected Behavior:
Sound buzzer in 3 stages:
@ 100F, sound buzzer, 3 seconds on, 3 off, cycle 5 times. (First temp warning)
@ 130
F, sound buzzer, 5 seconds on, 2 off, cycle 10 times. (Second temp warning)
@ 160*F, sound buzzer, on continuous 180 seconds, 10 second off, loop until temp goes below threshold or physically kill power to Nano. (Forced Intervention, Must open battery cabinet and take action to rectify dangerous overheating situation.)

Trigger Ground for fans, on @ 85F, off @ 80F
(Fans are on vehicle 12v circuit, not sure if triggering ground directly will create surge or current draw through the Nano. Could use standard automotive 12 relay, but these are honestly rather inadequate computer case fans with like 22g wiring)

Now I am thinking I only want buzzers to sound on increasing temperatures but not on descending temps. example, triggers 100F warning and goes up to say 110, but is now cooling back down so no need to trigger as it passes back below 100F trigger. I don't know, not sure I have the time to lose with extra coding at the moment.

Physical Setup: (Currently setup on breadboard)
TH_02 Temp Sensor, SDA Pin D18; SCL Pin D19; +5v pwr, ground
Buzzer, +3.3, Sig Pin D2
Fans, 12v vehicle power, ground signal D3? (Fans in the van)
Nano, 12v vehicle power with 3amp fuse. Ground to isolated chassis ground. (currently on USB+)

Programming:

Well I need serious help here as I am unfamiliar with Arduino hardware and the C/C++ language.

I know I need include certain libraries such as Arduino.h, TH02_dev.h, and wire.h.
I am unsure about the sensor driver TH02_dev.cpp?? I don't see it called in the TH02Demo.ino program I looked at.

(Totally guessing and just trying to layout some kind of framework, not sure what any of this would look like at the moment.) Guidance here is critical.

I would need to create a function for Alarm(buzzer), Temp, Fan?

I would need a way to pass the temp values to the Alarm and Fan functions? How?

Declare hardware pins in setup? Not sure of pin nomenclature for Nano?

If statements such as
If temp=100; buzzer(Pin D2, Low) // Temp = 100, activate buzzer;
buzzer(PinLow(3), Delay(3);
(buzzer=(b) 0<=5, b++) //buzzer cycle
else;
void() // do nothing

Then repeat code for each of 3 buzzer trigger temps. Something similar to trigger the vent fan?
Perhaps a 'While' statement would be better then a if/else statement?

Anyways, that is as far as my knowledge takes me for the moment. I just received my Nano today and currently have it in the breadboard blinking the LED for a burn in test. Smelled like hot electronics for about the first hour, although the board itself wasn't hot at all. Just new chips burning off factory coatings?

I have it setup in the web based IDE and I have been able to do a serial test to verify I can upload programs and get a response from the unit, reset button works, and then re-uploaded the blink led program. So I am physically setup for the most part.

I will start doing my best to start a sketch and at least get some kind of frame work built.

Thank You in advance for the help. And sorry my first post is a 'help me with my homework' kind of post. I do have alot to learn but I certainly am grateful for the help.

Robert

Hello and good morning
You have a typical control task. My recommendation is to study the IPO model and draw a programme flow diagram before coding. Create objects, a time handler and the associated functions.
Good luck
IPO model - Wikipedia.

1 Like

Start with the examples in the arduino IDE

Follow the tutorials for the parts you have.
YouTube instructables etc.

Once you get the readings it becomes thresholds and timing.

We are here to guide you on fixing you mistakes.

If you want someone to write this for you there is a gigs and colaboration forum.

1 Like

I'm with @paulpaulson and @dave-in-nj, this is a straight ahead project and you are on the right track.

But I write to say that

The buzzer in the "extreme been ignored too long" condition should still have a short duty cycle, not 3 minutes continuous.

I'm not a psychologist or human factors PhD, but I can tell you that humans have an amazing capacity to live with discomfort. In this case, they've already been able to ignore the previous warning patterns… I think they'd find relief not insistence when it switched to your proposed 160 degree noise.

It's the changes that our brains see or hear.

So just invent something even more annoying and insistent sticking with things that play out over seconds, not minutes.

If this mission critical element does not materialize by Saturday, you can get thermometers with alarms, which won't turn on the fans like you want (unless you hacked them!) but might let whatever was planned go ahead with some safety factor.

a7

1 Like

Given that you're new to C, this is quite a tall order to get working by Saturday.

I suggest that you try to make the most minimal thing you can (if too hot turn on fans and buzzer). If a miracle occurs and that's working with time to spare, take a copy and add features until you break it :wink:

You will need something (relay, SSR, MOSFET) to switch power to the fans. Look at snubbing circuits too.

1 Like

The have done research into alarms..

2 Likes

Ok so here is the state of my progress...slow...lol

First off, thanks for the responses. I do appreciate the advice and direction.

So...
I was able to upload temp sensor and load the demo and have it output temp and humidity to the monitor so I know that works

I got my buzzer hooked up and had it working with some code I got from adafruit and had it run a ascending/descending array of 7 tones. Problem is it was a for loop so it never shut up.

So I started hacking away at the code and tried to get it to increment 5 times and stop, this resulted in some interesting tone combos. So I was like I need a while loop, so 'while' t=0 increment to 5 and stop. Took me a few tries to get the while statement to work, now I have no errors, but I also now have no tone :frowning:

/* Quick Sketch to test the output to
  buzzer */

#define PIEZO_PIN 2 // PIN D2

void setup() {
}

void loop() {
  int t;
  t = 0;
  while (t < 5);  {
    tone(PIEZO_PIN, 100, t);
    delay(500);
    t++;
  }
}

The tone function is

tone(pin, frequency, duration);

The duration is milliseconds (and optional), so using t there makes for very short tones, but I would think you’d hear clicks or something.

Try this


void loop() {
  int t;
  t = 0;
  while (t < 5);  {
    tone(PIEZO_PIN, 500);
    delay(200);

    noTone();
    delay(200);

    t++;
  }

  delay(1333);
}

This raises the frequency, shortens the beep, turns it on then off five times, then repeats that after a bit because loop() gets called again right away it from the main() program in Arduino that you never see.

This is just to inspire you, but, as will be pointed out, no way to go about the whole thing properly, but…

if this was Wednesday I think you’d have a shot.

If you changed the above loop() to a new function (same body code, new name) like


  void alarmPhase1() {
   ... 
   }

you could call it from your loop() function, perhaps if the temp was within a certain range…

Give it a shot and come back. I’m on fumes, but this is a world wide forum and ppl keep what seem to be odd hours, you might get lucky.

edit: added increment to t, oops!

a7

Well crap, I did a complete re-write as I figured I don't need to specify tones, I just need it to beep.

I got 3.3v going out to the buzzer and using pin2 to ground/unground the pin, I used the code from the 'blink' program. Seems simple enough, if it can blink a damn LED it can buzz a buzzer. Still no joy. I can manually ground the buzzer to a ground pin and it buzzes just fine. I even tried swapping control pins, still nothing. I has something to do with the while loop, it worked fine on a for loop.
Have no idea while it would be any different.

Oh ya, just got a warning I only have 42seconds of compile time left on the web based IDE and have to upgrade my plan. Thats some chicken shit right there, what the hell. I dislike IDE's. My preferred environment is vim, gcc, rshell. Anyways, I am going to switch back to a 'for' loop, then check out some 'compiler' plans..

/* Quick Sketch to test the output to
  buzzer */


void setup() {
// initialize digital pin 2 as an output.
  pinMode(2, OUTPUT); //ground control for buzzer
}

void loop() {
  int t;  t=0;
  while (t < 5); {
    digitalWrite(2, LOW);    // turn the buzzer on by making the voltage LOW
    delay(1000);                       // wait for a second
    digitalWrite(2, HIGH);   // turn the buzzer off 
    delay(1000);                       // wait for a second
  t++;  
  }
  delay(1300);
}

Well I ran out of compile time, 200 seconds per day. I didnt realize this was a pay to play compiler :frowning:

Post my code here for the night so I can copy it back in tomorrow and try again.

Cannot get it to work with a while statement now back to a for statement. I got it to beep 5 times and then it would leave the loop and delay for 5 seconds but then restart the loop. I just want it to beep 5 times and stop. Pretty simple request, not sure why it has to be so damn difficult.

Anyways, I added a if/break statement I have no idea if it will work. Have zero hopes of being able to get this working any time this century.

/* Quick Sketch to test the output to
  buzzer */


void setup() {
// initialize digital pin 2 as an output.
  pinMode(2, OUTPUT); //ground control for buzzer
}

void loop() {
  int t;
  for(t=0; t < 5; t++) {
    digitalWrite(2, LOW);    // turn the buzzer on by making the voltage LOW
    delay(1000);                       // wait for a second
    digitalWrite(2, HIGH);   // turn the buzzer off 
    delay(1000);                       // wait for a second
    if (t = 5) {
      t = 0;
      break;
    }
    
  }
  //delay(5000);
  
}

This isn't just mistaken, it is wrong. You probably meant to compare the value of t to 5, that would need the comparison "==", not assignment "='".

A common mistake for beginners and a bitchy typo for everyone. Compilers will warn you about this. In the IDE you can enable warnings which for some unknown reason are off by default. I don't know what kind of diagnostics there are in your tools or how they can be set.

But there's no need to break out of a for loop, or reset it within the loop as you were attempting. Anything you were hoping to achieve in this manner can be done directly by the for or while syntax.

While we are at it, the kind of loop you use, while or for or whatever, is not going to fix up a beeper that seems to not want to work like it might have an example program. The beeper can't know about the loop, it is reacting only to the signals on the pin.

Also, the first loop is taken care of by the structure of the typical "sketch".

loop() is called repeatedly. Every time your loop() gets called, decide what's up and what to do. Time, either time of day or milliseconds since last time, is a common thing to check."Is it time to turn off the buzzer" you turned on some milliseconds AGI in a previous call to loop().

But that compiler limit thing, ugh. The IDE may not be the greatest dev environment, but it does get the job done just well enough to have kept me from looking into the several better alternatives. I'm lazy, it works, it's what almost everyone uses anyway but best for last it is free… any $/upload would have broken me years ago. :wink:

So just person-up and install the IDE.

Saturday, agree the ship has sailed. I hope you still go forward with your attempt, it is clear you are motivated and it seems like you are capable.

a7

1 Like

Thanks for helping, I do appreciate it. I will admit I thought this would be a little easier then just learning raw C or C++ but the fact that I cannot even get a simple buzzer to beep 5 times and turn off is actually demoralizing. I will keep working on this project but I do have an online C class I am taking and I need to get back to it so I need to drop this for now.

Again, thank you for trying to help it is appreciated. Not all is lost though, I was able to get the hardware up and running, was able to load some examples and make the board do things. I verified all my hardware works. I wrote some code and got a buzzer to sing and dance, albeit in a forever loop but hey just getting started.

Cheers! :grinning:

you can go cheap and dirty.

if (alarmState exists )
turn alarm on
delay(100)
turn alarm off
delay(500)
turn alarm on
delay(100)
turn alarm off
delay(500)
turn alarm on
delay(100)
turn alarm off
delay(500)
turn alarm on
delay(100)
turn alarm off
delay(500)
turn alarm on
delay(100)
turn alarm off
delay(500)

No one likes to use delay but for an alarm like this, who cares if nothing else is measured or controlled ?

it seems you have some desire to stop the loop.
think of your daily activities.
stopping the loop is like sleeping.

wake up, have coffee, no coffee, alarm, go so sleep for 23-1/2 hours

how about this....
alarm condition
beep alarm 5 times, 100 mS on and 500mS off
then go back to monitoring everything

how about.
alarm condition
beep alarm 5 times, 100 mS on and 500mS off

if someone presses the acknowledgement button, silence
if the button is not pressed,
every 5 minutes, beep for 500mS
keep monitoring conditions

all this is only a few lines of code.

the alternative is :
Boss "why did the Sprinter burn up"
fireman "the batteries overheated"
Boss "I thought you had an alarm for that?"
you "yeah, I guess it went off when no one was around to hear it, then it shut itself down"

1 Like

Ok I think I made an important discovery this morning.

I was in the shower and thinking 'if its in a loop and it beeps 5 times and restarts the loop and reads that t=0 and if t <5 then beep the damn alarm 5 times, repeat, repeat. It also explains why I can add the 5 second delay and it will in fact beep 5 times, delay, beep 5 times. Ok, thats great, we got the basic logic figured out, so how do we get this damn thing to beep 5 times and STOP!

So I went back to my basic, err, primitive C knowledge and wrote a basic while loop. I wanted it to output something 5 times and stop. So print "Beep" 5 times and stop. Simple enough.

  1 /* simple program to verify while loop */
  2 
  3 #include <stdio.h>
  4 
  5 int main(void){
  6     int t; t=0;
  7     while(t < 5){
  8         t=t+1;
  9         printf("Beep\n", t);
 10 
 11     }
 12     return 0;
 13 }

robert@mountain-cabin:~/C$ ./beeep
Beep
Beep
Beep
Beep
Beep

So then I have an aha moment, I need to add a return 0; statement to let the Arduino program to exit.....
Nope it just beeps, and beeps, and beeps.....Then I notice, its main function is 'void loop()', easy enough so I change it to 'int main()' and add my end return 0; statement. It compiled without error and uploaded without error, and I was met with deafening silence.....

Hmmm?? So I change it back to 'void loop()' and add the 5 second delay in place of the return 0; statement and upload it, it beeps 5 times, waits 5 seconds, beeps 5 seconds....

Then it dawns on me like the rising sun.....There are only 2 main functions in Arduino....
Setup and Loop.....but why??

Sketch

loop()
setup()

Because its a damn microcontroller you doofus!
You tell it to do something and that is what it does, period, forever!!!!

So this whole time it only did what I wanted it to do, beep 5 times, but that is all I ever told it to do.

/* Quick Sketch to test the output to
  buzzer */


void setup() {
// initialize digital pin 2 as an output.
  pinMode(2, OUTPUT); //ground control for buzzer
}
void loop() {
  int t; t=0; 
  while(t < 5){
    t = t +1;
    digitalWrite(2, LOW);    // turn the buzzer on by making the voltage LOW
    delay(1000);                       // wait for a second
    digitalWrite(2, HIGH);   // turn the buzzer off 
    delay(1000);                       // wait for a second
  }
    delay(5000);
}

Ok so there it is, I wrote my first successful Arduino code and have figured out the fundamental logic of how this all works. Doh!

I am going to go for a walk on the beach and have fish tacos to celebrate my little accomplishment here. Thanks again for all the guidance. I sure hope another newbie whom stumples upon this little saga gets some benefit.

Cheers! :slight_smile:

Yay! You over the a hump.

Keep your "Doh!" hat handy.

Now try using a for loop instead of the while…

after the tacos. Mmm tacos.

a7

1 Like

take the success of your win.

as a note, this is a sub routine that is only reached when the temperature is not right.
this is NOT real code, just some idea.

so,
void loop()
battery_temperature = // need to read battery temperature

void loop()
battery_temperature = // need to read battery temperature

if (alarmOFF == 0 ) { // will not sound again till temp is lower than alarm point
  if (battery_temperature >= battery_Alarm_Point)
    for (int x = 0, x <= 5, x++) {
      digitalWrite(2, LOW); // turn the buzzer on by making the voltage LOW
      delay(1000); // wait for a second
      digitalWrite(2, HIGH); // turn the buzzer off
      delay(1000);
      alarmOFF = 1;  // flag to prevent repeating
    } // end for loop
  } end if batt temp
} end alarmOFF

then, you need to re-set the alarm

alas, no hysteresis. but I would rather annoy with an alarm before a catastrophe

1 Like

Hey Dave,

Thanks, that was unexpected. Appreciated as I can work it into my code which I have some ideas of how to structure now that I have done some actual reading and research. :+1:t4:

Been doing some research and I think I got a basic code structure laid out in my mind so I want to throw it out here and get some feedback.

This is just pseudo code to get a sketch laid out.

#include wire.h
#include Arduino.h
#include TH02_dev.h

void setup() // I want to create these objects as global functions
int temp_Sensor(input)  //th02 temp sensor
int fan1(3, Output) //cooling fan
int alarm1(2, Output) //buzzer

void loop()
battery_temperature = digital.read(temp_sensor) // read sensor always

switch (battery_temperature){
  case cooling fan on/off;
    temp >=85f, turn on <fan>
    temp <=80f, turn of <fan>
    break;
  case temp warning1:
    if (battery_temperature >= battery_Alarm_Point)
    for (int x = 0, x <= 5, x++) {
      digitalWrite(2, LOW); // turn the buzzer on by making the voltage LOW
      delay(1000); // wait for a second
      digitalWrite(2, HIGH); // turn the buzzer off
      delay(1000);
      alarmOFF = 1;  // flag to prevent repeating
    break;
  case temp warning2:
    if (battery_temperature >= battery_Alarm_Point)
    for (int x = 0, x <= 5, x++) {
      digitalWrite(2, LOW); // turn the buzzer on by making the voltage LOW
      delay(1000); // wait for a second
      digitalWrite(2, HIGH); // turn the buzzer off
      delay(1000);
      alarmOFF = 1;  // flag to prevent repeating
    break;
  case temp warning3:
    if (battery_temperature >= battery_Alarm_Point)
    for (int x = 0, x <= 5, x++) {
      digitalWrite(2, LOW); // turn the buzzer on by making the voltage LOW
      delay(1000); // wait for a second
      digitalWrite(2, HIGH); // turn the buzzer off
      delay(1000);
      alarmOFF = 1;  // flag to prevent repeating
    break;
  default:
    battery_temperature = digital.read(temp_sensor)
    break;
}

Anyways, I got to push off for work, this is just a rough outline but I think it represents the structure I would like to see. Am I on the right path with the switch/case statement? Seems like it fits the bill and makes the whole structure pretty clean.

I would like to use the 'millis' function over 'delay', create a full function for the temp, fan and alarm calls so in the loop structure I can just call the function within the switch/case statement. Would also like to create a serial display output for temp sensor for testing purposes.

i need a 5v trigger relay to operate the 12v fans, I thought maybe I could just pull them through a analog pin to ground, I am not terribly concerned of the amperage but not sure if I can pull 12v through the analog pin, either way a relay is a smarter setup.

Thanks Again for all the feedback.

Nice progress.

You have over-complicated this though, which is good.

I'm not sure what you are trying to say before your loop() function. A harsher statement would be that it is nonsense.

And the switch/case is superfluous here, it's just plain logic at this point.

I don't see where you ever turn alarmOff back on again, or how it is initialised or otherwise used; please decsribe the behaviour you desire - turning off an alarm sounds like a bad idea, esp. if you don't somehow turn it back on again.

Perhaps you want it to alarm every so often.

Here's your code, mostly I just removed stuff you don't need yet. Or that make no sense to me just now.

I put a delay at the end, there are other ways to handle it but there is nothing wrong really with just letting the loop take say 5 seconds between checks. This would auto-magically cause alarms to repeat every 5 seconds, so you may therefor be home free.

You are absolutely correct to observe that a crowd would like this to be a state machine implemented with mills() and switch/case!

But until you need to do something like check the temperature in between beeps of the alarm, it can be postponed. You aren't really trying to do "more than one thing at a time"!

An easy enhancement would be for the alarm to sound, and only progress to more dire alarms, and only attention (reset! or a button you watch) would make it cease. It might be a place for a small state machine, essentially. Bumping up the "state variable" as temp thresholds are crossed...

Too this is just pseudo code, again mostly yours without the complications. May I say it reminds me of how you were complicating your for and while statements with if statements that were basically redundant.

void loop()

battery_temperature = digital.read(temp_sensor) // read sensor **once per loop**


if    temp >=85f, turn on <fan>
if    temp <=80f, turn of <fan>  ...off


    if (battery_temperature >= battery_Alarm_Point)
		for (int x = 0, x <= 5, x++) {
		  digitalWrite(2, LOW); // turn the buzzer on by making the voltage LOW
		  delay(1000); // wait for a second
		  digitalWrite(2, HIGH); // turn the buzzer off
		  delay(1000);
		  alarmOFF = 1;  // flag to prevent repeating
		} !!!
    

    if (battery_temperature >= battery_Alarm_Point)
		for (int x = 0, x <= 5, x++) {
		  digitalWrite(2, LOW); // turn the buzzer on by making the voltage LOW
		  delay(1000); // wait for a second
		  digitalWrite(2, HIGH); // turn the buzzer off
		  delay(1000);
		  alarmOFF = 1;  // flag to prevent repeating

		} !!!


    if (battery_temperature >= battery_Alarm_Point)
		for (int x = 0, x <= 5, x++) {
		  digitalWrite(2, LOW); // turn the buzzer on by making the voltage LOW
		  delay(1000); // wait for a second
		  digitalWrite(2, HIGH); // turn the buzzer off
		  delay(1000);
		  alarmOFF = 1;  // flag to prevent repeating

		} !!!

delay(5000); // just check every five secondc

}

EDIT: LOL I've just noticed all the alarms are the same: same condition, same sound effect.

Did you mean to have a number of different battery_Alarm_Point(s)? With a different sound effect to each?

If not, there's no reason to repeat the code as we have lost the switch/case structure.

I was going to suggest that you make an alarmSound function that could be called with a variable denoting degree of direness… that's when I noticed that it isn't what you are going for, so.

Oh, and however many they be a better name might be temperature_Alarm_Point. :wink:

HTH

a7

1 Like

Hello Alto,

Thanks for trying to help me with my code, I had only ever meant what I posted today to show basic structure or program flow. So yes you are correct all the alarm code was the same as I just copied it in to the switch case statement to fill it out.

Am I over-complicating the code, probably so and here is why. I am taking a C programming course, it is a online self directed course and I could just skate through it and kind of learn it then struggle forever after. My goal is to learn it as best I can and learning the Arduino code along side of the course gives me practical application to apply my knowledge to.

In the course we are taught to avoid the 'goto' command, I have similarly read that in Arduino the 'delay' function should also be avoided when possible. My reason for wanting to use the 'millis' function is not to make it difficult but to get into good coding practices. If I use 'delay' in my code today, I only 'delay' my progress for tomorrow. If I need something quick and dirty then I suppose delay will be a compromise I can live with. For now this is going to be my first real world code and I want to make sure to do it right.

I'm not sure what you are trying to say before your loop() function. A harsher statement would be that it is nonsense.

So what I was trying to illustrate prior to the loop() function was to illustrate the creation of functions to be called later with in the main code. I just didn't hash them out so it looked more like defining a variable or creating a macro. As a example is the alarm buzzer, so lets take a quick look at that....We will just grab this piece that dave in nj wrote to keep it tidy and simple...

for (int x = 0, x <= 5, x++) {
      digitalWrite(2, LOW); // turn the buzzer on by making the voltage LOW
      delay(1000); // wait for a second
      digitalWrite(2, HIGH); // turn the buzzer off
      delay(1000);

Now lets say I want to have 3, 4, 8, 10 alarms at varying levels of urgency, I want them to beep more often and longer intervals based on level of urgency. So instead of repeating this code over and over again in the loop, lets create a global function we can call from within the loop.

Not sure if this would go before or after void setup()?

Let me see if I can build a function here:
(for now we will keep delay)

//Alarm Buzzer Function
void alrm_buzz(int x=0, x<=count, x++){
      digitalWrite(2, LOW); 
      delay(ontime); 
      digitalWrite(2, HIGH); 
      delay(offtime);
}

Now in our loop() when we want to specify the alarm buzzer we just make a call to the function:

//Making function calls to Alarm Buzzer Function
> void loop(){
>      // Alarm1
>      int count = 5, ontime = 1000, offtime = 1000;
>      alrm_buzz(count, ontime, offtime);
>     //Alarm2
>     int count = 8, ontime = 2000, offtime = 500;
>     alrm_buzz(count, ontime, offtime);
>     //Alarm3
>     int count = 10, ontime = 750, offtime = 250;
>     alrm_buzz(count, ontime, offtime);
> }

Now I know technically the code is not correct but hopefully it illustrates what I would like to accomplish. Perhaps: alrm_buzz(&count, &ontime, &offtime) ??

Am I making this way more complicated then it needs to be? Absolutely! :grinning:

At this point I am in no hurry and the van is already on its way out on the journey, the inverter itself has a temp and over-voltage shutdown function so when they lose AC power in the van and the thing starts smelling like cooking electronics I am sure they will get the hint all the same.

Again, thanks for being involved and trying to help, I really do appreciate it, even if its not what I want to hear, it still makes me think and gives me insights :+1:t4:

Robert