Reply
 
Thread Tools Display Modes
 
Old 03-16-2020, 03:35 PM   #1
Bus Crazy
 
somewhereinusa's Avatar
 
Join Date: Nov 2010
Location: Andrews,Indiana
Posts: 2,132
Year: 1991
Coachwork: Bluebird
Chassis: AARE
Engine: 3116 Cat 250hp
Rated Cap: Just the two of us.
I need Arduino help.

This is kind of bus related because it's going in my bus. And I know there are some others here using micro controllers.

I have a project using a Mega 2560. It has four DS18B20 temperature sensors, data logging. voltage sensing, a RTC, bluetooth. It all controls 4 solid state relays. It ONLY works correctly if I power it with my desktop PC through USB. It will work for hours, turning the relays on and off at the appropriate times. Log to the data card and output through serial via bluetooth to my phone. Very, very rarely it will show -196.6 F on data and serial, not a big deal. I should add that the exact thing happens when I use a very basic sketch that only reads the temps of the 4 sensors and sends to serial.

The problem is I can't use ANY other power source to the Mega, laptop through USB, 7.5V at VIN pin, 12V at power jack, 5V at USB. When using these other power sources the temp readings randomly, on all four readings go to -196.6 F sometimes 4 or 5 in a row. Speed of readings makes no difference. Slowing down to 3000 mS makes no difference.

I can't see much, if any, noise difference anywhere by probing power pins with an oscilloscope with any of the power sources. I've tried adding extra grounds just to make sure

Wiring diagram



View of project.



Two views of how secondary board is wired



Any suggestions?
somewhereinusa is offline   Reply With Quote
Old 03-16-2020, 04:39 PM   #2
Bus Nut
 
Join Date: May 2017
Location: Windham NH
Posts: 486
Year: 1999
Coachwork: Amtran
Chassis: International RE
Engine: International T444e
Rated Cap: 76
Quote:
Originally Posted by somewhereinusa View Post
This is kind of bus related because it's going in my bus. And I know there are some others here using micro controllers.


Quote:
Originally Posted by somewhereinusa View Post
I have a project using a Mega 2560.
You're not the only one with one, either.

Quote:
Originally Posted by somewhereinusa View Post
It all controls 4 solid state relays.
32 "clickers" on mine, some tank level sensors as well, fwiw.

Quote:
Originally Posted by somewhereinusa View Post
It ONLY works correctly if I power it with my desktop PC through USB. It will work for hours, turning the relays on and off at the appropriate times. Log to the data card and output through serial via bluetooth to my phone. Very, very rarely it will show -196.6 F on data and serial, not a big deal. I should add that the exact thing happens when I use a very basic sketch that only reads the temps of the 4 sensors and sends to serial.

The problem is I can't use ANY other power source to the Mega, laptop through USB, 7.5V at VIN pin, 12V at power jack, 5V at USB. When using these other power sources the temp readings randomly, on all four readings go to -196.6 F sometimes 4 or 5 in a row. Speed of readings makes no difference. Slowing down to 3000 mS makes no difference.
I believe this is all caused by Serial.begin(baud) in setup(). The controller is waiting for a serial connection which doesn't exist when powered via anything other than PC USB. Remove Serial.begin anywhere you have it and let me know if that fixes it...


P.S.: Let me know if your sketch is available on github. Mine is:
https://github.com/kazetsukaimiko/au...k/jsonlink.ino
kazetsukai is online now   Reply With Quote
Old 03-17-2020, 01:48 AM   #3
Bus Crazy
 
Join Date: Sep 2015
Posts: 2,021
Year: 2002
Coachwork: Thomas Built Bus
Chassis: Freightliner FS65
Engine: Caterpillar 3126E Diesel
Rated Cap: 71 Passenger- 30,000 lbs.
I am following this thread. I really need to get back into the micro-controller arena. Things have changed in the last few decades! I cut my teeth on the "new" Intel 8048 8-bit processors back in the day. I think my teeth are getting LONG!!!
Native is offline   Reply With Quote
Old 03-17-2020, 07:53 AM   #4
Mini-Skoolie
 
