Ship Engine Room LED Display - Page 1
Forum section: electronics / projects

author: Kiwi__Power
author_rank: Newbie
timestamp: May 02, 2016, 11:05:09 am
content: Hi everyone!Before I get going sharing my project with you all, I'll leave a disclaimer that I'm not an electronics engineer, I'm only a network and communications engineer so I've only done introductory papers on microcontrollers, logic gates, analogue electronics etc, and I've never really designed anything before.So if my design is complete garbage and I should start again, please break it to me gentlyRight I'll get into the background of the project. What follows is only part of a bigger project which I'm working on by myself. The part I'll be talking about is only the Display. There is another part which will include a Raspberry Pi connected to an interface board with an ADC, some logic inputs and other supporting circuits to take in data and output to this display and in time to the web.The information on the display will include:FWD Boiler Pressure (psi).........8 bit charAFT Boiler Pressure (psi)..........8 bit charPort Engine Throttle (psi).........8 bit charStarboard Engine Throttle (psi)..8 bit charPort Engine RPM....................8 bit charStarboard Engine RPM.............8 bit charCondenser Vacuum................8 bit char4x3 LED Array.......................12 Boolean bitsBecause I'm completely ignorant of display protocols for sending data, I created my own simple one.My display has an 8 bit data bus and 2 clock signals. One clock signal tells the display that it's the start of a transmission, and the second clock signal clocks for each following byte of data in the transmission. The display is expecting the data to be sent in a specific order so it knows which LED display to put each received number on.The display has two 8 bit microcontrollers on it, both microcontrollers are connected to the exact same input bus and see the same data. The first microcontroller will buffer the first 4 blocks of data and ignore the following data. The second microcontroller will ignore the first 4 data blocks in the sequence and buffer the last 6.So the information on the display is updated in 10 clocks. I'm not sure how fast I will be clocking the display. The 7 seg displays will be multiplexed at least 60 times/second but the information they display doesn't need to be updated as often, perhaps 10 times/second would be fast enough, but that can be decided later when it comes to programming the Raspberry Pi because it will be the source of all the information.I used two microcontrollers because I was concerned that the 7 seg displays would not be very bright if I make a huge long line of multiplexed displays with very short duty cycles. I'm sure many of you will have experience with this and might know where the brightness starts to fade off with smaller and smaller duty cycles. My concern here might not be for nothing.This is my schematic. Both microcontrollers receive the same data but they will have slightly different code where one ignores the first half and the other ignores the second half. The output is fed into a 7 seg display decoder, which then goes through a resistor network then into the 7 seg display which is common cathode. The common cathodes are multiplexed through 3 mosfets.Fairly simple I think, whether it will work or not I'm not 100% sure.PCB Logic Board:PCB Front Panel Layout:If you're still reading, thanks, I have a question for you. My design uses some of the programming pins for the ISP header as inputs for the display. They sit on a common bus between the microcontrollers. So when I program one of them will it try program both at the same time? The reset pin isn't on that common bus so if the reset pin is set to high for programming then the other micro's reset pin will be pulled low. I wasn't sure what the story was with the ISP headers since they are on a common bus, so I put a jumper on the VCC of each microcontroller so that if I'm programming it I can disconnect the VCC on the micro that I don't want running while I upload the program. Then I can put the jumper back on and both micros can run together. Also I will unplug the display input while uploading programs in case the displayport is driving high while the programmer is driving low or vice versa.I've tried to do all the good common practice things like, pull down resistors on unused inputs and I've even put pull down resistors on the display input. I've put small decoupling capacitors around the board where I could fit them. I haven't decided on what mosfet to use for the multiplexing.I'll stop writing here. At this point everyone must be thinkingI've never seen something so poorly designed!Any questions or suggestions for my project?

author: Wilksey
author_rank: Super Contributor
timestamp: May 02, 2016, 07:52:54 pm
content: Looks like quite an interesting project!There is more than 1 way to skin a cat / design a circuit, some will tell you there are "better" ways to do it, but I find it best to experiment and figure it out for myself if I can (sometimes we all hit our limits or just need someone to point out the stupidly obvious mistake we have made!).

author: TheDirty
author_rank: Frequent Contributor
timestamp: May 02, 2016, 09:56:27 pm
content: Personally I would just use a bridge of some type to disconnect the programming pins during programming if it's a concern. Sorry, I don't have a specific answer since I don't use AVR, but these are usually triggered with the RESET like you mention and as long as your resets are separate I would think you would be safe. Someone else can confirm/deny.Also agree, there are about a zillion ways to do this. Personally I would have just used a simple LED driver to drive all of these. A MAX7219 is cheap on fleabay and easy to work with. Whatever you are comfortable with, though.

