Showing posts with label Car. Show all posts
Showing posts with label Car. Show all posts

Friday, 12 May 2017

In-Car GoPro headrest mount

I recently got a GoPro camera, primarily so that I can start using it to create more video content for this blog, but also from time-to-time I do driving track days, and would like to use the camera there as well.

On track days, a mechanical mount is required for any cameras mounted to the car (i.e., no suction cups to the windscreen). I wanted to capture some footage with my GoPro, so started searching around for in car mounts. The one I found mounted to the headrest, so that the camera sat at head level, between the driver and passenger seats. However, the price tag on it was ridiculous (£120+) for what is essentially a metal bar with a mount at the end. So I decided to make my own.

It centres around a length of square aluminium tube. I purchased a 500mm length online, expecting to need to cut it down a bit, but as it happens that length is ideal for my car, so I decided to leave it as-is.

The next step is to measure the position and diameter of the headrest poles. For this I just removed my passenger headrest and marked their position directly onto the tube.
The diameter calls for holes of 14mm.

Obviously, drills intended for metalwork would be preferable, but as aluminium is quite a soft metal, woodworking ones can be used in a pinch. I used a 14mm forstner drill to punch through the tube.



The bolt that will hold the 3D printed gripper in place, with holes drilled for a adjustable grip on the other side


To secure the bar to the headrest, I designed and 3D printed the parts shown below

Headrest clamp.
SCAD code listed below


The idea being that once printed, they're split into 2, and fit into the aluminium tube, where they're secured with a bolt and locking nut so that they clamp against the headrest poles. On one side the bolt will be able to be loosened and slid away, to loosen the grip, allowing the mount to be removed.
A small amount of Sugru was also applied to the inside of the plastic mounts, to provide a 'grippier' surface against the headrest, and hopefully avoid it being scratched.


GoPro Adapter.
SCAD code listed below.


I tried using some designs for GoPro mounts that I found on Thingiverse, so save me having to reinvent the wheel, however the ones I tried didn't work too well, and snapped. I decided to use one of the mounts which came with the camera, have it fit in a 3D printed frame (see right)



The initial idea was to have this fit flush in the tube, with cut outs for the mount, and holes for the bolt to thread through. However, I instead ended up oversizing the 3D printed frame, and it fit tightly into the end of the tube, so I decided to leave it as-is, although opted to keep the bolt, just to ensure the 3D printed and original GoPro mount are securely together (they're a snug fit anyway, and the bolt is probably redundant, but I'd rather have the extra layer of protection).


Test Video

 
SCAD code for the head rest clamp

difference() {
    cube([60,15,15]);
    translate([25,7.5,-1]) {cylinder(50,7,7,true);}
    translate([9,7.5,-1]) {cylinder(50,3.5,3.5,true);}
    translate([41,7.5,-1]) {cylinder(50,3.5,3.5,true);}
    translate([41,7.5,9.1]) {cylinder(r=6, h=6, $fn=6);}
    translate([9,7.5,9.1]) {cylinder(r=6, h=6, $fn=6);}
}


SCAD code for the GoPro adapter

difference() {
    lCube();
    cube([15,10,50], center=true);
    rotate([90,0,0]) {
        cylinder(50,3,3,$fn=50,center=true);
    }
}
difference() {
    cube([25,3,16],center=true);
    rotate([90,0,0]) {
        cylinder(50,3,3,$fn=50,center=true);
    }
}
module lCube() {
    cube([25,16,16], center=true);
    translate([20,0,0]) {
        cube([25,16,16], center=true);
    }
    
}










Sunday, 13 December 2015

Car Smoke Machine Pt 3

This is the final part of an on-going series of posts about a project to build and install a smoke machine in my car... for science or something...

If you missed the first two parts, they can be found here

So far we've got an e-Cigarette and an air pump wired together to produce a cloud of smoke. Now what we need is to find a way to control it and install it covertly in my car.

I don't want the trap to spring too early, I need to give them time to get comfortable in the car and get started, for it to be believable.

