By continuing to use this site, you agree to our use of cookies. Find out more
Forum sponsored by:
Forum sponsored by Forum House Ad Zone

Prototype Boards

All Topics | Latest Posts

Search for:  in Thread Title in  
Peter Bell02/10/2018 20:01:40
399 forum posts
167 photos

Using a standard prototype board( newish departure from a rats nest for me) for some Arduino work and struggling to attach an I2C display without it rolling about, also finding any toggle switches to plug straight in?

Can anyone offer any advice or advise what suits them?

Thanks Peter

Mike Poole02/10/2018 20:38:25
avatar
3676 forum posts
82 photos

Have a look at PCB slide switches and push buttons, they will often plug into the board.

Mike

I.M. OUTAHERE02/10/2018 21:34:05
1468 forum posts
3 photos

You can get toggle ,slide , push button and tactile switches in pcb mount . Easiest way to find what you want us search eBay , I can’t recommend a store to buy them as I don’t know where you are . Not sure what you mean with the display - what type of display ? Lcd , led , Tft ? For testing I usually screw everything to a piece of mdf using standoffs and small sheet metal screws . I also have a piece of aluminium angle that has some holes drilled in it to facilitate a few different types of panel mount switches and this angle also gets mounted to the mdf board.

SillyOldDuffer02/10/2018 21:56:48
10668 forum posts
2415 photos

Try adding 'breadboard friendly' when searching ebay/amazon etc for parts.

I don't normally bother fixing stuff down when breadboarding but occassionally use a thin ali panel much like XD351 and his angle for switches and pots, and plasticene or insulating tape for temporarly holding displays in position. Some modelling clays are more suitable than others. It has to be a bit sticky without being too soft or messy.

Dave

Peter Bell03/10/2018 08:14:27
399 forum posts
167 photos

Thanks for the replies and ideas.

A search using "breadboard friendly" has brought good results and switches which will do. The display is only a 2 line lcd but just realised that the board has an adhesive back so I can fabricate a bracket and attach it to take a display or switches.

Talking of displays is there a recommendation for an easy to use reasonably sized Tft?

Peter

John Rudd03/10/2018 08:38:27
1479 forum posts
1 photos

Many folk have used the Nokia 5110 display in their projects or is that too small?

John Rudd03/10/2018 08:41:13
1479 forum posts
1 photos

Many folk have used the Nokia 5110 display in their projects or is that too small?

Plenty on ebay

Peter Bell03/10/2018 08:43:47
399 forum posts
167 photos

Yes I'd like something a bit bigger if possible?

John Rudd03/10/2018 09:24:56
1479 forum posts
1 photos

Other sizes on ebay.....

SillyOldDuffer03/10/2018 09:42:01
10668 forum posts
2415 photos

My current project uses a Sainsmart TFT Shield with a 3½ screen, which plugs into a Mega. (Although the link is to the US, I got mine in the UK, probably via Amazon.) Display and touch both work ok with the TFT library.

The main problem with TFT screens is the large number of connections needed. Lots of wires, and not many Input Output pins left for other work. I find a Mega provides much more room to maneuver than the Uno - more pins.

The shield considerably simplifies and tidies up the wiring! It also comes with an SD-Card interface, which may be handy.

Getting at the unused pins on the Mega under the shield is slightly awkward but right angled connectors fit OK. The main downside is the cost, but it's a neat solution.

Dave

Peter Bell03/10/2018 11:01:26
399 forum posts
167 photos

Thats impressive! Didnt realize the amount of pins that's needed, rather assuming that I2c would take care of things like that, bit too advanced for my present state of development!

Must admit find the cheap1602 type lcd display with white letters very readable but want to progress/learn as you do hence the question.

Thanks Peter

Bazyle03/10/2018 12:48:34
avatar
6956 forum posts
229 photos

I have been looking at the other direction - not wanting to work through lots of menus to put in data I thought of BCD switches. While the pcb mount ones are common anything larger is frighteningly expensive. So going with switches and binary input until I can make my own rotary BCD.

SillyOldDuffer03/10/2018 16:03:40
10668 forum posts
2415 photos
Posted by Peter Bell on 03/10/2018 11:01:26:

Thats impressive! Didnt realize the amount of pins that's needed, rather assuming that I2c would take care of things like that, bit too advanced for my present state of development!

...

Thanks Peter

You can deliver a powerful user interface with a Touch Screen TFT so they're well worth investigating. My clock analyser looks like this:

dsc05282.jpg

The screen does 320x240 colour pixel graphics and there's a fairly simple library for writing to the screen and detecting X Y coordinates when a pen touches it. I wrote a small class library to do buttons, and - because displaying text is amazing slow on a TFT - a class that only updates text objects on change. Not much more difficult to do basic things than a 1302 LCD but knowing C++ helps if you want buttons. (I haven't found a standard library that provides GUI controls.)

