Adventures with an Arduino

#21
The printing finished up and I'm very happy with the fit into the coin tray.

1595905522477.png

1595905536431.png

I'll have to reprint the outer bezel as there was a small miscalculation on the height of one of the connectors on the back of the Nextion screen. I can't quite completely close things up. Looks like I need to add another 1.5mm worth of material so it'll snap closed nicely.

1595905679730.png

One step closer to being installed in the truck.
 
#22
Well rather than reprinting the portion of the housing I made 1mm short I put together this piece to go in the middle. It also has much better standoffs to hold the Nextion display in place. The two numbs on the outside piece were really just for locating the screen in place. These actually press the circuit board firmly up against the outside of the housing.
1595994170905.png

So freaking cool to design something and then hold it in your hand an hour later.

1595994358011.png

Screen fits snug with just the right amount of room to run the wires.

1595994407831.png

And everything snapped together pretty nicely. Upping the print resolution for the final version should eliminate the stair-stepping and close up the gaps and ridges where the 3 parts snap together. This will work well for testing in the truck though.

1595994488567.png
 
#25
So that whole reinventing the wheel thing...I don't seem to be able to leave well enough alone.

I took my prototype, stuck it in the coin holder after reinstalling said holder in the truck and...I hated it. The angle was off. The dash has a natural curve at the edge of the coin tray and my shroud had a sharp corner that didn't match. Basically it was going to take a lot of fine tuning, adjusting angles, rounding edges, etc. I could throw all these tweaks at the model, wait 4 or 5 hours while it printed and then test it again. I'd probably have to do this 5 or 6 times, and I could probably get it to where I would like it. That's the beauty of 3d printing I suppose. Multiple prototypes, fairly cheaply in a short amount of time. The thing I wouldn't be able to fix is I didn't care for the ergonomics of it. It's a little bit of a reach to get to the screen, nothing horrible, but enough that I didn't care for it. I also happened to have a large cup from McDonalds sitting in the armrest cupholder that impeded my view and access to the touchscreen. So back to the drawing board.

I took the front cover off, taped the screen in place and started holding it all over the truck. The F250 has a natural void, that's flat I might add, on top of the dash just to the left of the cluster. A lot of aftermarket tuning companies use this area to mount their tuners. This seems like a win. I liked the position and it should be easy to stick something up there. Out of direct line of sight so it's not a hindrance while driving. Let's see what I can do with this.

Here's a picture of a dash mount for a Bully Dog tuner for the F250:

1596250649228.png

So my thought is not to have to print that entire shape, but instead just use this location and "appropriate" a design from a popular action camera brand. So, borrowing some parts from a free model on Thingiverse, I came up with this:

1596250857178.png

I learned some things from my initial model so this is an improved housing. The screen cutout is much more precise so only the usable amount of the Nextion LCD, plus about a 2mm border, show through. I also came up with a retention method to hold the screen in place against the front of the housing using this little clip design:

1596251032522.png

The post goes through the mounting holes on the Nextion board, pushing past the angled portion of the tab next to it, and the straight edge locks it in place. I printed several versions of this little tab to get the spacing and size just right. At around 3 minutes a print this was a great use of the 3D printer to get the fine details right before printing the entire model.

I also decided that since I was going to have this level of accurate retention I could make use of the exact positioning and cut a slot for the micro-SD card slot on the board. This would allow updates to the programming and images on the Nextion without having to disassemble anything. Sweet! Additionally I cut a relief in the top of the housing to allow a back panel to slide in and created a small tab on the lid to lock things in place.

1596251328826.png

1596251361147.png

4 1/2 hours later I had this:

1596251648890.png

Because it printed face down the slicer put support material under the rounded edge of the gopro mount. This proved difficult to remove so I might need to come up with another shape here. The clips worked perfectly the first time and I can drop the housing from a height of about 5 inches off the desk before the board will pop loose. I think once everything is done I'll add a small dab of adhesive to cover the post and tab to more permanently mount the screen and keep it from bouncing out on rough roads.