Also, the motor driver chip will need some logic control, so it makes sense to use a microcontroller to provide the logic and the timings.

As I mentioned in the previous post, left to it's own devices, the eCig's coil gets rather hot, so in order to counter that I wanted the microcontroller to only switch it on in 5 second bursts, then wait 5 seconds for it to cool down.

I used an ATTiny26, for no technical reason other than I have a lot of them spare.


Microcontroller code

 1 #define F_CPU 1000000UL
 2 
 3 #include <avr/io.h>
 4 #include <util/delay.h>
 5 
 6 #define CONTROL_PORT           PORTA
 7 #define output_low(port,pin)   port &= ~(1<<pin)
 8 #define output_high(port,pin)  port |= (1<<pin)
 9 #define delay(a)               _delay_ms(a)
10 #define smokeEnable            PA2
11 #define setInput(ddr,pin)      ddr &= ~(1 << pin)
12 #define isInputHigh(pinr,pin)  pinr & (1<<pin)
13 
14 int isRunning = 0;
15 int secCount = 0;
16 
17 int main(void) {
18     setup();
19     while (1) { loop(); }
20 }
21 
22 void setup() {
23     DDRA = 0xFF;  // all outputs
24     setInput(DDRB, PB6);
25 }
26 
27 void loop() {
28         if (isInputHigh(PINB, PA6)) {
29                 if (!isRunning) {
30                         delay(10000);
31                         output_high(CONTROL_PORT, smokeEnable);
32                         isRunning = 1;
33                 } else {
34                         secCount++;
35                         if (secCount > 5) {
36                                 output_low(CONTROL_PORT, smokeEnable);
37                                 delay(5000);
38                                 secCount = 0;
39                                 output_high(CONTROL_PORT, smokeEnable);
40                         }
41                 }
42         } else {
43                 output_low(CONTROL_PORT, smokeEnable);
44                 isRunning = 0;
45         }
46         delay(1000);
47 }
48 


The finished circuit
Click to enlarge
The Videos
I was hoping to use this to prank as many people as possible, and get some good video footage, but unfortunately only 2 of the videos were really usable. The first, is Craigs "We're all gonna die lads!" reaction, and the second, is Bethany's obliviousness to the cloud of smoke forming around her. Enjoy.





Saturday, 18 July 2015

In-car Bluetooth Stereo Mod

As the past few projects have been quite frivolous gadgets, this time I'm going to do something practical. It turns out this was actually one of the quicker projects I've done and makes a decent weekend project for anyone looking to make a quick upgrade to their cars audio system.

My car as an auxiliary audio input for connecting MP3 players etc. For this I purchased a bluetooth speaker adapter on Ebay for about a tenner.



It's a great device to connecting my phone for sat-nav, music etc, but there's a small annoyance in the fact that after getting in the car, it requires me to press and hold the power button for about 5 seconds before it'll turn on and connect to my phone. It's a bit of a first-world problem, granted, but it's kinda irritating, so I've been thinking about how to solve it.

Ideally, it should function like a built-in bluetooth adapter does in many new cars - as soon as the car is powered on, the bluetooth is powered on and connects to the phone.


After some experimenting with various approaches - microcontroller delays, 555 timers, I found the most functional circuit was a simple capacitor delay circuit, combined with a transistor NOT gate & optocoupler, so that the optocoupler is active, effectively holding down the adapter's power button, for 5 seconds, then switched off until the circuit loses power.


A rough schematic of the circuit I used



The completed circuit on top of the bluetooth adapter
Inside the bluetooth adapter.


Powering the circuit was simple enough - I already have a car 'cigarette lighter' to USB adapter with 2 USB ports - one powers the bluetooth adapter, and it powers on with the car ignition, so I added a USB plug to the timer circuit and used that.

Finally, I didn't want to leave exposed wires or circuit boards visible in the car - knowing my luck some paranoid idiot would freak and call the bomb squad or something, so I 3D printed a simple box enclosure which houses the adapter and the circuit nicely, the box itself nestling neatly in the centre console of my car.
The finished adapter in it's 3D printed box, ready to put in the car