I'm not aware of an I2C or other serial interface being available for these screens: I guess serial is too slow. Speed problems sometimes cause bother with 1302 LCD displays as well. These are fastest in 8 bit mode, reasonable in 4 bit, and slowest with I2C. Worth checking the display is quick enough if your project is time critical, especially when planning to use I2C. (When not speed critical, I2C is wonderful.)

Dave

Phil Grant09/10/2018 22:50:24
107 forum posts
21 photos

If you're OK programming then have a look at the nextion displays from Itead, they use a serial connection to the Arduino or Pi etc.

They have a PC design tool that allows you to create all the GUI and upload it to the display then control it using an Arduino, I found it quite easy to use when I got my head around it and there's quite a bit of information on the web.

**LINK**

Peter Bell10/10/2018 13:46:13
399 forum posts
167 photos

Thanks looks interesting from the link. Found somes neat toggle and tactile switches thanks to the help from this thread.

I’m only learning I’m afraid but find some of the Arduino error messages a bit misleading also the syntax confusing. Some success with simple things like counting and i2c displays but AttachInterrupt doesn’t want to play ball at present.

Phil Grant10/10/2018 14:44:27
107 forum posts
21 photos

Did you realise the attached interrupt only works on certain pins?

Peter Bell10/10/2018 15:25:39
399 forum posts
167 photos

Yes, I’m using a Nano which has only two pins and got the correct pin no’s.

all I want to do is inc a variable from a string of pulses from a proximity sensor, and count them. Got display and outputs working ok. It was suggested I use an attached interuppt with a service routine, perhaps there’s a better way?

SillyOldDuffer10/10/2018 16:40:36
10668 forum posts
2415 photos
Posted by Peter Bell on 10/10/2018 15:25:39:

...

all I want to do is inc a variable from a string of pulses from a proximity sensor, and count them. Got display and outputs working ok. It was suggested I use an attached interuppt with a service routine, perhaps there’s a better way?

Two ways to count pulses:

  • spin digitalRead() in a loop until a pulse is detected, then count it. Advantage is simplicity. Huge disadvantage is that nothing else can be done while the Arduino is waiting for the next pulse. As an approach it's only suitable for trivial processing.
  • Set up an interrupt and call an ISR. This allows the arrival of a pulse at any time to suspend whatever the Arduino is doing, execute the ISR, and then resume from the break. Advantage is the microcontroller can appear to be doing several things at once. Disadvantage is interrupts are bit more complicated to understand, mainly because of the time element.

Two common problems:

  • Any variable shared between an ISR and the rest of the world must be in scope of both functions and declared 'volatile'. Scope can be fixed by declaring shared variables at the top of the source code (before any functions) making them global. The 'volatile' keyword tells the compiler that it must not cache the declared variable to optimise performance. If a global is cached, it's entirely possible for it's value at point of use to be wrong because the ISR updated the master leaving other functions with out-of-date copies. Then the program doesn't work as expected.
  • Because an ISR interrupts other functions that can themselves be time critical, the ISR should be short and quick. If an ISR is long-winded and the code it interrupted times-out, then chaos can ensue.

Both issues produce hard to diagnose bugs. You can have code that's logically correct and be getting random errors or a complete breakdown depending on the state of a buffer and/or how long something takes.  Very confusing.

Happy to look at your code Peter if that helps.

Dave

 

Edited By SillyOldDuffer on 10/10/2018 16:43:23

Phil Grant10/10/2018 16:40:44
107 forum posts
21 photos

I do have experience with Arduino coding so if you want to post your code I will have a look at it I have used interrupt routines in the past and remember it was a bit of a pain to get working.

Peter Bell10/10/2018 17:30:07
399 forum posts
167 photos

Thanks for the offers of help. Presume just copy the code in somehow?

I’ll try later if we survive the journey from a very enjoyable day at Kew Gardens

Peter

All Topics | Latest Posts

Please login to post a reply.

Magazine Locator

Want the latest issue of Model Engineer or Model Engineers' Workshop? Use our magazine locator links to find your nearest stockist!

Find Model Engineer & Model Engineers' Workshop

Sign up to our Newsletter

Sign up to our newsletter and get a free digital issue.

You can unsubscribe at anytime. View our privacy policy at www.mortons.co.uk/privacy

Latest Forum Posts
Support Our Partners
cowells
Sarik
MERIDIENNE EXHIBITIONS LTD
Subscription Offer

Latest "For Sale" Ads
Latest "Wanted" Ads
Get In Touch!

Do you want to contact the Model Engineer and Model Engineers' Workshop team?

You can contact us by phone, mail or email about the magazines including becoming a contributor, submitting reader's letters or making queries about articles. You can also get in touch about this website, advertising or other general issues.

Click THIS LINK for full contact details.

For subscription issues please see THIS LINK.

Digital Back Issues

Social Media online

'Like' us on Facebook
Follow us on Facebook

Follow us on Twitter
 Twitter Logo

Pin us on Pinterest

 

Donate

donate