Pages: [1]   Go Down
Author Topic: Possible to "turn on" an arduino via a touch on a touchscreen?  (Read 1464 times)
0 Members and 1 Guest are viewing this topic.
Offline Offline
Newbie
*
Karma: 0
Posts: 4
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Firstly, I'm new to all this programming/microprocessor stuff. Now that that's out of the way, I currently don't have a touch screen LCD, but I'm thinking/planning to use one in my truck. I've got a 94 dodge cummins so OBD2 is not an option. I would like to be able to use the LCD/arduino to control a few relay's to turn off/on my air compressor, train horns, do a high-idle modification, monitor post-turbo egt's to use as a turbo cool-down etc.. I've seen a few menu interface's (idk what to call it) that has a few buttons etc on the display.
Now, the question that i have is would it be possible to remotely turn on the arduino by touching the screen? Basically, i would wire the arduino to only come on while the ignition is on, but then also come on when i touch the screen - for x seconds. Is this possible? if not, would leaving the arduino on,but turning off the LCD/everything, would this be too hard on the atmega? I don't think that would be too big of a load for my batteries, just wondering if the chip can handle being on constantly. Or could the arduino be put in "sleep" mode.. then woken up on touch?
I realize this project is probably WAY over my head, but I'm up for a challenge.. If it's too much, I'll end up just using this 16x02 lcd display to monitor egt's and a few other engine perimeters i can find/tap into. But i just think a small touchscreen would look SICK.
Thanks for looking/helping,
       Mitch.
Logged

nr Bundaberg, Australia
Offline Offline
Tesla Member
***
Karma: 130
Posts: 8620
Scattered showers my arse -- Noah, 2348BC.
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

It may be possible depending on the LCD used, but given that the whole shebang will normally be running when the car is I'd just leave it on.

You may need brightness control though if you drive at night.

______
Rob
Logged

Rob Gray aka the GRAYnomad www.robgray.com

USA
Offline Offline
God Member
*****
Karma: 14
Posts: 644
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Now, the question that i have is would it be possible to remotely turn on the arduino by touching the screen? Basically, i would wire the arduino to only come on while the ignition is on, but then also come on when i touch the screen - for x seconds. Is this possible? if not, would leaving the arduino on,but turning off the LCD/everything, would this be too hard on the atmega? I don't think that would be too big of a load for my batteries, just wondering if the chip can handle being on constantly. Or could the arduino be put in "sleep" mode.. then woken up on touch?
Most microcontrollers, and specifically the AVR chips used in Arduinos, do have sleep modes.  However, this is not something I'd recommend someone new to microcontrollers mess around with during their first project.  This is becase using the sleep and wake-up features requires a lower level of control, manipulating bit registers directly rather than using the more intutative commands of the higher level programming (not that this is some dark art or anything, but one should learn to walk before they try to run smiley-wink ).  So I agree with Graynomad, in your case it wouldn't be a problem to have the Arduino powered either all the time or with the ignition controlled electronics.

As far as the chip surviving being on long periods or even constantly, the only potential issue is temperature.  The standard Uno uses an ATmega328P, which has a rated operational temperature range of -40°C to +85°C.  Assuming the truck has the usual heating and air conditioning capabilities, and if the Arduino is in an enclosure it allows at least a small amount of air flow (e.g. it has a few small ventilation holes), it shouldn't be a problem to keep it well within the rated temperature extremes. 

Another thing that will help is paying attention to how you power the board.  The on-board voltage regulator can in theory be directly supplied from the truck's battery, and covert it to a steady +5 VDC and +3.3 VDC.  However, since it is a linear regulator it does so by turning the the extra power (~7 VDC * upto ~200 mA) into heat.  An easy alternative would be to get a USB type power adapter for one of your trucks 12 V outlets and connect it to the Arduino's USB port (which allows both communication and +5 VDC power upto ~500 mA).

