Making Breadboard Project into final device

With the help of some very patient and considerate helpers in this forum I created a switch to turn on my 12v LED reading light panel when I sit on the chair. [Chair Occupancy Light Switch - #12 by ec2021]

I’m pretty much a nubie and have no intention of creating more than this one device for my own use. An Arduino Uno 3 on a breadboard, alligator clips, jumper wires, and long wires certainly can’t be what I end up with. Now what? How do I convert this jumble to a real device?

Here’s the Tinkercad image. (seat sensor switch, 12v ac/dc wall adapter, and my 12v LED light panel components not available on Tinker are shown as a pushbutton switch, 9v battery, and dc motor respectively.)

FWIW, here’s the code that’s working:

/* this sketch uses a occupancy switch to turn
on a 12v Led reading light when the seat is occupied */

// using Arduino Uno 3

// from arduino forum  https://forum.arduino.cc/t/pressure-sensor/546144/4
// using sea tsensor that looks like mine

const byte switchPin = 2;  // connect the switch to pin 2, the other side to ground
const byte ledPin = 13;  // use the built-in LED as an indicator
const byte LightsPin = 3; // this pin sends signal to Mosfet to turn on 12 volt LED light panel
byte SwitchRead; // variable to store value of the Seat Occupancy Switch

void setup() {
  pinMode(switchPin, INPUT_PULLUP);
  pinMode(ledPin, OUTPUT);
  pinMode(LightsPin, OUTPUT);
  Serial.begin(9600);  
}

void loop() {
  SwitchRead = !digitalRead(switchPin);

  digitalWrite(ledPin, SwitchRead);
  digitalWrite(LightsPin, SwitchRead);
  
  Serial.println(SwitchRead);
}

I’ll get rid of the Serial stuff once I finalize this project.

Since I’m only using 1 input pin and 2 output pins on the Arduino, I figure that’s expensive overkill. Before this, last I dabbled in electronics and gave up, I pushed a buy button and ended up with some items some of which I thought might be useful in this next stage:

  • Several Digispark Pro Kickstarter Development Board USB Micro ATTINY167 Module from Banggood
  • Several what look like “ Digispark Kickstarter Micro Usb Development Board For ATTINY85” also apparently from Banggood
  • Adafruit Trinket MO,

And from deep in long forgotten storage bins:

  • Radio Shack General Purpose IC PC Board,
  • Radio Shack Prepunched Perfboard, and
  • Solder

Any help or guidance is much appreciated,

Thanks,

Hal

Perfboard to solder things onto. I prefer the version with plated through holes (usually green boards) rather than the single side ones (usually yellowish brown colour).

Get a Nano or Pro Mini instead of an Uno so you can solder it directly onto the perfboard (or of course use some female headers to make the Arduino removable).

That's the easiest. You could go the ATtiny85 route (or other ATtiny) but then you also need an appropriate programmer.

1 Like

@wvmarie - Thank you.

I sure appreciate your suggestions for making this simpler for me. I dreaded the thought of trying to figure out those ATtinys especially at this early stage of my electronics education.

I see the IC PC Board I've got is the yellowish brown version. I'll look for the green ones.

Between the Nano and Pro Mini, which do you prefer?

Looking at the Arduino store, I see a lot of different Nano versions with a wide price range. Is there one you think is best suited to this project?

ooh - I like the idea of making it so the Arduino is removable. I can see me modifying this as time goes by and that'll be helpful in reusing the unit.

Thanks again WVMarie,

hal


@Paul_B I seem to have pushed the wrong button and removed your message. Sorry.

hal

Nano is easier as it has a USB interface.

The Pro Micromini is my favourite as it's smaller and a bit cheaper, but you need an FTDI cable for programming, it has no USB on board.

Did you mean Pro mini? The Pro Micro comes with a USB-C connecter

Yes, correct, and I corrected my post above :slight_smile: All those board versions continue to confuse me at times :frowning:

@wvmarle, @blh64,

Thanks for all this info. It sounds like this'll make it much easier for me to construc the final product with this guidance.

Much appreciated.

Here's a big ask - Any recommendations about choosing a project case, and connectors for attaching the external sensor (seat switch), and two power suppies (5 v and 12v), and the 12 volt LED light panel I'm controlling. I can only imagine there's dozens if not hundreds of considerations. Is there a book that'll help this old guy?

hal

Is this the same project?

"Chair Occupancy Light Switch

If so, do not duplicate posts. Forum rule.

@ruilviana -

I'm sorry. That post was how to code it and build the circuit to make it work. This post is about how to convert that into a functioning device. Should I have kept it all together? I thought they would be two distinct topics.

If this should be part of the same original project, is there a way to open that back up and merge this into it?

thanks,

hal

I think you are right. I wouldn't bother reading the other one, but for here, be aware that there are proto shields specifically designed for Uno/Mega and handle the offset pins. Also, stay well away from the yellow brown junk perf boards.

Lots of possible cases out there. Get one that is big enough, that's the main thing.

For connectors: I'm mostly using 5mm pitch screw connectors and 2.5mm pitch JST-XH style crimp connectors. Another popular choice for crimp connectors is the Molex type. They both use fine. For 12V you may also use the jack connectors, most 12V supplies have those.

Don't overdo connector selection. Look a bit, pick one, stick with it. That's been my tactic and it's served me well. JST-XH for signals and low current power connections; screw terminals for the higher currents.

1 Like

Why two. Much better to have 1 power supply (12V) that you have to externally connect and then use it for your LEDs and step it down for the arduino. 12V directly into the arduino will work, but is at the higher limit of input voltage. Better to get a buck/boost converter to lower it to 5V and then feed that into the arduino.

1 Like

thank you so much @wvmarle,

What perfect sense to choose one and stick with it. I can see I've already got a drawer full of various items. I like you're thinking.

I'll have to look up the different connectors you're talking about. This points me to some items others are using in their projects without sorting through 1/2 billion different ones on the internet.

thank you,

hal

thanks @Nick_Pyner,

I thought I was being respectful in dividing this newbie project into different posts.

And thanks for the advice about the junk perf boards. It will sure be a learning experience for be to mount the nano on the board and then wire and solder the compents. But it'll be fun I trust.

hal

@ blh64,

Thank you for that question. Actually it was going to be the next topic question I posted in the forum.

Much better to have 1 power supply (12V) that you have to externally connect and then use it for your LEDs and step it down for the arduino

I figured there had to be a smart way to do this, but didn't have a clue. should I start another topic on using higher voltage (12v) to feed both a component and Arduino? Or perhaps searching the forum will find some helpful newbie guidance.

thanks,

hal

That would be perfect for this project

1 Like

oh @jim-p ,

Thank you. I'll have to check that out the Adafruit Trinket MO and see how to utilize it.

More to learn,

hal

You listed it as one of the boards you have, why not use it.

That board would also be useful for this project

@jim-p,

Like your suggestions on both items.

Ah - the Trinket is indeed small, but looks like it'd be easy enough to work with. I might scrounge in the boxes and see if I've got a socket that'll work.

For the PC Board, I just took a closer look and see that one one side, a good number of the holes have copper connecting them to other holes, somewhat like a breadboard. So I'll have to be extra careful to get things in the right holes.

Thank you,

hal