Author Topic: Full computer for $25  (Read 44669 times)

Kim

  • Timelord
    • Fediverse
Re: Full computer for $25
« Reply #400 on: 08 September, 2016, 03:49:41 pm »
Current Pi Zero will have a ZeroSeg 8 digit 7-segment display thing added to it and used to display the number of minutes until the next bus goes past our house (there's only one every 30 mins and not 24h - data to be scraped from TFL somehow).

Like it  :thumbsup:

Similar to my friend's plan to use one to reproduce the state of the level crossing down the road on a set of blinkenlights at the entrance of their driveway, so they know which way to turn when they leave.

Re: Full computer for $25
« Reply #401 on: 09 September, 2016, 11:39:13 am »
"Yes please" said Squirrel "biscuits are our favourite things."

Dibdib

  • Fat'n'slow
Re: Full computer for $25
« Reply #402 on: 03 November, 2016, 03:55:09 pm »
Apologies if this has been covered already, but can anyone give a GPIO noob like me some tips on how to pick a suitable servo to drive using an RPi, and where to get it from?

It's to twiddle the dial on a dimmer light switch, as part of a home-brew "sunrise" alarm clock. I'm particularly thinking about the "click" of extra resistance at the off-end of the dimmer's rotation, and making sure the servo is strong enough to cope.

Kim

  • Timelord
    • Fediverse
Re: Full computer for $25
« Reply #403 on: 03 November, 2016, 04:11:25 pm »
That's a terrible way of doing it, for several reasons.

Firstly, unlike a microcontroller, the Pi doesn't have a hardware PWM output, so driving servos directly from the GPIO is asking for trouble (bit-banging will result in high CPU use and glitchy output).  The voltage would be wrong, too, so you'd need some level-conversion electronics.

https://www.adafruit.com/products/815 is a good way to interface them.  I've used it and it Just Works.  You just write the magic numbers to the I2C device.

Once that's taken care of, driving a mechanical dimmer switch with a servo is, well, daft.

If it has to be a mains lamp, get a dimmer that can be controlled electronically.  0-10V analogue used to be the thing (DAC left as an exercise for the reader - a resistor network might suffice), but I'm sure that someone must make small dimmers with a more friendly serial interface than DMX512.

Or use a low-voltage lamp and control it electronically - PWM some LEDs with a MOSFET (or better, a dimmable constant-current LED driver) or something.  Or use some of those addressable RGB LED strips - then all the Pi has to do is tell them what colour to be.  I did a surprisingly good sunrise/set effect on one of those for a project that YACFers may have heard about.


...but if you insist, servos tend to be specified by the amount of torque available (amongst other things), so a bit of year 9 physics to determine the amount needed to click the switch would be where I'd start, unless I had some servos to hand to suck and see.

The other thing about servos is they tend to be a bit twitchy when at rest.  That could translate to annoying flicker, especially if the dimmer pot is less than smooth.  A stepper motor would avoid that, but they need more complex drive electronics, and you'll need a strategy for finding the home position on start-up, even if it's just headbanging the end of travel inna 1541 stylee.  Torquey stepper motors aren't cheap.  You might find one in a printer or something.

Dibdib

  • Fat'n'slow
Re: Full computer for $25
« Reply #404 on: 03 November, 2016, 04:30:58 pm »
That's a terrible way of doing it, for several reasons.

Hmm. I get that it's a bodge, but doing it properly involves lots of things I don't understand and my monkey brain can "get" twiddling a dial and leaving the electronics wizardry inside a magic box.

Lots to think about, thanks.

(as an aside I thought I'd read that the RPi had a hardware PWM output on GPIO18, but as you mention that's probably the least of my worries.)

Kim

  • Timelord
    • Fediverse
Re: Full computer for $25
« Reply #405 on: 03 November, 2016, 04:44:08 pm »
(as an aside I thought I'd read that the RPi had a hardware PWM output on GPIO18, but as you mention that's probably the least of my worries.)

Oh, so it does.  I'd completely overlooked that, on account of always needing more than one channel.


Understood about the monkey-brain thing.  Hence a magic box dimmer with a safe control interface would be my preferred approach, as this particular monkey has never had much luck with coupling mechanical twiddly things together in a reliable way.  (Nikki will doubtless be along at some point to torment me with some string.)