author: HackedFridgeMagnet
author_rank: Super Contributor
timestamp: May 03, 2016, 12:02:13 am
content: Nice little project. Dont be afraid to go Surface mount, just make sure the pin pitch is suitable. 0.5mm is manageable by hand with a bit of practice but wider is easier.Well if you used the LED driver chips as suggested by theDirty you would only need three of them. That would do the 21 Segments and leave you with 3 segments or 24 LEDS spare. These could be used for the single LEDs but you may need to current boost them, with a FET or Transistor. See APPLICATION NOTE 1196https://www.maximintegrated.com/en/app-notes/index.mvp/id/1196Then you could drop the second processor and you also wouldn't need to worry about the programming pins, as they wouldn't need to be on any bus.If all the comms is one way then you don't need to worry about packet loss etc, just continually transmit. Though if you lose comms you need to throw something up on the display.Something like :preamble 2bytesID 2bytesLength 1byteSequence Number 2bytesPayload 10byteschecksum 2bytes

author: Kiwi__Power
author_rank: Newbie
timestamp: May 03, 2016, 01:04:23 am
content: That chip does have some extra characters which would be nice to have even if I might never use them.I can't immediately imagine how the c code will work for the SPI interface I've not used that before.

author: HackedFridgeMagnet
author_rank: Super Contributor
timestamp: May 03, 2016, 01:24:34 am
content: SPI is not very hard.Could you have the SPI come out of the RPi directly or is the RPi remote?I don't think you need much processing. Maybe the ATMega328 out of the Arduino could do it.Then you could use the Arduino libs and importantly you are using chips with a large hobby base so you can get support.you could thenA) use and arduino board as a daughter board of your boardB) drop and arduino chip with bootloader onto your board.C) drop and arduino chip without bootloader onto your board.other wiseD) get another chip that supports SPI and get some SPI libs for it.just need to make sure your SPI pins are different from your other comms pins.

author: Kiwi__Power
author_rank: Newbie
timestamp: May 03, 2016, 06:12:16 am
content: I want the display to be able to work remotely that's why I went for a slow parallel bus since hopefully it will work over a long cable without having to worry about transmission line effects. I'll see what I can find out about SPI in the mean time.

author: TheDirty
author_rank: Frequent Contributor
timestamp: May 03, 2016, 12:51:25 pm
content: SPI is super simple and can be done in software (bit banged) in a few lines of code if needed. The AVR will definitely have a serial peripheral that supports it, though. The idea is that you would maintain one microcontroller, so your long distance communication from the control source to the display can still be whatever method you want. SPI would be as safe over long distance as any low voltage non-differential protocol.What is the distance? If you are actually running a good distance in a noisy environment, you may want to switch to something more robust like rs-485.

author: klunkerbus
author_rank: Unknown
timestamp: May 03, 2016, 02:21:01 pm
content: Another vote for the MAX7219 type approach. I'd go that route just because of the segment current limiting and brightness control that it takes care of. For this application, either the MAX7219 or MAX7221 could be used. Other compatible parts are the AS1106 and AS1107 from AMS. I just wrapped up a 16x96 dot matrix display with 24 of the AS1106 parts involved. Just in general these are easy parts to use.If you go this route, you'll find these parts are available as very cheap parts or fairly expensive parts. The cheap parts are predictably fakes. Many say they work fine, but for a non-hobbyist, real-world application like this I'm not sure I'd trust them. I also suspect that the surface mount versions aren't as likely to be prone to be counterfeit as DIPs. Go surface mount, and purchase them from a reputable distributor.

author: Kiwi__Power
author_rank: Newbie
timestamp: May 04, 2016, 03:07:17 am
content: I'll start a new schematic and see what I come up with. BTW I've been using Express SCH and Express PCB which makes .sch or .pcb files but outputs to PDF files as well. It can print files of individual layers and the silk screen. Will I run into problems when I want to get the PCB made? Is there a better program I should be using which PCB manufacturers will have software for?It's a predictable problem I might run into.

author: Kiwi__Power
author_rank: Newbie
timestamp: May 04, 2016, 03:53:57 am
content: Looks like the Din and CLK are pretty simple. I'd just need to organise what I'm going to send in a 2D array then just run a for loop in a for loop and send it out one of the pins. With all the overhead the micro shouldn't blast it out more than 10MHz the maximum transfer speed so I shouldn't need any delay loops.

