Maker Pro
Maker Pro

Contacts?

cjdawson.com

Mar 6, 2023
2
Joined
Mar 6, 2023
Messages
2
I'm thinking about how to build a project based on the game battleships.
One of the features of the game is that I want to be able to place the ship onto the grid, and have a circuit detect where the ship is.
The ship itself will be either transparent plastic, or maybe opaque, with Red Leds in (that will light up when it registers a hit) not fully decided on that bit yet.

The main problem that I have is that I want to be able to place the ship on the board and have it's location detected, as well as being held in place. I thought about using a du point style pins, but these will be rather flimsy, and are likely to break easily. The grid square where the leg of the ship can be placed, will also need to be occupied by an LED, which will at minimum light up white to denote a miss. (Red will be used for hit)

The main problem that I'm thinking about is trying to figure out the options that I have for detecting the where the ship is on the board.

As a starting point the board is likely to be a 10x10 grid, of LED's, spaced about 10mm apart, each grid square will contain the LED, and the mechanism that will be used to secure the ship into place, That mechanism will also need to create the electrical contacts needed to be able to detect the location of the ship, and either power an LED to denote the ship being hit (or more to the point, several led's for each hit, 5 on the aircraft carrier etc.)

Making the 10x10 matrix of bi-colour led's shouldn't be too hard, (it'll be driven by a Raspberry Pico, and maybe shift registers, still working that through)

s-l500.jpg


I'm planning on 3d printing the ships, game grids and cases. Using a Pico W, to control everything. Instead of pegs (which get chewed, lost etc) LED's will be used instead. A keypad and screen will be used to take shots. The idea is to place the ship on the board and have the board detect where the ship is

So the problem that I'm trying to solve....

1. how to detect the location of the ship when placed into the lower board.
2. how to make it so that the ship will light up red when hit.

The one thing that I don't want to do is have to manually enter the ship locations like you had to on the 1980's version of computer batterships.


Any ideas?
 

kellys_eye

Jun 25, 2010
6,514
Joined
Jun 25, 2010
Messages
6,514
I recall having a handheld game that consisted of an array of rubberised pushbuttons with integral LEDs. Stripping it down revealed a pcb populated with LEDs and having a printed carbon-track-based key X-Y detect layout that was operated by the conductive lower edge of the individual rubber keys.

I also recall seeing such keypads offered as a design component for other purposes - something like this? https://www.grommetseal.com/rubber-keyboard/rubber-button/4x4-button-pad.html

Search around for an RGB version - you could then program the vessels for a particular colour and then 'explode' in a colourful surrounding explosion when hit!

You can send my 10% cut to.........
 

Martaine2005

May 12, 2015
4,956
Joined
May 12, 2015
Messages
4,956
What about magnets in the ships and Reed switches in each grid?.
Also a 5mm hole in the ships base and use the RGB LED on the board for it it sit on like a stand?.

Martin
 

cjdawson.com

Mar 6, 2023
2
Joined
Mar 6, 2023
Messages
2
I'd not thought about using the heads of the LED's as a place for the ships to sit. That's brilliant.
Just looked and found 7mm reed switches that should be able to do the job. I'd thought about reed switches before, but was stuck in the mindset of a peg sticking out the bottom of the ship. With the LED indents, I can there's no need for pegs, and the magnets can be embedded in the switch.

yay for 2 more 10x10 matrix
 

ChosunOne

Jun 20, 2010
483
Joined
Jun 20, 2010
Messages
483
I'd not thought about using the heads of the LED's as a place for the ships to sit. That's brilliant.
Just looked and found 7mm reed switches that should be able to do the job. I'd thought about reed switches before, but was stuck in the mindset of a peg sticking out the bottom of the ship. With the LED indents, I can there's no need for pegs, and the magnets can be embedded in the switch.

I'm not sure what you mean by "...the magnets can be embedded in the switch." (??!)
The magnets would need to be set in each ship , with one magnet positioned over each switch in each square of the grid the ship sits on. (Unless I'm envisioning a different layout than you?)

I worked with magnetic reed switches for decades in the security alarm industry, and I recommend you do a LOT of experimentation (playing) with the placement of switches & magnets before you actually install them permanently. It's easy to get a magnet to close a reed switch, but it may be difficult to keep it from sometimes closing other adjacent switches. 10 mm (1 cm) is not a lot of separation between switches; so you probably don't want to use rare-earth (i.e., strong) magnets. Also, magnets 10 mm apart can affect the strength/"reach" of adjacent magnets: The magnetic fields of two adjacent magnets will be strengthened if the polarities are the same (e.g. both North poles down) , and weakened if the polarities are opposite. Depending on your layout, you may want to do one or the other, to keep (e.g.) Magnet # 3 closing switch #3; but NOT close switches 2&4---and others, keeping in mind that most of your mag/switch pairs not on the edge of the board, will be adjacent to 4 other mag/switch pairs.

I encountered this problem many times, when a User wanted his alarm switch/magnet pairs adjusted so that a window being opened would cause an alarm at the first 1/2 mm of movement. I often had to convince them that they didn't want that, because it would eventually ( 2 days or 2 years later) cause a chronic false alarm problem, guaranteed. I typically left more than a 10mm margin whenever I could.

Also keep in mind that magnet switch pairs don't have the same "engaging" (closing) distance as "releasing" (opening) distance. If the switch closes at, say, 10 mm, it may not open until it's separated by 15 mm. (Not actual ratio, just a wild guess)

Hence, my recommendation to plan to experiment a lot before actually building the grid and installing the switches & magnets. I'm curious how it works out for you.
 
Top