Join Date: Jan 2020
Posts: 60
Year: 1998
Coachwork: Thomas
Chassis: RE
Engine: CAT 3126
Rated Cap: 78
I aslo tinker with arduino. I have used it in control systems before on breweries.
UnicornWizard is offline   Reply With Quote
Old 03-17-2020, 07:58 AM   #5
Bus Nut
 
Join Date: May 2017
Location: Windham NH
Posts: 486
Year: 1999
Coachwork: Amtran
Chassis: International RE
Engine: International T444e
Rated Cap: 76
Quote:
Originally Posted by Native View Post
I am following this thread. I really need to get back into the micro-controller arena. Things have changed in the last few decades! I cut my teeth on the "new" Intel 8048 8-bit processors back in the day. I think my teeth are getting LONG!!!
I have a build thread, my last automation update was:
https://www.skoolie.net/forums/f11/k...d-22680-5.html


I'll have to update, I've made tons of progress since.



I'm fairly skilled with software (do it for a living, so...), but it looks like the OP has some really nice skills when it comes to schematics and wiring. I use the Arduino as a mere interface for low-level I/O, they're actually doing decision-making on the board. I actually want to do something almost exactly like what he's doing with his battery bank.
kazetsukai is online now   Reply With Quote
Old 03-17-2020, 11:17 AM   #6
Bus Crazy
 
somewhereinusa's Avatar
 
Join Date: Nov 2010
Location: Andrews,Indiana
Posts: 2,132
Year: 1991
Coachwork: Bluebird
Chassis: AARE
Engine: 3116 Cat 250hp
Rated Cap: Just the two of us.
I FOUND IT

Preliminary tests show that problem may be solved. I have been battling this for weeks. It was my benchtop power supply. I thought I had tried every combination. I was using it for 12V source for powering the voltage reducer which then powers the relays and if using VIN on the Arduino that also. Even when using other power sources for the Arduino I guess I had never actually unhooked that power supply. Switched to a 12V wall wart and all seems good.

Just checked the log. Fifteen minutes and NO mistakes. That had never happened before.



kazetsukai, I tried stopping serial, that didn't make any difference. Without serial I don't get this via bluetooth to my phone.




I find this to way more useful than any screen I could incorporate and I can see it from anywhere in the bus.

Now I can get on with installing and further testing.

kazetsukai

I've looked at your build and the github stuff. That's way over my head. Half of the stuff I don't even know what it is. Heck, I had to hire someone to write the code for this. I can kind of read code and sometimes make small changes and if not too difficult find a mistake. I get bogged down in boolean, if, else, const int, etc.

Have you done anything with MIT app inventor? Id like to add the ability to turn off a couple of things to the data screen I have.
somewhereinusa is offline   Reply With Quote
Old 03-17-2020, 11:22 AM   #7
Bus Geek
 
Join Date: May 2009
Location: Columbus Ohio
Posts: 12,680
Year: 1991
Coachwork: Carpenter
Chassis: International 3800
Engine: DTA360 / MT643
Rated Cap: 7 Row Handicap
are you parasite powering your DS18B20s? ive had issues where the reference to Ground was lost when powering with different supplies.. namely isolatyed batteries.. esp if your temp sensor grounds are anyplace but the same reference ground that the Controller uses.. thats with using the zbasic.net chips which are Atmel 328 based.. desktop power suppl;ies often pass their USB grounds through to earth ground as its usimg as 3 wire plug where many laptops lose that earth reference because of just 2 wires going from the brick.. I realize the sense of "earth" is lost being on a bus, hoswever the frame on mamy inverters is "earth"..



just a thought to make sure the Board sensor reference ground to the same ground your power is providing..
cadillackid is offline   Reply With Quote
Old 03-17-2020, 11:38 AM   #8
Bus Crazy
 
somewhereinusa's Avatar
 
