ScotK
Full Member
Posts: 113
|
Post by ScotK on Oct 29, 2019 2:53:27 GMT
That would be great, I'd love to see how you did it. I'd not run across anyone else who attempted it yet.
I don't know anything about Python. I have extensive shell scripting experience, I was thinking about using that just because I know it well, but I would still be interested in seeing what you did. I had considered using 5v on the train, but how do you dampen the electrical noise of the contacts dragging on the stepper to get a clean signal? And where do you make the change to cut off the 24v supply to the stepper wheel so you can replace it with 5v? I looked at the schematics but hadn't figured it out yet.
If I could use 5v on the stepper wheel then I could probably drop to a smaller 24vAC transformer (maybe 1amp? half amp? 3 light bulbs and the stepper motor is all it would run at that point, not sure how much the stepper motor requires) possibly saving some space. I think I'll keep the hat though, I still need 2 relays and the analog input on the hat to read the volume switches. Unless you have an idea about how to do that as well? I wanted to keep the modifications to the consolette wiring at a minimum so I didn't want to alter how the volume buttons worked. I'm assuming that I can run a 5vDC source into the volume switches and read the voltage that comes out the other side that would have otherwise gone to the speaker, and use that reading to set the volume on the Pi. I don't really know yet if that's going to work out though. I have too little electrical engineering experience to know, but it seems like it should work. That's the only way I can think of at the moment without rewiring to read the volume switches directly.
|
|
|
Post by spetersen on Oct 29, 2019 3:15:28 GMT
I converted to LED's to drop some of the current, I am using a 24vac 2.5a wall wart, the signal is only a ground to the 5v that is supplied by the 5v Pi supply. The program filters out the odd spikes (noise) generated during the selection process. The total cost for the hardware is about $60 without the transformer. My consolette is unmodified
|
|
ScotK
Full Member
Posts: 113
|
Post by ScotK on Oct 29, 2019 3:33:00 GMT
|
|
|
Post by spetersen on Oct 29, 2019 3:36:32 GMT
I also used an optoisolator a SN138 it is mounted on a perf board with the audio filter circuit. It cost $1 I also added a 5v Zener across the input to protect it. There is a couple of vids on YouTube that demonstrate similar setups. My current configuration on the Pi is a Raspberry Pi zero with wireless, running stretch lite on a 4g SD card headless running an access point , minimal writes to the SD card(no logs or caching) The usb drive can be a 2g drive for the music and programs. Automount on the USB drive at boot When the box is running, or in standby,it uses less than 10w during a selection it uses 25? W or so. One nice feature is that any of the programs work stand alone, and can be tested separately, or used with a totally different companion program, so it is modular.
Here is a dropbox link to download the files and setup info
Better pictures
and another one
|
|
sooner
Full Member
Oklahoma
Posts: 117
|
Post by sooner on Oct 29, 2019 18:33:52 GMT
Those LEDs look pretty good. Do you have a link where you got them?
|
|
|
Post by spetersen on Oct 29, 2019 18:54:33 GMT
|
|
|
Post by spetersen on Oct 29, 2019 19:20:11 GMT
|
|
sooner
Full Member
Oklahoma
Posts: 117
|
Post by sooner on Oct 29, 2019 19:53:10 GMT
I used a dropping resistor to change the brightness to what I considered normal. What value resistor? :-)
|
|
scudie
Junior Member
Posts: 88
|
Post by scudie on Oct 29, 2019 22:43:48 GMT
Hi Steve I have eventually found time to have a play with those led's that I ordered in September, had to add a resistor to each lamp tried 1000 ohm but to dim settled on 550 ohm. Cheers Scudie
|
|
ScotK
Full Member
Posts: 113
|
Post by ScotK on Oct 30, 2019 1:28:13 GMT
Am I understanding that right? The stepper wheel is actually grounding out whatever electrical signal is coming in on the signal wire? So you have the 24vAC ground and the 5vDC negative grounded on the chassis?
I was under the impression the stepper wheel was sending 24v back to the jukebox from what I've read elsewhere.
|
|
|
Post by spetersen on Oct 30, 2019 3:08:23 GMT
Hi Steve I have eventually found time to have a play with those led's that I ordered in September, had to add a resistor to each lamp tried 1000 ohm but to dim settled on 550 ohm. Cheers Scudie I think it was 470 ohm I will verify in the morning, I think I had no resistor on the case lights Sorry, I quoted the wrong post
|
|
|
Post by spetersen on Oct 30, 2019 3:10:08 GMT
Am I understanding that right? The stepper wheel is actually grounding out whatever electrical signal is coming in on the signal wire? So you have the 24vAC ground and the 5vDC negative grounded on the chassis? I was under the impression the stepper wheel was sending 24v back to the jukebox from what I've read elsewhere. That is correct, it grounds the terminal to create the pulse. With the proper resistors in series / parallel to the optocoupler it is pretty much noise free. About 1 in 100 times I may get a mistake in the decode by 1 count. The program can be tuned to optimize the decoding process, currently pulses less than 12ms? are discarded because the contacts in the wallbox have some noise while the wiper is dragged across them, it also ignores random spikes when the coin energizes the solenoids for the credit unit.
|
|
|
Post by spetersen on Oct 30, 2019 19:12:44 GMT
I used a dropping resistor to change the brightness to what I considered normal. What value resistor? :-) I thought it was 470 ohm, but it was actually 4.7k installed in series with one of the wires at the socket, not much space to avoid shorting against the cover on the lightbox dividers. It would be better to add them in series at the resistors already in circuit. If you don't mind changing the consolette, you could just switch the original resistors to 4.7k. I didn't use any resistors in the case light circuit, it's brighter than stock, but I kind of like it that way.
I wanted to avoid changing anything that would be a pain to undo if someone wanted to change it back in the future. I connected the amp directly to the speakers, bypassing the volume buttons, because the consolette looks better with all 3 buttons out, and I didn't want to cob the wiring for the next person.
|
|
|
Post by spetersen on Oct 30, 2019 19:33:10 GMT
If you use this with my program, a small modification is necessary There are a couple of "not"'s that need to be removed I may have missed some, but you get the idea. I had to invert because of the optocoupler. code below from jukebutns5.py
while length_of_last_gap < MAXMIMUM_GAP: if not GPIO.input(WALLBOX) != state: if state_has_changed(not state): # state has changed but check it is not anomaly state = not state # I use this rather than the GPIO value just in case GPIO has changed - unlikely but possible
If the code is used with a different wallbox, the numbers and letters could be in a different order, and / or sequence In the SC1 or SCH1 V8 is 1 pulse a space and 1 pulse A1 is 8 pulses followed by 20 pulses.
The buttons program when run in a terminal window will display the pulse length for each pulse (this could be disabled[commented out] when running normally to reduce the CPU load a little, but in headless mode the total load is under 20%)
The player program when run an a terminal window will show mplayer running through the song. If both programs are running in 2 terminal windows at the same time you will see them interact.
The goal in writing the programs was to closely emulate the original system as I could, with a minor deviation to allow 318 selections or 4 "songs" per title strip. The buttons program replaces the stepper unit, the Queue file is the tormat / pinbank, and the player is the mech, just "dumbly picking up what file is in the chosen slot(directory) One unintended but cool feature is that you can drop any number of mp3 files in a directory(/Blue/A1) for instance and label the title strip (Party mix) for instance, and the player will play them all.
|
|
ScotK
Full Member
Posts: 113
|
Post by ScotK on Nov 8, 2019 15:47:20 GMT
Well, I've ordered about 10 different connectors from Digi-Key and worked extensively with their support. Nobody can find a 15 pin connector that works with the 15 pin connector on the wallbox. At this point I guess I'll just solder the wires on the connector like Scott Peterson did. I would have been much happier if I had been able to find a proper connector.
I also purchased a 120vAC to 5.1vDC power supply from Digi-Key to power the Pi. It would probably have been easier to go from 24vAC to 5vDC, but the transformer I have would be close to or over its limit if everything was working hard, so I opted to get a 5vDC 8A power supply that runs off the mains. That has more than enough power for the Pi, amp, and anything else I care to throw at it.
I have the day off work, so I'm going to start working on mounting the components today and this weekend to make sure they all fit. Then I'll start some wiring.
|
|