Anyone using Raspberry Pi?

UKworkshop.co.uk

Help Support UKworkshop.co.uk:

This site may earn a commission from merchant affiliate links, including eBay, Amazon, and others.

Morag Jones

Established Member
UKW Supporter
Joined
3 Jan 2022
Messages
227
Reaction score
522
Location
Norfolk
Amongst one of my dafter projects is helping with scenery for the local pantomime. This year we have a lighthouse and I'd like to make the light have the right number and sequence of flashes. 3 at 1.5 seconds every 30 seconds oh yes it is.

I'd love to hear if anyone dabbles in this.. IMG_0617.jpeg
 
Takes me back.... many years ago I wrote some firmware for Pharos Marine buoys. The timings were actually fine tuned to account for the filament warm up and cool down.
But back to your panto, I reckon it'd be cheaper and easier to to with an Arduino.
 
A Raspberry Pi would be way overkill - a cheaper and simpler Arduino would easily do something trivial like this.

Whatever route you use you'll need an output board to drive the lights as the computer itself has very limited ability to drive more than a few mA of current, however they can drive relays - on Pis these boards are called "hats" and on Arduino they are called "shields". Again, pretty cheap.

I would go the Arduino + relay shield route for something this simple.

Gets a bit more complex if you want to do a sweeping light beam, but perfectly doable...
 
Last edited:
Rather than look at the programing route where you will need to learn the basic's of a language like C and need some compiler / programer it would be easier to use timer relays or multifunction relays where one generates the pulses every 1.5 seconds and a second relay acts as a gate. Assume a 50/50 mark space ratio so on for 1.5 and off for 1.5 seconds so 9 seconds for three pulses and 30 second off before repeating.
 
As @Spectric said you will need a compiler and programmer but these are free downloads so no problem.
The fact that you were contemplating a Pi suggests you have some programming knowledge so using C/Python/some flavour of Basic shouldn't be a problem for you but if you do just ask.
Have fun
Martin
 
PS - last year it was a rotating windmill.
Tiny knowledge of coding, enough to know it's best left to experts! But always willing to learn new stuff.
Martin and John, I may well appeal for help when i get out of my depth...
327a7c70-f22b-46ab-8f80-0be6c04547cc.jpg
 
Brilliant - I will consult Mr Google for Arduino. Thanks everyone, I'm up for a challenge, and noted for overkill!
You can get cheap I/O shield, yes that what the call them. For Arduino to drive your light bulb, either mains or low voltage LED. There is an amazing number of parts available. Arduino provide a very simple IDE for write your program. You’ll probably need to add less than a dozen lines to the base code to do your light house flasher.
 
Anyone thought of a very small FPGA, all that is required is a sequence that repeats so even an 8 bit micro will be really overkill if you consider the onboard peripherals.
 
This is a trivial modification for the Blink example for Arduino to flash 3tree time (1.5 seconds on, 1.5 seconds off) then repeast after 30 seconds. This is why so many people use them.

/*
Blink

Turns an LED on for one second, then off for one second, repeatedly.

Most Arduinos have an on-board LED you can control. On the UNO, MEGA and ZERO
it is attached to digital pin 13, on MKR1000 on pin 6. LED_BUILTIN is set to
the correct LED pin independent of which board is used.
If you want to know what pin the on-board LED is connected to on your Arduino
model, check the Technical Specs of your board at:
Arduino Hardware

modified 8 May 2014
by Scott Fitzgerald
modified 2 Sep 2016
by Arturo Guadalupi
modified 8 Sep 2016
by Colby Newman

This example code is in the public domain.

Blink
*/

#define LIGHT 13; // change for the i/o pin you are using

// the setup function runs once when you press reset or power the board
void setup() {
// initialize digital pin LIGHT as an output.
pinMode(LIGHT, OUTPUT);
}

// the loop function runs over and over again forever
void loop() {
digitalWrite(LIGHT, HIGH); // turn the LED on (HIGH is the voltage level)
delay(1500); // wait for 1.5 seconds
digitalWrite(LIGHT, LOW); // turn the LED off by making the voltage LOW
delay(1500); // wait for 1.5 seconds
digitalWrite(LIGHT, HIGH); // turn the LED on (HIGH is the voltage level)
delay(1500); // wait for 1.5 seconds
digitalWrite(LIGHT, LOW); // turn the LED off by making the voltage LOW
delay(1500); // wait for 1.5 seconds
digitalWrite(LIGHT, HIGH); // turn the LED on (HIGH is the voltage level)
delay(1500); // wait for 1.5 seconds
digitalWrite(LIGHT, LOW); // turn the LED off by making the voltage LOW
delay(30000); // wait for 30 seconds
}


All you need to do is plug on a relay Shield or a MOSFET Shield and change the line
#define LIGHT 13;
to set the right pin for your shield
 
A small servo will drive the lamp round, consult the raspberry pi site.
I'll write the timing code if you say what you want, then you figure out where your 'lamp' is connected
and adjust the Python to control the lamp.
 
A Raspberry Pi would be way overkill - a cheaper and simpler Arduino would easily do something trivial like this.

Whatever route you use you'll need an output board to drive the lights as the computer itself has very limited ability to drive more than a few mA of current, however they can drive relays - on Pis these boards are called "hats" and on Arduino they are called "shields". Again, pretty cheap.

I would go the Arduino + relay shield route for something this simple.

Gets a bit more complex if you want to do a sweeping light beam, but perfectly doable...
I much prefer apple & blackberry pie! 😂
 
My own view would be forget either a Pi or Arduino, if this kind of thing is a regular requirement get a general purpose USB I/O board and steer it from a laptop. Velleman do one in kit form or ready assembled for perhaps £35 in kit form or £50 assembled. You can then in general use whatever you like for control, C, Basic, whatever, you don't necessarily need new kit or support for the next job. I would echo the comment about driving circuitry as that is a big unknown here, local panto covers a lot of possibilities, e.g. Preston Playhouse have kit that can do this kind of thing from logic levels (and at high strobe rates) in stock, if you are doing this from scratch it is something else to consider. Switching even mains voltage isn't difficult and with even a modicum of common sense it's reasonably safe, but there are gaps to be filled in with the requirements first.
 
My own view would be forget either a Pi or Arduino, if this kind of thing is a regular requirement get a general purpose USB I/O board and steer it from a laptop. Velleman do one in kit form or ready assembled for perhaps £35 in kit form or £50 assembled.

Although this approach is arguably more flexible, an Arduino Nano clone with a relay module should cost well under a tenner.
 

Latest posts

Back
Top