Join Date: Nov 2010
Location: Andrews,Indiana
Posts: 2,132
Year: 1991
Coachwork: Bluebird
Chassis: AARE
Engine: 3116 Cat 250hp
Rated Cap: Just the two of us.
Not parasite power, I've read about many problems with that.

Latest test showed that just using bench top for one of the three voltage sense voltages resulted in dropped temp readings.
somewhereinusa is offline   Reply With Quote
Old 03-17-2020, 11:41 AM   #9
Bus Nut
 
Join Date: May 2017
Location: Windham NH
Posts: 486
Year: 1999
Coachwork: Amtran
Chassis: International RE
Engine: International T444e
Rated Cap: 76
Quote:
Originally Posted by somewhereinusa View Post
I FOUND IT
Good to hear...

Quote:
Originally Posted by somewhereinusa View Post
kazetsukai, I tried stopping serial, that didn't make any difference. Without serial I don't get this via bluetooth to my phone.
Yeah, it needs serial to talk via bluetooth. I found my arduino doesn't run in "standalone" (without a computer) mode if I do certain things in code, its probably just my sketch then.

Quote:
Originally Posted by somewhereinusa View Post
I've looked at your build and the github stuff. That's way over my head. Half of the stuff I don't even know what it is.
Well, its just a different approach. I treat the arduino board like a limb, not the brain. The arduino is the brain in your approach. In mine, the web service layer is the brain.

My approach is more fragile and complex, as it has more "moving parts", or points of failure. Yours is simpler and more reliable, as it has less moving parts. The tradeoff for me is more capabilities.

The goal of my project is that you plug in your board and configure it (along with other devices) using a web interface. You don't write code, although you could to talk to autonomy via HTTP. Autonomy would enforce things like "Board A's pin 13 corresponds to relay 1. Pin 14 to relay 2. When relay 1 is on, relay 2 must be off. If relay 2 is on and a request to turn relay 1 on comes, [turn relay 2 off first OR refuse, notify]".

Quote:
Originally Posted by somewhereinusa View Post
Have you done anything with MIT app inventor? Id like to add the ability to turn off a couple of things to the data screen I have.
No. I write web apps from the ground up typically. I think I reviewed a sketch of yours before.
kazetsukai is online now   Reply With Quote
Old 03-17-2020, 03:43 PM   #10
Bus Crazy
 
somewhereinusa's Avatar
 
Join Date: Nov 2010
Location: Andrews,Indiana
Posts: 2,132
Year: 1991
Coachwork: Bluebird
Chassis: AARE
Engine: 3116 Cat 250hp
Rated Cap: Just the two of us.
Quote:
I think I reviewed a sketch of yours before.
You did and I thank you for your help. As with most of my projects they seem to morph into something entirely different that what I started with.
somewhereinusa is offline   Reply With Quote
Old 03-18-2020, 08:04 AM   #11
Bus Crazy
 
somewhereinusa's Avatar
 
Join Date: Nov 2010
Location: Andrews,Indiana
Posts: 2,132
Year: 1991
Coachwork: Bluebird
Chassis: AARE
Engine: 3116 Cat 250hp
Rated Cap: Just the two of us.
Fifteen hours, over 5000 data logs, not one mistake. Going to try it in the bus to see if I get same results using it's power sources.
somewhereinusa is offline   Reply With Quote
Old 03-18-2020, 02:54 PM   #12
Bus Crazy
 
Join Date: Sep 2015
Posts: 2,021
Year: 2002
Coachwork: Thomas Built Bus
Chassis: Freightliner FS65
Engine: Caterpillar 3126E Diesel
Rated Cap: 71 Passenger- 30,000 lbs.
That does sound promising. Good luck with the bus trials.
Native is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off


» Featured Campgrounds

Reviews provided by

Powered by vBadvanced CMPS v3.2.3

All times are GMT -5. The time now is 02:49 PM.


Powered by vBulletin® Version 3.8.8 Beta 4
Copyright ©2000 - 2020, vBulletin Solutions, Inc.
×