1596251853700.png

Also added this little reinforced opening to route a wire through to make the connection to the screen. Originally I had thought about packing the screen and arduino in one housing, but to keep this compact I'm going to mount the arduino (and the relay board) remotely inside the dash. I sourced some 4 conductor wire that will feed through and connect to the Nextion.

1596252043588.png

Now to print some Gopro style clips and get this thing mounted.
 
#26
Changed my mind on mounting again. :D

Printing the Gopro style mounts worked well, but just looked clunky in the end. It was good to get the dimensions and process down as I might use this mounting method in the future, but for now I decided to make a custom t-track to mount up on the center of the dash. This keeps things modular as I can put together little pods that slide in and out. Redesigned the Nextion enclosure to make it a little stronger and rethought my cable management with the new mounting location.

1598286053849.png

The track matches the profile of the storage compartment on the top of the F250 dash, and has tapered holes for the screws I'm using to mount it with. The holes on the backside of the track allow me to insert a nut and use a small screw to clamp the shrouds in place anywhere that I slide them to on the track. This keeps the fasteners hidden and everything nice and neat. This is a sample of the track as I was getting all of the mounting holes sized correctly:

1598286209966.png

I then did some test prints to get the profile correct and generated the final product:

1598286277829.png

1598286297981.png

This shot is before the track was mounted. The gaps between the dash and the bottom of the track closed up once the screws were put in:

1598286352310.png

I put a little bit on an angle on the track so that the Nextion screens roughly match the viewing angle of the head unit in the dash. Moving on to wiring now...
 
#27
Gallowbraid
Nice work and nice write-ups. A curiosity question - I am considering the purchase of a slightly used Transit van for adventuring. Most have no factory tow package. I am unfamiliar with current CAN systems, but, have heard bad stories about tapping into various factory circuits and the canbus going “crazy.. I have not done any type of coding since early to mid 1970s with Fortran. I am thinking about using the relay board and the Arduino to tap into the tail lamp system (tail and brakes) so the Can system would not see any appreciable change in the lamp amp draw. Main power for the relays would come from the engine battery then to the trailer. In your opinion, Would the Arduino work with an “intermittant” voltage signal (turn signal) and actuate the relays properly. Would the relay board tolerate the heat of a relay engaged for an extended period of time (fail lamps illuminated on a long drive)?
Maybe a direct relay board tie into the factory lights as 20mA relay draw may not be seen by the Canbus?

thanks in advance
 
#28
Gallowbraid
Nice work and nice write-ups. A curiosity question - I am considering the purchase of a slightly used Transit van for adventuring. Most have no factory tow package. I am unfamiliar with current CAN systems, but, have heard bad stories about tapping into various factory circuits and the canbus going “crazy.. I have not done any type of coding since early to mid 1970s with Fortran. I am thinking about using the relay board and the Arduino to tap into the tail lamp system (tail and brakes) so the Can system would not see any appreciable change in the lamp amp draw. Main power for the relays would come from the engine battery then to the trailer. In your opinion, Would the Arduino work with an “intermittant” voltage signal (turn signal) and actuate the relays properly. Would the relay board tolerate the heat of a relay engaged for an extended period of time (fail lamps illuminated on a long drive)?
Maybe a direct relay board tie into the factory lights as 20mA relay draw may not be seen by the Canbus?

thanks in advance
Thanks for the kind words.

As far as tapping into factory harnesses and not having the CANBUS throw a fit it really depends on the vehicle. I've had good luck with most Ford vehicles up to around 2017, haven't messed with anything newer than that. To contrast that I did some work on a 1999 BMW that had multiple local networks running within the factory wiring and it wasn't happy if you even wiggled a wire much less tapped into something. Modern Dodge/Jeep/Chrysler vehicles have multiple networks running internally and at different speeds. If you start providing a bridge between wiring that's on different internal networks hilarity and disaster can ensue. :eek:

