1. Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.
    Dismiss Notice

Circuit for replicating bell codes - any suggestions

Discussion in 'Electronic Projects Design/Ideas/Reviews' started by LeedsNorth, Jan 3, 2014.

  1. LeedsNorth

    LeedsNorth New Member

    Joined:
    Jan 3, 2014
    Messages:
    22
    Likes:
    0
    Hello All,
    I've been browsing around the web for an answer to this query, and wondered if anyone here could point me in the right direction? I have become involved in a project to mechanically and electrically restore an old railway signal box, to show the public what it would have been like in the 1950s. I've sorted 98% of the electrical issues, but am stuck on this one!

    There is an item called a block bell, which was used to pass messages, particular codes meaning different things. for example: something as simple as ding-ding, or ding-ding-ding - pause - ding-ding - pause - ding-ding-ding! I think the bell needs to receive power for about 0.25 second or less to get the right note. I need to create a circuit or to create a PCB that can allow us at the touch of a button, to create a specific bell code - ideally several buttons, one for each code that needs to be recreated. There's no speaker required as we have the original bell machines from the signal box, so in essence its a case of just turning the power on/off at the right time/spacing to power the bell code.

    I will point out I'm no electronics whizz by any means, but can get around the basics. I was thinking a 5-5-5 timer would achieve a common gaps between the bells, but I'm lost with how to get it to give different numbers of bells and pause. Would anybody be willing to offer me any advice on how it can be done, or at least point me in the right direction? All help is gratefully appreciated.

    Regards
    Andy
     
  2. kubeek

    kubeek Well-Known Member

    Joined:
    Mar 11, 2006
    Messages:
    1,491
    Likes:
    186
    Location:
    Prague, Czechia (not Chechnya)
    ONLINE
    How do you feel about using a microcontroller? It would be much more easier to hook up, and also easier to correct any mistakes since you can reprogram it over and over. For example some arduino would be an ideal strarting point if you havenĀ“t worked with these before.

    Single chip with a few passive components vs. a 555 and a fair bit of logic ICs seems to me to be a no brainer.
     
  3. rogs

    rogs Member

    Joined:
    Oct 3, 2009
    Messages:
    148
    Likes:
    4
    Location:
    UK
    What is the maximum number of 'dings' and 'gaps' (i.e. individual'events') that you would require from any one individual push button?
    The reason I ask is that you will almost certainly get a number of replies suggesting you use a simple microcontroller for this task. (EDIT:As suggested above by Kubeek, who posted as I wrote and posted this - before I had read his post:))
    While that is an obvious solution, it will require that you (or someone else!) have the ability to write some simple 'code' (i.e. a simple computer program)

    If you only need a maximum of say, 10 or 12 'events', then a simple hardware sequencer, using a couple of CMOS 4017 decade counters may offer a simple solution that doesn't require any computer 'code' to be written at all.....

    One final point..... is the actual bell controlled by a relay or solenoid?....if so, you will need to include back EMF protection on the 'sequencer' output. A ULN2803 may provide the obvious answer to both the bell 'drive' and the protection circuit.....
     
    Last edited: Jan 3, 2014
  4. dave

    Dave New Member

    Joined:
    Jan 12, 1997
    Messages:
    -
    Likes:
    0


     
  5. LeedsNorth

    LeedsNorth New Member

    Joined:
    Jan 3, 2014
    Messages:
    22
    Likes:
    0

    Guys, many thanks for the prompt response. Ive no problem in theory about using a microprocessor, although its not something i've experienced before - although more than happy to try!

    Rogs, maximum code to be sent would be eight consecutive bells, and the maximum number of gaps would be two, for example eight dings-gap-two dings-gap four dings is the longest code, one bell being the shortest. In a perfect world there are 24 codes to be replicated, but the minimum number is 11.

    I'll have to check, but i believe the bell is actually controlled by a solenoid. The bells are 1930s/1940s technology, just to make things even more interesting!
     
  6. rogs

    rogs Member

    Joined:
    Oct 3, 2009
    Messages:
    148
    Likes:
    4
    Location:
    UK
    AS you are OK with using a microcontroller, it's no contest... the hardware will be simpler using a software based controller...(LATE EDIT: no longer sure this is necessarily true ... in this case, the hardware may be just as simple -- see the later thread posts -- especially the circuit sketch attached to my post #48).....
    You should have no trouble in generating all 24 sequences easily with a microcontroller
    It's just that on some occasions, a logic hardware sequencer can provide a solution for a simple 'one off' project.



    If the bell is solenoid driven, don't forget to include a back EMF protection diode on the output to protect the electronics!
     
    Last edited: Jan 11, 2014
  7. Mike odom

    Mike odom Active Member

    Joined:
    Feb 21, 2010
    Messages:
    670
    Likes:
    52
    Location:
    Kansas City, KS, U.S.A.
    If the solenoid is AC drive, I have a micro board setup to drive 5 solenoids. The only thing would be the inputs. I have another micro board that could be modified to drive any circuit, and has a 16 position hex switch input so you could turn the switch to the correct setting, hit a 'start' switch, and have it give you the responding outputs. I don't think I have any boards setup for inputting 24 switches.
     
  8. LeedsNorth

    LeedsNorth New Member

    Joined:
    Jan 3, 2014
    Messages:
    22
    Likes:
    0
    Hi Mike,
    I'll double check the solenoid, but do I understand you correctly, that you input / drive boards could be used with the Microprocessor board suggested by Kubeek? 16 inputs would work for what we want to do.

    Andy
     
  9. Mike odom

    Mike odom Active Member

    Joined:
    Feb 21, 2010
    Messages:
    670
    Likes:
    52
    Location:
    Kansas City, KS, U.S.A.
    I design boards, and I use Atmel processors exclusively (unless a client wants a PIC). So my boards will already have the microcontroller built into it. What I was getting at was instead of a custom design, I may already have one in house that can be modified to do whatever it is you need. In fact, if memory serves, I have one that drives a bridge circuit that has a proto type area on it for adding switches. It also has a 5V regulator on it, being fed from 12V. Now, if I can just find my 'bare' board collection.
     
  10. LeedsNorth

    LeedsNorth New Member

    Joined:
    Jan 3, 2014
    Messages:
    22
    Likes:
    0
    Mike,
    Ah I'm with you now! I've learnt so much in the past couple of hours! Didn't know things like these microprocessors existed outside of things like Intel, ARM and AMD!

    What Im thinking is that we can create a board in the box with 14-16 buttons on, which feeds into the 16 inputs of your board, that way during a demonstration, the appropriate code can be recreated. I presume one of these boards that your talking about would connect directly to the bell concerned?

    Andy
     
  11. Mike odom

    Mike odom Active Member

    Joined:
    Feb 21, 2010
    Messages:
    670
    Likes:
    52
    Location:
    Kansas City, KS, U.S.A.
    Or directly to the solenoid driving the bell. Which, most bells, were a solenoid with the traveling piece hitting the ringer. I'll just need to know how to drive the bell.

    The buttons don't necessarily go on a board. They can just as easily be panel mounted on the cover or side of the box. 16 buttons will yield a 4 x 4 matrix, since only one button will be depressed at a time, so only 8 wires will need to be fed into the board.
     
  12. KeepItSimpleStupid

    KeepItSimpleStupid Well-Known Member Most Helpful Member

    Joined:
    Oct 30, 2010
    Messages:
    9,918
    Likes:
    1,098
    LeedsNorth

    Let Mike guide you.

    But, for fun and giggles take a look here: http://www.picaxe.com/ It kinda falls into the almost anybody can do it category. I2C is an inter IC communications bus which means that the capabilities can be expanded on. Then take a look here: http://www.google.com/url?sa=t&rct=...F5G4cAyn7GNjIWw&bvm=bv.58187178,d.cWc&cad=rja

    Idea would be to wait for an interrupt and then start reading to find out what switch was closed. One of the original PICAXE pins would drive your bell.
     
  13. MrAl

    MrAl Well-Known Member Most Helpful Member

    Joined:
    Sep 7, 2008
    Messages:
    11,032
    Likes:
    952
    Location:
    NJ
    ONLINE
    Hi,

    Yeah the first thing i noticed is that you were saying "microprocessor" and the advice given so far was for a "microcontroller". Note the difference in spelling. These two kinds of devices are very very different even though they do have similarities.

    The microprocessor usually needs RAM, ROM, and I/O port glue logic in order to store object code and do calculations and interface with the outside world. The microcontroller on the other hand is all that in one chip!

    So you see by using a microcontroller (abbreviated "uC" by many folks) you are almost there before you even begin because most of the hardware is already present. Add a small 5v regulator chip and that runs everything.

    The ROM takes the form of Flash EEPROM and that is where you place your main running code, and the RAM is built in as well, and the I/O ports are already built in too so all you have to do is supply some code in the built in EEPROM with a ready made programmer board (relatively cheap) and you can be up and running by tomorrow morning (no kidding). You can also use part of the EEPROM for your own program to store non volatile data.

    To ring some bells or light some LED's would be nothing for one of these chips, even the low end line of chips with only maybe six I/O pins which sell for around 2 dollars USD.

    To make a complex set of ring codes would be quite easy with one of these devices, so that's the best approach as long as you dont mind using them. Since you seem to have some experience with uP's chips (microprocessor chips) you will find it so much simpler and easier to use a uC chip you will wonder why you never did this before.
     
  14. LeedsNorth

    LeedsNorth New Member

    Joined:
    Jan 3, 2014
    Messages:
    22
    Likes:
    0
    KISS & Mr Al (nothing implied!),
    Thanks for your comments. I must admit, I'm quite interested in trying to create it myself in someways, i enjoy *simple* electronics lol and feel it would be an achievement for me to have put it together!

    Oops! I never noticed that - i'll try and remember its micro controller - maybe doing it myself isn't such a good idea!!!

    The programming side does not worry more, being a fairly accomplished VB6, VB.Net, ASP, PHP programmer, its more making sure i get the right parts and get them 'wired' up correctly.

    I'm open to all thoughts and suggestions, if it was you, (bearing in mind I've not used a uC chip before) are there any particular makes/models you would suggest?

    Andy
     
  15. KeepItSimpleStupid

    KeepItSimpleStupid Well-Known Member Most Helpful Member

    Joined:
    Oct 30, 2010
    Messages:
    9,918
    Likes:
    1,098
    I did mention the PICAXE, all because it's used to teach kids, is programmable in BASIC and doesn't require a development system.

    The GLUE required is:
    The interface to the bell (I didn't see yet what there is to deal with)
    The interface to the push buttons.

    The other part of the glue is to select the power supply/supplies and make sure protections are in place.

    A general problem is dealing with the logic levels. 5V has been around for a long time and 3.3 V is very common now. 1.8 V and 0.8 V logic is cropping up.

    I2C might take a bit getting used too. See http://www.google.com/url?sa=t&rct=...VKjblTMFgLLHdqg&bvm=bv.58187178,d.cWc&cad=rja The PICAXE already has the commands to control the I2C bus from BASIC.

    So, from you we need:
    Some info about the bell: particularly voltage and current.
    Some info about the power available; 24 VDC, 12 VDC, 120 VAC etc.

    I really like these buttons in the rectangular form: http://us.idec.com/Catalog/ProductS...ries&FamilyName=Pushbuttons_And_Pilot_Devices You can place a legend under them, say made from transparency film. Red doesn;t show up nicely. Yellow has the nicest visibility. You have to pick 6, 12 or 24 V; It doesn't matter if it is AC or DC.

    You might not be familiar with the 1 NC and 1 NO terms, but this means one Normally open contact and 1 Normally closed contact. To make the switch an SPDT switch, you have to tie two pins together.

    Some ideas:
    So, you could either light them all when power is on.

    Possibly turn the selected on off when the bell sounds.

    Or light them all and then darken them all and make the selected button blink like the bell.

    Earlier it was discussed the possibility of making the switches a matrix. It might add more complications. I might tend to go interrupt with I2C and use another I2C device + a driver IC for the lamps.

    Not sure what your planning for an enclosure, but look at a NEMA 1 or NEMA 4. http://www.google.com/url?sa=t&rct=.../Products/Documents/nema-enclosure-types.pdf& ei=EFvHUoC4AajQsATb3oDwDA&usg=AFQjCNE76vrac9Bc7JLFR0nfSCdpTVLPPg&bvm=bv.58187178,d.cWc&cad=rja

    I could be totally barking up the wrong tree too. I was just thinking of a 4 x 4 grid with labeled buttons. If you want unlabed buttons, then you could go with laminate labels below and give it an older feel.
     
  16. LeedsNorth

    LeedsNorth New Member

    Joined:
    Jan 3, 2014
    Messages:
    22
    Likes:
    0
    Hi,
    Sorry i'd forgotten you mentioned PICAXE when I replied. I've spent most of the morning reading the website, it would seem that you can do an awful lot with these things! Im totally bewildered with it at the moment, but will keep reading and get my head around it. I can see how the code can switch the power onto specific outputs, and through time delays, switch it off etc.. Im assuming the the inputs of the chip get connected to the various switches - these will probably just be mounted on a board somewhere within the demonstration area, so that the person demonstrating has easy access to them. I like the IDEC switches however, very professional looking too!

    Most of the electronics in the signal box for this project are 12v DC, so I'm sure the bells are the same - I'm just waiting on a colleague coming back to me to confirm - it may be that they are lower, 6v or even 1.5v, the railways weren't noted for high voltages when they weren't needed! But even if it is lower, feeding 12v through resistors I should be able to bring it down to the required voltage.

    Andy
     
  17. KeepItSimpleStupid

    KeepItSimpleStupid Well-Known Member Most Helpful Member

    Joined:
    Oct 30, 2010
    Messages:
    9,918
    Likes:
    1,098
    I/O:

    In the early days there were input ports and output ports. Now there are grouped ports for a given purpose on the controllers. For example on some micro controllers, a group of ports can be defined as a rotary encoder or an a/d converter. The software to implement speed/direction/position is internal to the chip.

    Pins need real estate and real estate costs money, so there is a tendency to want to reduce pin count. Real estate is the PCB or the IC die. when building something, a large amount of the total cost goes into the case and power supply.

    Using I2C and the appropriate I/O device would relieve you of switch debouncing and polling.
    Every mechanical switch bounces, so pushing it once could mean 10 closures the the micro sees.

    So, if you let the I2C chip detect a change in state and then notify the processor via an interrupt, your programming become much easier.

    I'm temporarily trying to avoid learning concepts of debouncing and matrix scanning of inputs. I'm trading that for the I2C bus (Native) and interrupts.

    Your output seg, could be hard coded or maybe even hard coded into groups. e.g. Pass a few variables like a,b,c,d,e and each pair is an out/delay. So passing 5,10,5,10,0,0
    is ring for 5 sec, off for 10, ring for 5, off for 10 or you could just plain hard code it (pseudocode) such as out 1,0; Wait 5, out 1, 0; wait 10 etc.; Return
    If you like C, we can find that too.

    Another platform I have never seen discussed here is the mbed. http://mbed.org/platforms/
    Here, the entire development process is done via a webpage in C for various processors.

    Now, don't read it, but here is an 841 page manual for the LPC1768 used in one of the mbed modules: http://www.google.com/url?sa=t&rct=...pOYQQCnRgxetOEDSvLaCiWw&bvm=bv.58187178,d.cWc

    These two concepts are not the mainstay of what's out there.
     
  18. LeedsNorth

    LeedsNorth New Member

    Joined:
    Jan 3, 2014
    Messages:
    22
    Likes:
    0
    Right, what your saying about letting the I2C chip detect the change in state, and then the processor picking that up through an interrupt makes total sense, and I would think should also mean that the processor (micro controller) isn't workings hard.

    Now, I'm trying to understand the I2C concept - this is fed into the PICAXE chip using the SCL and SDA connections? The I2C chip that we're talking about for detecting a switch being pressed, is this separate to the I2C EEROM chip that was mentioned earlier? Is the latter (which if I understand correctly is a memory store) still required?

    Sorry if I'm being thick - the penny hasn't quite dropped yet.
     
    Last edited: Jan 4, 2014
  19. LeedsNorth

    LeedsNorth New Member

    Joined:
    Jan 3, 2014
    Messages:
    22
    Likes:
    0
    Oh I forgot to add, the bells are 1.5v DC, with direct current - so a momentary pulse of current down the cable, lifts the hammer within the bell - if the power is left applied the hammer stays in the up position, when power is removed, it drops to normal position. Hence to get a normal 'ding' on the bell, needs power applied for a split second. Does that complicate things?
     
  20. KeepItSimpleStupid

    KeepItSimpleStupid Well-Known Member Most Helpful Member

    Joined:
    Oct 30, 2010
    Messages:
    9,918
    Likes:
    1,098
    Bells: Not really. Any idea of the current requirement @ 1.5 V?
     
  21. LeedsNorth

    LeedsNorth New Member

    Joined:
    Jan 3, 2014
    Messages:
    22
    Likes:
    0
    In terms of amps? very little. Sorry, again i'll have to check, but I know we've checked that ours worked by using a car battery, we think they are 1amp, but i'll check
     

Share This Page