author: Zero999
author_rank: Super Contributor
timestamp: May 04, 2016, 07:48:33 am
content: You're using a Raspberry pi so why not buy a TFT screen and use that for the display? It'll probably work out cheaper than getting the panel and PCB made and if any changes need to be made, it's as simple as modifying a few lines of code.

author: Kiwi__Power
author_rank: Newbie
timestamp: May 04, 2016, 09:41:26 am
content: It has to be small and hidden, a stealthy installation. Ideal it should look as old and as basic as possible. The display might not even be present in the final installation.The display is only part of the project.I'll explain the whole project.The ship is a 1935 steam tug boat which is chartered out for birthdays, staff parties, other events. I'm just working on this as a volunteer in my own time.This is an old picture you'll notice things have changed on the display. The display isn't actually required but it's a feature I'd like just so I have a readout of the data in real time.We want to take in data from the ship and display real time telemetry from the ship on the website. Things like boiler pressure, we might even have some webcams like the big cruise ships often have.All the circuitry needs to be hidden as best as possible keep the look of the 1935 engine room. An old basic looking display is something that could be hidden in a cupboard but won't draw much attention because I've designed it to look similar to our power board with the indicator lamps for the industrial look, similar to our ship power/shore power indicator lamps on the power panel.There also needs to be a board that interfaces between the raspberry pi and the attached sensors both analogue and digital. Then the data on the raspberry pi needs to log to an SQL database for the website and the site will display the most recent data to give us more or less real-time data. I have absolutely no idea how to get it to write to an SQL database haha I was going to cross that bridge when I got there, I have a friend who might be able to help with that.The project has a long way to go, I've half designed the interface board between the Raspberry Pi and the ADC and rotary encoder circuity. I was going to post a new thread of that when it was closer to complete. Once the hardware is designed built and working, I need to build a test rig to put pressure on the pressure sensors and test they work and are accurate and also get the rotary encoders to work out the shaft RPM. Then once it's all working perfectly and it's all debugged then I'll see where it can be hidden away and I'll know things like cable lengths etc.I'm just working away at it slowly. There's no deadline. I'm not sure what the cost of the whole project will be.But there would definitely be objections to an LCD screen. We might have an LCD screen up on deck for the disabled who can't get down below, it would display the website most likely with the real-time data on it and upcoming charters.

author: Ian.M
author_rank: Super Contributor
timestamp: May 04, 2016, 11:14:29 am
content: Make it do something useful - monitor bearing temperatures!I assume there are already traditional analog gauges for everything its monitoring - if not, rather than 7 segment LEDs consider replica gauges with the needle controlled by a RC servo.Otherwise if its going to be hidden away in a grey electrical box, consider setting the Pi up for VNC on a secured network so crew can remote access it from a PC or tablet and ditching the engine room display, avoiding all the issues of it looking 'period' or not.

author: dmills
author_rank: Super Contributor
timestamp: May 04, 2016, 02:15:07 pm
content: Yea that kind of display is just SO WRONG for any ship propelled by plant having boilers.Bearing temperatures are a good thought (Don't forget things like forced draft fan bearings), also feedwater conductivity, lubrication pressure, fire room air pressure (If you are on the sort of ship that pressurises the fire rooms), steam saturation (Needs a little calculation from pressure and header temperature), boiler water level (Kind of critical, bad things happen if this gets too low), maybe include some combustion analysis so things like inadequate air flow causing overly rich combustion is detected (Granted the clouds of smoke give this away).Regards, Dan.

author: Kiwi__Power
author_rank: Newbie
timestamp: May 04, 2016, 10:42:31 pm
content: Well we thought about turning it into a "black box" monitoring absolutely everything but the ebay price for those pressure sensors are about $40 each and each ADC has 8 channels with a SPI connection. It does have a force draught fan which is a big, person height diameter centrifugal fan that blows air through a heat exchanger with the exhaust smoke which preheats it before it goes into the fires. But because it's coal fired by hand, having exhaust temps and O2 sensors MAF sensors to get perfect combustion would be impossible. We did joke around about making a "ECU" for the whole thing haha The throttle for the fan engine is in the engine room and it's slow to react because of the long pipe to it and the inertia of the fan. The main engines have a total loss lubrication system, all the engines are like that except for the generator and the fan engine, which is a single cylinder high speed engine with an oil pump and enclosed crank. The engine room air temps are usually 35 100% humidity and the boiler room is usually 40 to 55 at no humidity.

author: Kiwi__Power
author_rank: Newbie
timestamp: May 04, 2016, 10:54:34 pm
content: The only really useful information that we don't have already on a gauge somewhere is it would be useful for it to plot indicator cards to gauge the efficiency of the engines but that would be really complicated and would only tell us we have more work to do.