Show Posts
Pages: 1 ... 113 114 [115]
1711  Using Arduino / Project Guidance / Re: arduino wont work properly without soft reset on: September 12, 2011, 10:44:21 pm
Thx for catching that typo I had in brightness, lucky for me it still did what I wanted by just running that anyway, which is why i probably didnt notice, I could probably remove the if(
and temp1 is just shorter lol, I could definetly use or reuse a more. Accurate name but with all the alterations I make sometimes its just easier to define a new variable
And what I do by setting it and checking it is my way of ensuring the device is working properly
if I set it to 9 and it returns something else I know something is fishy or not connected and draws the status to my startup screen

1712  Using Arduino / Sensors / Re: ds18b20 filtering? on: September 12, 2011, 10:29:40 pm
Yeah I was using it without parisitic mode : /
and I didn't mean that the 5v reg wasn't working but that the sensor was not working when the arduino is supplied with the 12v, the reg does put out 5 v pretty accuratly, but I think it doesn't regulate the usb in so I thought it may be related
1713  Using Arduino / Sensors / Re: Interface with car's RPM and Speed sensors on: September 09, 2011, 09:06:27 pm
A more expensive route, but 99% acuurate way eould be to interface the obd2 connection and request that info directly from the ecu,
You could get tons of other things too like temps, pressures, and other readings
It would depend tho if your car has obd2 and you felt like buying a shield for the interface
1714  Using Arduino / Sensors / Re: ATMega328 ADC Temperature compensation? on: September 09, 2011, 09:01:30 pm
Ive founf out in my setup that my measured vin is accurate to 1% -20mv
I used the same thing with a voltage divider,
If you need to keep the vref at 5, you can temporarily change it to 3.3, then measure your 5v out, then adjust back to vref
1715  Using Arduino / Sensors / ds18b20 filtering? on: September 09, 2011, 08:55:57 pm
I had two ds18b20's on my one wire bus, then one crapped out for sone reason, ni big deal, the next day tho my other was reading 0c constanly
Then i found out it worked fine if it was powered from usb, even tho 5v regulator wasnt good enough my 4.1 v usb worked?? And the onboard 5v line wouldnt work it when i powered from 12v vin
so i put a 10uf cap by the sensor and now its all good from eirher power
Can anyone explain why this happened?
1716  Using Arduino / Project Guidance / Re: arduino wont work properly without soft reset on: September 09, 2011, 08:12:39 pm
The display works fine, along with all the code for it,
the touchscreen is separate and is the 4 wire resistive type
I trid the delay before and after the one wire code thinking that since that's what's causing it I should isolate it it, it seems to only be the actuall communication, becajse if no sensors are on the line its fine

Edit
Here is involved code, the ehole code is 30kb
 

p = ts.getPoint(); // touch reading code that fails the first powerup, part of main loop   
 
   if (p.z > MINPRESSURE && p.z < MAXPRESSURE) {  //touch reading refinement     
     p.x = map(p.x, TS_MINX, TS_MAXX, tft.width(), 0); //     x reading                   
     p.y = map(p.y, TS_MINY, TS_MAXY, tft.height(), 0);//        y reading               
     
if(brightness = 1){
       
       screentimer = time;
       brightness = 0;
       digitalWrite(LCD_BRIGHTNESS, brightness);
     }
 }


sensors.begin(); // part in setup, and the root of all evil, but only the first time assuming a device is on the line
sensors.setResolution(insideThermometer, TEMPERATURE_PRECISION);
sensors.setResolution(outsideThermometer, TEMPERATURE_PRECISION);


temp1 = sensors.getResolution(insideThermometer);
temp2 = sensors.getResolution(outsideThermometer);

if(temp1 !=9){    // these dont cause it, i added afterwards
  tft.println("TEMP1 BAD");
}
if(temp1 == 9){
  tft.println("TEMP1 GOOD");
  temp1 = 1;
}
if(temp2 !=9){
  tft.println("TEMP2 BAD");
}
if(temp2 == 9){
  tft.println("TEMP2 GOOD");
  temp2 = 1;
}
oneWire.reset();  // tried with and without this thought maybe it was hanging



// sensor read code in main loop

if(time - sensorreadtimer > sensreaddelay){
     sensorreadtimer = time;
     temperature1 = 0;
     temperature2 = 0;
     sensors.requestTemperatures();
     if(temp1 == 1){
     temperature1 = sensors.getTempC(insideThermometer);
     temperature1 = DallasTemperature::toFahrenheit(temperature1);
     }
     if(temp2 == 1){
     temperature2 = sensors.getTempC(outsideThermometer);
     temperature2 = DallasTemperature::toFahrenheit(temperature2);
     }

     
     analogRead(A13);
     rawvoltage = vref * analogRead(A13); //voltage sensor
     rawvoltage = rawvoltage / 1024;  // to mv
     rawvoltage = rawvoltage * 6.5767; // times the voltage divider constant
     batteryvoltage = rawvoltage; // to actual voltage sensed

     analogRead(A12);
     rawcurrent = vref * analogRead(A12); // conv to mv, not finished
     rawcurrent = rawcurrent / 1024;
     rawcurrent = rawcurrent - 2.5; ratiometric
     rawcurrent = abs(rawcurrent);
     batterycurrent = rawcurrent;
   }
1717  Using Arduino / Project Guidance / arduino wont work properly without soft reset on: September 09, 2011, 07:41:19 pm
I recently added ds18b20's to my project and aver aince then my touchscreen code has been being skipped until i press reset, after that it works 100%
Ive been debugging it by turning on and off the pin 13 led at various time and noting the timing of my main loop during normal operation,
I've found that the timing is different during the initial loop after power on, and that my code that maps the xy of the touchscreen ceases to run, basically skipping it
I press reset and it runs fine : /
Anyone have any solutions for me? The only I can think of is to try to self reset only once after power on, probably with this code
 void(* resetFunc) (void) = 0; //declare reset function @ address 0
 ResetFunc(); //call reset

Problem is id like to not use eeprom to sorta save its already been reset, its for my car which, may turn on and off rapidly during ignition,  and I can't add like something that turns off the resetting to the missed code because its only run if its touched

1718  Using Arduino / Project Guidance / Re: arduino in car on: September 03, 2011, 10:33:12 pm
Im using female to male jumper wires I got off ebay, they make it real easy to move things around
especially since this project requires 28 different connections to my arduino mega
And so far ive had no problems with them

And that seems like an interested power supply, ive didnt know they made them that small
1719  Using Arduino / Project Guidance / Re: REM DETECTOR on: September 03, 2011, 10:16:58 pm
You would need something connected to the arduino to trigger anything, even powering an ir led to signal an external sort of devide to turn on leds
im not aure how it'd work with interference but simply an ir receiver to a transitor switching leds can probably remotly trigger leds
1720  Using Arduino / Project Guidance / arduino in car on: September 03, 2011, 10:04:33 pm
Im planning on putting an arduino in a space below my radio in my car, im just wondering if there are any precautions I should take and if the ones im planning are neccary
here's my planned ones
5v regulator to keep about 200 ma draw off the board
Adj regulator to smooth the 12/16 volt input to like 9/10, worried about how serious it is to go above the 12 volt recommended input
100uf cap to smooth vin
12v dc fan to circulate air, im. Ot sure how neccesary this is but I heard a car can get to like 160 degrees f and I don't wanna destroy my tft screen
is there anythiing else I should be worried about?
1721  Using Arduino / Project Guidance / Re: current sensor for car battery on: September 01, 2011, 07:47:56 am
That's true, id probably get an innacurate reading of the actual current used because the battery may not be discharging, or even charging
perhaps then ill focus on only monitoring the current that my addons use, since they are powered off the battery directly through a fuse block,
thx for the tip, I probably would've taken a week to figure that out lol
1722  Using Arduino / Project Guidance / Re: current sensor for car battery on: August 28, 2011, 01:51:04 pm
That sounds like a good way to do it, i wasnt even thinking about the negative side,
What eould i need to be able to measure the voltage drop across across it?
1723  Community / Exhibition / Gallery / car lights control and sensors on touchscreen with datalog on: August 27, 2011, 09:39:10 pm
This is my first atttempt at a lights control device for my car, its got 2 temp sensors a voltage divider for battery,monitor and in the future a current sensor
I have it displayed on a touch screen, and the sensors info is recorded to an sd card
just wondering in anyone has any suggestions that might make it more efficient or a cool idea to add, lol I wanna put it in but idk what else to add
I've got like 25 extra pins and ton s of. Memery left
1724  Using Arduino / Project Guidance / Re: How to detect power failure? on: August 27, 2011, 01:56:49 am
From my experience,  aka I wondered if it'd work, you can power a led directly from ac mains with as little as a 20k resistor
I used a r of about 18k in series with the led and it worked fine, the resistor got warm but not hot,
now its probably not the safest or most relible but its real cheap to just set the one led up to the mains and tape another directly opposite as an optoisolator to the arduino,
the color of the led used will be the output voltage, I find that uv works best since it puts out about 4 volts
1725  Using Arduino / Project Guidance / current sensor for car battery on: August 27, 2011, 01:49:00 am
I have a project where I have various lights controlled from my arduino mega, with temperature sensors, and a voltage divider to monitor battery voltage. I have a 2.8 tft touchscreen hooked up to display info and xontrol the light zones. However I would like to also monitor the current draw on the battery. I have an sd card slot hooked up for datalogging purposes too. Everytgimg works flawlessly, except my attemp at a current sensor, I have a a1302 which is a ratiometric hall effect sensor, I can convert the output to mv minus the offset no problem, I just don't know how to use it to translate the magnetic field from my battery cable to actually amperage measurement
any suggestions on an easy noninvasivd sensor with millivolt output? Because its a car im not interested in a shunt,  more in the hall effect approach
Pages: 1 ... 113 114 [115]