Don't like the adverts?  Click here to remove them

arduino & touchslide

Jon,

Why not use a Arduino mini or nano for all the monitoring stuff. The nano has a active current draw of 250uA, standby of 15. Add a little more for some other components and it's still extremely low.
You could have a simple protocol (bastardised JSON?) talk between the two over serial or i2c for "day-to-day" stuff but in the event of an alarm, the nano could power the main one (SCR?) which does all the "hard" work.

Might be easier than trying to shut down the main one as much as possible and keep waking it up and the nano could do all sorts of things without worry.

On another note, skpang is a good source for arduino bits and pieces.
 
The mini and nano don't have the capacity for this but the power management is trivial anyway so it's not a concern :)

My current hex files for the arduino and slide are here if anyone is waiting to play. The arduino code is expecting to talk to the slide on Serial1 (pins 18 & 19). Battery 1 is pin A0, battery 2 is pin A1. Battery link outputs are on pins 32 & 33. LPG switching is on pin 22. Speed pulse sensing is on pin 2. I'm happy to go into more detail on those on request rather than padding this out with lots of information it might turn out no one wants :)

At the moment I don't intend to share the source code, not because I don't want to but because it might turn out to be useful and I don't want someone we don't know turning up and exploiting it commercially. I'll be happy to share sections of code with anyone else playing though and will keep posting hex files while there is any interest.
 
I decided to address the power management sooner rather than later - turns out the watchdog timer on the Mega (and maybe other arduino boards) has the option to generate an interrupt instead of a reset, so no need for an RTC crystal, just set the watchdog timer for the required interval and power down. I now have the slide powered through a transistor on pin 30 so the power management logic can turn it on & off and I've removed the startup and splash screen displays out of the slide code so there's only about a 500ms delay before the screen is fully active after power on. With the screen off and the arduino powered down the current draw is down to 24mA, 10mA of which is the cheap regulator on the arduino board which I'll bypass later on. Even a 14mA drain seems excessive, but is acceptable IMO.
 
Getting closer to being able to do some field testing. The temps are still fake but there's a lot more going on behind the scenes than the first pics and having the screen mounted should give a better idea of scale ;)

IMAG0071.jpg


Tap the P&L box for the P&L trip:

IMAG0073.jpg


Tap the P or L box to reset the trip and enter fuel used:

IMAG0072.jpg


It will ask for confirmation and assuming ok show you the trip l/100k (or mpg) before going back to the L&P trip which shows total distance and average l/100k. Reseting the trip when it's already zero and leaving fuel used empty will reset the total.

The beginnings of the A&B trip but there's not much to show yet and I think I'll have to edit that big number font to look at bit more normal:

IMAG0074.jpg


Bodge job connector board:

IMAG0075.jpg
 
Jon,

Looks very impressive - will (try to) catch up with your progress soon.... Although that in itself would be an achievement :roll:

Definitely interested in seeing parts of your code if possible (oil burner not lpg so mods definitely required), I've tried loading your hex files (by adding file to sketch) but get an error message when uploading - am I missing something here?

Thanks again for the info you've posted to date...
 
To accomodate oil burners and others I'll make the P & L labels selectable, so you can have M(main) and S(sub) or whatever single letter you want. If you're not interested in dual fuel trip meters just don't connect the LPG solenoid sense line and ignore the L trip :) When you're ready let me know what code you're interested in. The hex files will have to be upload'd with avrdude (that's what the IDE uses behind the scenes) but if you search the net there are helper programs to make that easier to do.
 
Don't like the adverts?  Click here to remove them
Now that's starting to look like something mounted in a box - excellent stuff :) I might have to buy in to this now.. :drool:
 
Well I plonked the mini mud pod as seen above on top of my dash and decided I wasnt that keen on it so went back to plan A which is a little box on a Brodit ball mount fixed in front of the space below the stereo. The main gubbins can live in that cubby under the stereo with a short fly lead to the display box.

There's an LDR (top left) so the display brightness adjusts to the surrounding light level and a remote reset jack (bottom left) for the trip meter mode (much easier for the navigator to have a button in their hand than be reaching across to the screen). The little cut out on the left side of the screen is just so I can reprogram the screen without undoing the casing :roll:

IMAG0101.jpg


The main trip meter display is pretty much sorted unless I think of something else it needs to do. The top big number display cycles through A,B & T when tapped. This is the only place the Total trip is visible and it can't be paused (II) or reversed (REV). A & B are both affected by pause and reverse regardless of which is on display. I can't think of a situation where you'd want to rewind say A and not B likewise for pause?

IMAG0102.jpg


I've reworked the screen shown when the speed is tapped so that selection of KPH vs MPH and l/100k vs mpg are seperate. Before you selected metric or imperial for both, now you can show mph and l/100k (for the saffers in the UK :roll: ) or kph and mpg (for me in europe :) ).

IMAG0095.jpg


If you press the Calib SET button you can choose calibration method:

IMAG0096.jpg


If you press Drive you get this display - drive your measured distance with the display updating. When you get to your end point, press SET.

IMAG0097.jpg


Enter the distance traveled in meters which defaults to 1000 and press set. There's a final confirmation screen and then you're done.

IMAG0098.jpg


Alternatively, press Known Value and enter a previous value or adjust the current value.

IMAG0099.jpg


These calibration values are recorded in the eeprom so will survive power disconnects.

The temperatures are still dummy values and are the next part to sort out. I wanted to get it to a stage where it had all the functionality of my existing gadgets before I got to the new stuff.
 
Wow. Looking great Jon.

I think I'm also going to go down the same mounting route with a separate display on some sort of gps-like mount connected to the main processor with some cat-5. Just need to get some time to put all these ideas into action.

Couple of questions: Are you using the standard fonts on the slide or the Hershey ones? I like the idea of being able to change the brightness, how are you achieving this?


Cheers
 
So far I've found the standard font plus large and extra large numbers do what I need and I've deliberately not spent time investigating the Hershey fonts to keep distraction delays to a minimum :) When I have the functionality sorted I will go back through it and make it prettier if I can :thumbup:

For brightness I just have the LDR and a 1k resistor as a voltage divider feeding ADC channel 15 on the Arduino (15 just because it suits my board layout) which the software reads and sends to the display. On the touchslide I use that value to decide what value to call setBrightness() with (0=dark, 5=max brightness). Looking at the touchslide board you might be able to use one of the ADC channels on that instead and save a couple of wires to the Arduino but it's just possible I'll want the Arduino to know light levels on its own without relying on the touchslide.
 
First field test went well :D There was a small hiccup with my existing speedo corrector putting an 8.2v DC bias on the speed sensor pulse which translated into a permanent high input on my gadget so I've taken that out of circuit for now. I'll stick a diode on it tomorrow to stop that happening and maybe I'll look into outputting a corrected pulse from this sooner rather than later. Note that the speed sensor pulse can be slightly in excess of 16v :shock: I have a 16v zener diode across the input on the Arduino to make sure it doesn't go beyond the range of the voltage divider I'm using.

I'm trying to put the interface circuit into DesignSpark so I can share it more usefully than a picture of a populated board but it's an up hill struggle at the moment :(
 
Done some field testing over the weekend and all is good so far:

IMAG0108.jpg


It had spent a lot of time hooked up to a signal generator and bench psu working fine but it's good to have it in the car and working for real. Next is making it generate a corrected speedo output pulse so I can remove the existing box of tricks that does that and it will adjust itself for the two different calibration values then :) I should also be starting to prod the temperature senders this week and getting those working but I'm pretty confident the split charge and trip functionality is sorted baring minor adjustments or someone thinking of a new feature it should have.

The interface board is quite tedious to build, not hard, just time consuming, so I won't be making them very often! I'll post detailed pics of it and some DesignSpark schematics when I've added the speed pulse output components so anyone who can solder on a fairly finely spaced board can easily build their own. It only has resistors, diodes, a few transistors and a couple of capacitors on it, nothing fancy or expensive.
 
Bit more progress tonight, managed to get a corrected speed pulse output working on the bench and add a few more UI pages to expose some of the settings that would otherwise be hard coded for my requirements. I should get chance to try out the speedo correction tomorrow and will report back.

Trip menu 'Set Calib' button has had to make way for a settings button:

IMAG0114.jpg


Settings menu that give you:

IMAG0115.jpg


'Trip Calibration' takes you to the calibration menu already shown in an earlier post. Speed correction lets you enter a % correction for the speed pulse output e.g. 95 if the speedo is reading 5% high, or 100 for no correction. LPG Delay is time in seconds between the LPG 12v input going live and actual change over to running on LPG. My LPG is set to have a 10 second delay so I enter 10 here. Just means an extra 10 seconds of travel will be credited to the petrol trip, might as well get it right :)

Then there's the battery settings menu which is shown if you tap the main battery box:

IMAG0118.jpg


Link and drop voltages should be pretty obvious. Main and Aux scale are best thought of as service engineer territory but that's where you would compensate for variations in component values and should only need setting once when the board is first built. If you have measurable voltage drop between the batteries and what the unit displays you could also compensate for that here.

Am I boring you yet and should stop?
 
What goes on behind the scenes is mildly complicated but in use it's very simple, maybe a bit hard to get that from a bunch of dodgey pictures and sketchy explanations :whistle:
 
Yeah, come on Jon, it's hardly Rocket Salad is it. I mean, couple of diodes and resistors really. Bit of soldering and voilà. Bob's yer Aunty Joan!

I love how you make everything sound so easy. Looks really smart. I want one. Sorry what does it do again? :roll:

Does it have an ice warning setting? Or perhaps it let's you know when you are half a mile from the nearest Maccy D. Now that would be handy.

Tempted to make one myself and build in those features. When I've time naturally.

Chris
 
I bet if we were discussing H&S my eyes would be glazed and you'd be saying "it's simple really you just blah blah blah" :mrgreen: Hadn't thought of the Maccy D feature, must get a GPS hooked up to it and add that :liar: It's basicly an IBS split charge controller clone with a trip meter :shifty:
 
I don't do health actually. In fact I don't actually do safety either Jon. ;)

I just do management.

Wasn't being funny - I think it's brill.

Chris
 
I think the one for Chris should have a smoke detector / alarm and an automatic halon fire suppressor trigger built in :)

(run, duck, hide :) :) )

Just kidding really - well mostly :)
 
Looking good Jon... still very much interested and appreciate your efforts in writing this up....

Can you run through the different input signals - will need to work out how these will differ on the 80! Although looking at your calibration screens this may not be such a huge problem (thanks for adding this in anticipation for the inevitable 'tweaking' requests!)
 
Back
Top