360 spin photography

Just finished using AutoCAD to draw up my diagram.
I've converted it to a jpg for this forum (and fixed an error, Paul)

Nice.

You have unnecessarily involved I/O pin 1, which is used for serial communication with your PC for downloading and debugging and whatever.

I suggest you use a different pin for that one in your stepper object.

You don’t use Serial comms in your program, but if/when you ever do, or if someone working off your project wanted to, that would be in the way, so.

I think the miniature bottle club you belong to will be very impressed. :expressionless:

a7

First major blunder:

You show the 5 V power connected to "Vin". :astonished:

Never fear, I'm still keeping my eye on you. :sunglasses:

1 Like

Hi Paul,
Power can be applied via a USB to USB A cable, a 5-20V input to the power connector, or the Vin pin.
I've tried all three, and I don't see it as a blunder if power is applied to a pin called - wait for it- Vin.

One description of this UNO board told me I could use Vin as a method of applying power to the board.
So why is it a major blunder to use a V(oltage) in(put) pin to apply power?

It works, and saved me the trouble of cutting a matching hole in my front panel.
Cutting a square hole for the USB A port was finicky enough, so I took the easy way - drill a round hole for a round connector in the back panel.

cheers - Graham

Hi a7,
I used 4 to 7 originally, but thought "Why not try 1-4 to see if it still works"
It did. I haven't bothered to change them back (yet)
So, if anyone would like to use pin 1 for I/O , then reposition the pins and "correct" the program. (now changed the pins to 2-5)

I hope the President of the NZMBC likes what I'm doing, though it could increase the size of the quarterly magazine, if everybody follows my lead.
I have 1500 miniatures, but there's literally thousands of them, from every corner of the world.

I just might change other miniature bottle clubs' presentation of their products.

I'm currently building a light box using ivory plastics, and I keep thinking up better ideas on how to do that. I'm on version 4, I think

The concept works, but bottles being bottles cause problems with internal reflections.
Not like the Nike shoe I see in ads for a 360 spin video!!

I'm playing with different coloured backgrounds to see what happens

cheers - Graham

Hi Paul,
apologies, friend.
I think I get what you said.
Power required is 6-12 volts, so using 5 volts must be borderline. (and should be connected to the cente pin, not the ground!!)

While I was setting up the project in a different spot, I noticed the power adapter was set to 6 volts. (multi output, from 4.5v to 12v)

So I set it to 5, and the board still worked, but once or twice, the trigger pin didn't work.
I'm assuming the board may have been unstable, so I've set it back to 6 volts, and the trigger hasn't faulted.

cheers - Graham

Point is, if you have a properly regulated 5 V supply, then that should always be supplied to the "5V" pin.

And "properly regulated" is somewhat relative; it needs to be reasonably stable against sudden demands for current (from the output pins), should not go ridiculously low (below about 4 Volts) and certainly should not exceed 5.5 V.

So if you are feeding it with a switchable supply which could accidentally be altered, perhaps better if you do not use the "5V" pin. :face_with_raised_eyebrow: OTOH, a nice USB "phone charger" makes a good supply.

The carousel comes with recesses for a 3.75v 16560 battery, or three AAA batteries, so the ULN2003 is battery driven (with a charging facility)
All I had to do with it was provide a connector to allow the four stepper motor control lines and an earth back to a mini instrument case with the Uno in it.

At the moment, I'm using five pin connectors with a made up cable.
It looks messy, so I'm waiting for two USB/DIP boards (about $2.50 each) to arrive, to be able to use an ordinary USB-A to USB-A cable from the case to the Carousel.

Power considerations on the Uno is just for the Uno, so I'm staying with Vin to power it, not the provided 5V socket.
My 60 years of being an electronics technician tells me that.
I did an RMIT diploma course in 1962, then worked for the next 20 years on RAAF aircraft, and since then, for myself.
I was brought up on computers from when they were just 4 bit devices, took up rooms and needed airconditioning.
Heck, I even taught basic computer principles for 3 years at the RAAF School of Radio.

btw, I already have plenty of USB phone chargers, left over from the many phones I've had since the first Nokia I bought 30 years ago. There's several that are just fine for this project

Innit strange - phones may die, but their chargers live for forever. Tough little buggers, aren't they?

  • Graham

I've been fine tuning the program.
First was to have the carousel rotating clockwise, so I reversed the 'firing' order to 5,3,4,2

Then I revised the sector/steps to be closer to 2038 for a full rotation.

Still playing with the timing

#include <Stepper.h>

#define loStepCount   6           // First count control  (a 3 position switch)
#define hiStepCount   7           // Second count control
#define trigger       8           // The pin that triggers carousel rotation 
#define shutter       A0          // camera shutter (analog pin, not a digital pin)

int steps;                        // Number of Steps to rotate one sector
int sectors;                      // sectors to complete one revolution

Stepper myCarousel = Stepper(56, 5, 3, 4, 2); // Instantiate a CW rotating stepper object

void setup() {
  pinMode (loStepCount, INPUT_PULLUP);
  pinMode (hiStepCount, INPUT_PULLUP);
  pinMode (trigger, INPUT_PULLUP);
  pinMode (shutter, INPUT);
}
// the loop continually monitors the 'trigger' pin
// if the trigger goes low, get the hi/med/lo position of the switch,
// take a picture
// rotate the carousel x sectors by y steps/sector 
// (taking another picture at the end of each sector)