Taking a quick look there are several kits on the market for Transits that add trailer wiring and even trailer brake controllers by tapping into the tail light wiring: LINK

If you wanted to go the DIY route and all you're wanting to do is run trailer tail lights you could skip the arduino altogether and just use the relays if you're worried about drawing too much amperage. The factory tail lights could trigger your relays and then you could feed 12v through the relay to the trailer lights. Keep in mind though that normal automotive relays aren't typically designed to operate turn signals, usually a specialized relay (flasher relay) with a thermostatic switch that pulses on and off is used to run the factory turn signals. Normal relays would work, but the frequent on/off would cause them to wear down faster due to their electro-mechanical switching element. "Faster" is relative. Bosch style relays (good ones anyway) are typically rated to last mechanically for 1 million cycles. I've never counted how many times my turn signals flash and my brake lights come on in a day but I bet it would take a long time to get to 1 million (although now I want to know the answer to that question). Electrically speaking it depends on load, but most are rated between 100,000 to 200,000 cycles. Flasher relays skip the electro-mechanical mumbo jumbo and utilize elements that heat and cool to make their connections. They'll last for as long as those elements last (typically a long, long time).

If you're set on using the Arduino there will be a few things you'll need to do:

1. Powering the Arduino requires that you step the vehicle's 12v system down to the 5v that it needs to run. The relay board would require the same. You'd want this power to turn on and off with the Accessory circuit of the vehicle.

2. The input signal you get from the vehicle (turn signals / brake lights) into the digital pins on the Arduino will also need to be stepped down via resistors to 5v. The arduino will absolutely handle this intermittent signal, that's what the digital pins are designed for, monitoring high/low | on/off states.

3. You'll need to decide where you're going to pick up your input signals from. If you tap into wiring that's between the turn signal switch and the flasher relay you'll need code on the arduino to control the "flashing" of the relay you're outputting to because your input signal will be a steady 12v. With this method it would take some trial and error to get your trailer lights to match your vehicle lights as far as the timing of the turn signals flashing.

If you tap into wiring between the flasher relay and the tail lights your code will be different because your input will turn on and off because of the flasher relay. This would make for easier coding and the timing of your relay turning on and off would match your factory turn signals. This would be the intermittent signal scenario.

4. You'd want to look at the rating for whatever relay board you source to determine if it could handle what you're wanting to do. As far as it handling running tail lights on a long trip I would imagine almost any good quality board would have no problem. You're essentially closing a circuit and lighting up an incandescent light bulb. If the trailer had LEDs it would be even less of a strain on the relay. Flashing, or the cycling on and off of the relay would be the thing that would cause the most wear and tear so double check the cycle rating of the relays on the board. A common relay used on those boards is the SRD-05VDC-SL-C, it's data sheet shows that it's rated to last mechanically for 10,000,000 cycles and electrically for 100,000 cycles. However it's maximum cycles in a minute is 30 so it might not be able to match the flashing of the turn signals depending on timing without causing additional degradation of the relay.

By the time you invested in the arduino, relay board, wiring, any connectors, loom, heat shrink, mounting supplies, etc you're probably well on your way to buying a pre-made kit like this one: LINK

But plug and play systems like that aren't as fun as putting together something on your own. :D Plus with the arduino you could violate DOT regulations and get your trailer lights to pulse out morse code messages when your turn signals are on.

All of this ultimately hinges on the fact that control of the turn signals and brake lights in your given vehicle hasn't been turned over to a computer in the vehicle completely. There's a chance that the turn signal switch is just activating programming within a CANBUS module that's then controlling the lights (much like you want to do with your Arduino). That'll change where you'd want to pull your signals from. Sounds like a cool project, post up your results if you decide to tackle it!
 
Top Bottom