Showing posts with label Project. Show all posts
Showing posts with label Project. Show all posts

Tuesday, 28 March 2023

How to create a Photo-Log or Timelapse with a simple raspberry and an usb webcam

As the title may suggest... Started with a bit of scripting, had a Raspberry pi 3b+ lying around and decided to use it for some time-passing productive activity so I just attached it to a Microsoft LifeCam HD-3000 I had unused, fresh raspbian installed on the SD card and SSH enabled through the raspi-config.

In Summary we used:
  1. Raspberry Pi 3b+
  2. Raspberry power supply
  3. Sandisk microSD card 16gb with raspbian installed on it
  4. usb webcam

So we create the following bash script which I named autoshot.sh I used NANO editor to create this (sudo nano autoshot.sh), script content as follows:

 #!/bin/bash
echo off
DATE=$(date +"%Y-%m-%d")
COUNT=1

while [ $COUNT -le 120 ]
do
        echo Photo: $COUNT
        TIME=$(date +"%H%M%S")
        fswebcam -r 1024x768 -S 10 /home/pi/PROJ/webcam/photos/$DATE-$COUNT-$TIME.jpg
        sleep 30s
        ((COUNT++))
done

And we run as follows and get the following result as well:

pi@raspberrypi:~/PROJ/webcam $ ./autoshot.sh
off
Photo: 1
--- Opening /dev/video0...
Trying source module v4l2...
/dev/video0 opened.
No input was specified, using the first.
Adjusting resolution from 1024x768 to 1280x720.
--- Capturing frame...
Skipping 10 frames...
Capturing 1 frames...
Captured 11 frames in 0.33 seconds. (33 fps)
--- Processing captured image...
Writing JPEG image to '/home/pi/PROJ/webcam/photos/2021-04-05-1-180416.jpg'.
Photo: 2
--- Opening /dev/video0...
Trying source module v4l2...
/dev/video0 opened.
No input was specified, using the first.
Adjusting resolution from 1024x768 to 1280x720.
--- Capturing frame...
Skipping 10 frames...
Capturing 1 frames...
Captured 11 frames in 0.33 seconds. (33 fps)
--- Processing captured image...
Writing JPEG image to '/home/pi/PROJ/webcam/photos/2021-04-05-2-180447.jpg'.

Then we just need to either use the raspbian GUI or setup a samba shared folder on the raspberry to grab the photos from a windows machine, for example.

Saturday, 15 February 2020

CGGA 01 > Introduction


With this post series I want to take coverage over the engine which gave me some delights and nightmares as a daily car for some years; We are talking about a conservative, bottom range, underpowered, brave in the middle range, liter and almost a half vw petrol engine.

My experience

The way I experienced this engine was in an mk6 Volkswagen Golf, a rather unpleasant way cause of the weight to power ratio, clearly being the most dissapointing feature of the car itself.

Just 59 kW / 80 ps for almost 1.300 kg which makes a 0,045 kW/kg power to weight ratio, in comparison, a first generation 1.3 liter Golf weighted as much as 930 kg with 44 kW / 59 hp. That still makes 0.047 kW/kg. Slightly more than the 30 years later model.

Even in this configuration the car manages to be fun to drive on twisty roads due to the light of the front end. It kinda likes to move sideways completely without under or oversteer but tending to understeer given extreme situations. The softnes of the suspension seems to help balancing the weight although. Still need to try with different dynamic setups.

In regarding to maintenance and knowing that this car enjoyed a sporty driving always, the following seems enough to say that we have a robust engine:
  1. Castrol Edge 5w-30 every ~10.000km
  2. new plugs installed and intake plastic union repaired after 80.000 km(union between both pieces that form the intake broke the glue seal/union and created a leak of air in the intake between the throttle body and cilinder head, happened always idling due to the increased vibration, I suppose, and the ECU jumped into emergency mode not allowing to throttle and keeping the engine around 2.000 rpm If my memories are correct).

Wikipedia specs for the weirdos:

The CGGA engine is usually found in the following vehicles:

Audi A2, SEAT Ibiza, SEAT Córdoba, SEAT León Mk1, SEAT Altea, SEAT Toledo, Škoda Fabia, Škoda Octavia II, Škoda Octavia II Tour, Škoda Octavia II FL, Škoda Roomster, Volkswagen Lupo, Volkswagen Polo, Volkswagen Golf, Volkswagen Bora, Volkswagen Jetta, Volkswagen New Beetle

It is a 1.4 liter, inline four cilinder, four valves per cilinder, internal combustion engine. In detail as follows:

  • Engine displacement & engine configuration:
    1,390 cubic centimetres (84.8 cu in) inline-four engine (R4/I4); bore x stroke: 76.5 by 75.6 millimetres (3.01 in × 2.98 in), stroke ratio: 1.01:1 – 'square engine', 347.5 cc per cylinder, compression ratio: 10.5:1
  • Cylinder block & crankcase:
    cast aluminium alloy; five main bearings, die-forged steel crankshaft
  • Cylinder head & valvetrain:
    cast aluminium alloy; four valves per cylinder, 16 valves total, double overhead camshafts (DOHC)
  • Fuel system:
    multi-point electronic indirect fuel injection with four intake manifold-sited fuel injectors
  • ID engine codes, DIN-rated motive power & torque outputsAHW, AXP, AKQ, APE, AUA, BCA, BBY, BKY:
    55 kilowatts (75 PS; 74 bhp) at 5,000 rpm; 128 newton metres (94 lbf⋅ft) at 3,300 rpm
    BUD, CGGA:
    59 kilowatts (80 PS; 79 bhp) at 5,000 rpm; 132 newton metres (97 lbf⋅ft) at 3,800 rpm
    BXW, CGGB:
    63 kilowatts (86 PS; 84 bhp) at 5,000 rpm; 132 newton metres (97 lbf⋅ft) at 3,800 rpmAFH, AFK, AUB, BBZ (discontinued):74 kilowatts (101 PS; 99 bhp) at 6,000 rpm; 126 newton metres (93 lbf⋅ft) at 4,400 rpm

Some other specs:

Engine codesBCABUDCGGA
Manufactured
Golf from model year 200408.03►06.06►---
Golf Plus from model year 200511.04►06.06►---
Golf from model year 2009------07.08►
Golf Plus from model year 2009------02.09►
Emission standardsEU4EU4EU5
Capacitycm3139013901390
OutputkW at rpm55/500059/500059/5000
TorqueNm at rpm126/3300130/4200130/4200
BoreØ mm76.576.576.5
Strokemm75.675.675.6
Compression ratio10.510.510.5
Valves per cylinder444
RONmin.95 unleaded (in exceptional circumstances min. 91 RON, however with reduced performance)95 unleaded (in exceptional circumstances min. 91 RON, however with reduced performance)95 unleaded (in exceptional circumstances min. 91 RON, however with reduced performance)
Injection and ignition systemMotronic ME 7.5.104HV4HV
Firing order1-3-4-21-3-4-21-3-4-2
Exhaust gas recirculationyesnono