void loop() {

  steps = 85; sectors = 24;             // 24 sectors @ 85 steps per sector (2 steps over 360 degrees)

  if (digitalRead(loStepCount) == LOW)
  { steps = 58;  sectors = 35;}        // 35 sectors @ 58 steps per sector (8 short of 360 degrees)

  if (digitalRead(hiStepCount) == LOW)
  { steps = 113;  sectors = 18; }      // 18 sectors @ 113 steps per sector (4 short of 360 degrees)

  if (digitalRead(trigger) == 0)       // trigger pin has been grounded
  {
    pinMode (shutter, OUTPUT);         // Set camera shutter
    digitalWrite (shutter, 0);         // 'ground' the shutter
    delay(300);                        // allow some time to take a picture
    pinMode (shutter, INPUT);          // reset camera shutter

    // first picture has been taken, so rotate the carousel, and take more pictures
    
    for (int i = sectors; i > 0; i--)  // 18, 24 or 35 sectors to complete nearly one revolution
    {
    myCarousel.setSpeed(90);           // rotate at speed selected
    myCarousel.step(steps);            // rotate steps clockwise as per Hi/Med/Lo switch setting
    delay (4000);                      // wait a bit while carousel rotates
    pinMode (shutter, OUTPUT);         // set camera shutter
    digitalWrite (shutter, 0);         // ground the shutter
    delay(300);                        // allow some time to take a picture
    pinMode (shutter, INPUT);          // reset camera shutter
    }
  }
}

Had to look for this, seems like most evidence was carefully scrubbed.

Anyway, good move.

What remains to play with around the timing?

Also, what is the final output of your process? Can you post a link to a final whatever it is?

I told my GF about your project and she brought me up to speed by using the common term in these parts for miniature bottles, “nips”.

the word “nip” is the regional slang for a tiny bottle of booze, usually 50 ml in size

Here they are more commonly seen empty, discarded and making up a decent fraction of litter. Sad.

a7

To Alto777,
Yep, most seem to be standardised to 50 mL, but can vary from 20mL for a very tiny Coke bottle up to about 100mL. Miniatures with unbroken seals can fetch quite a few dollars, and rare Scotch minis can be $25 - $100, or more.
I valued my minis to be about $5000, but they're my hobby.
Sonny boy might drink them when I die, or sell them.
Up to him
Anyway, I've been collecting them for about 50 years, and the Italian makers of about six of them say they're so old, they don't even have a record of them any more!!
I can't even value them, because I'm the only one who has them.

Anyway, back to this project.

I started thinking about making the delay and speed variables controlled by pots, but then I decided that it's working, so let it be. If others interested in this exercise would like to do that, then they can modify the program.
I wonder if jewellers selling watches or necklaces would like that sort of versatility

I'll put up some photos after I get these ports installed (but not used as USB ports), and then think of a place to display the carousel/ instrument case on the internet.

I'll let you know - I haven't thought that far ahead

cheers - Argusy

#include <Stepper.h>

#define shutter        8           // controls a relay to trigger a camera shutter
#define loStepCount   10           // First count control  (a 3 position switch)
#define hiStepCount   11           // Second count control
#define trigger       12           // The pin that triggers carousel rotation
 
int steps, sectors;                // Number of Steps per sector, number of sectors to rotate

Stepper myCarousel = Stepper(56, 5, 3, 4, 2);  // Instantiate a CW rotating stepper object

void setup() {
  pinMode (loStepCount, INPUT_PULLUP);
  pinMode (hiStepCount, INPUT_PULLUP);
  pinMode (trigger, INPUT_PULLUP);
  pinMode (shutter, OUTPUT);
  pinMode (LED_BUILTIN, OUTPUT);
}

void loop() {                            // continually monitors the 'trigger' pin and steps switch
  
  steps = 85 ; sectors = 24;             // steps switch in centre position (no connection)
  if (digitalRead(loStepCount) == LOW)
  { steps = 57;  sectors = 36;}          // steps switch is off-centred 
  if (digitalRead(hiStepCount) == LOW)
  { steps = 113;  sectors = 18;}         // steps switch is reverse off-centred
  
  if (digitalRead(trigger) == 0) {       // trigger pin has been grounded
    capturePic();                        // Take the first picture    
    for (int i = sectors; i > 0; i--) {  // 18, 24 or 35 sectors to complete nearly one revolution
      myCarousel.setSpeed(90);           // rotate at speed selected
      myCarousel.step(steps);            // rotate steps clockwise as per step switch setting
      delay (1000);                      // wait a bit while carousel rotates (adjust to suit)
      capturePic();                      // take a picture on each sector position
    }
  }
}

void capturePic(){
  digitalWrite (shutter, HIGH);          // power to the solenoid / shutter press
  digitalWrite (LED_BUILTIN, HIGH);      // visible indication of action (can be removed)
  delay(200);                            // allow 0.2 second while camera operates (adjust to suit)
  digitalWrite (shutter,LOW);            // remove power /shutter release
  digitalWrite (LED_BUILTIN, LOW);       // visible indication of action (can be removed)
  delay(500);                            // allow 0.5 second before rotation
}

The above code works well, and I've tested it for all three sector/step conditions

My final schematic is presented below. To describe one part of it, I realised the pins on the ULN2003 board could be desoldered, pushed down and resoldered. This allows this board to be directly attached to the UNO board.
A basic version could remove the 3 pos switch, and allow it to run at a fixed rev count.
Also the 18650 battery could be left off, and run just from the 5V front connector, but I've seen a few stories that claim this could flush the UNO down the drain - ergo add a battery or a secondary power input..
I added the LEDs as, in the box, you can't tell if the circuit is working properly. I thought about including a tiny, round 'window', just to watch the stepper-motor LEDs, but I know they are working - the carousel rotates!!

Now, if I could show off this carousel, somewhere... any ideas? You-Tube, maybe?