I realize this project is probably WAY over my head, but I'm up for a challenge.. If it's too much, I'll end up just using this 16x02 lcd display to monitor egt's and a few other engine perimeters i can find/tap into. But i just think a small touchscreen would look SICK.
Using a touch screen graphical LCD shouldn't be too much of a challenge.  I would just make sure you get one that has good supporting documentation, along with examples or tutorials about how to intereface it with microcontrollers.  It would be especially useful if they had pre-made Arduino libraries.  Here's an example of what I mean, there are quite a few other online stores that have similar levels of supporting material.   You might find cheaper touch screens from sellers that don't provide any supporting materials, but it will probably cost much more in time and frustration.

It's only the sleep and wake-up modes that I think would be too much for a first-time project. 
Logged

nr Bundaberg, Australia
Offline Offline
Tesla Member
***
Karma: 130
Posts: 8620
Scattered showers my arse -- Noah, 2348BC.
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
I would just make sure you get one that has good supporting documentation, along with examples or tutorials about how to intereface it with microcontrollers. 
The 4D Systems displays are pretty well supported and their forum is responsive. The interface is normal serial so that's easy.

As for code, one of the guys here (avenue33) has a extensive library for them.

______
Rob
Logged

Rob Gray aka the GRAYnomad www.robgray.com

Offline Offline
Newbie
*
Karma: 0
Posts: 4
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Thanks for all the responses. I'm waiting on a bunch of components to come in, a max6675, voltage regulator, crystals, n some other random stuff. I also have an atmega8 here, was like $3 on ebay.. Would this be large enough to hold a sketch to control a good bit of stuff? I.e., running the lcd, controlling a few relays via input from the lcd/throttle position sensor/some other engine parameters, running the max6675 + k type tc, also possibly controlling when the torque converter locks up / overdrive for the transmission..
One last question, if i get a touch screen display that doesn't use SPI(?) or i2c, are there any libraries that are out there where i can use a shift register(s) to lower the number of pins needed? Now i've got a 74hc595 running a 1602 lcd with a new liquidcrystal library someone else made.
Logged

nr Bundaberg, Australia
Offline Offline
Tesla Member
***
Karma: 130
Posts: 8620
Scattered showers my arse -- Noah, 2348BC.
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

I think I've seen such a library, have a search through the playground and libraries areas.

______
Rob
Logged

Rob Gray aka the GRAYnomad www.robgray.com

USA
Offline Offline
God Member
*****
Karma: 14
Posts: 644
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I also have an atmega8 here, was like $3 on ebay.. Would this be large enough to hold a sketch to control a good bit of stuff? I.e., running the lcd, controlling a few relays via input from the lcd/throttle position sensor/some other engine parameters, running the max6675 + k type tc, also possibly controlling when the torque converter locks up / overdrive for the transmission..
An ATmega8 only has 8 KB of memory available for programing.  It might be possible to do most or even all of the things you describe, but you'd have to have very efficient code.  Even if you save 0.5 KB not having an bootloader and used a ISC programmer (again something I don't recommend a novice start off with) instead of using the code directly from the computer running the Arduino IDE, I doubt you could take advantage of most libraries.  This is because most are written to prioritize ease of use, rather than efficiency.  Also there's the whole issue of including a stable clock (since you are going to be doing serial communication) and voltage regulator circuitry.... 

It would be analogous to throwing someone who doesn't know how to swim off a diving platform into 20 feet of water.  It's possible for them to learn quite a bit, but even if successful it will likely be a stressful and unpleasant process.  I like your enthusiasim, but when you are starting-out there's no need to make things more difficult than they need to be.  So, I strongly recommend you use a proven development board design, like the Uno, before attempting making completely custom microcontroller board.

One last question, if i get a touch screen display that doesn't use SPI(?) or i2c, are there any libraries that are out there where i can use a shift register(s) to lower the number of pins needed? Now i've got a 74hc595 running a 1602 lcd with a new liquidcrystal library someone else made.
Off the top of my head I don't know of any, but something like that is certainly possible to do.  Personally though, I'd just spend a little extra on a display that already has a controller capable of at least one type of serial communication even if it's just basic serial data at a standard speed (i.e. not a specific protocol like SPI or I2C).  IMHO, the delay and hassle avoided will be worth the extra $10 to $25 you might have to spend.
Logged

Pages: [1]   Go Up
Jump to: