[{"element_type":"user_image","content":"https://cdn-learn.adafruit.com/user_assets/assets/000/000/349/original/truck.jpg?1700355287","metadata":{"caption":""}},{"element_type":"text","content":"\n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n        \u003ch1\u003ePart one : Where's the mic? \u003c/h1\u003e\n\u003cp\u003e\"Breaker breaker , any takers? This is the the one and only Delchi hunting for bear on I-95 South , keeping that double nickel and keeping the sunny side up \u0026amp; the greasy side down! We gone!\" \u003csup\u003e1\u003c/sup\u003e\u003c/p\u003e\n\u003cp\u003eI was looking for some new gaming frontiers when I came across truck simulators! All the skill \u0026amp; thrill of a big rig from your PC. As with all simulators there are button boxes and realistic cockpits to buy, but one thing I didn't see was a CB radio mic! They expect us to use desktop mics, headsets or some other hoo-haw instead of the ol jabberjaw microphone! A little deeper digging showed that you can buy adapters, but they ranged from $180 to $300! ( Granted the $300 one is an awesome button box and has a lot of realistic controls along with the mCB mic.) \u003c/p\u003e\n\u003cp\u003eWell the first thing I did was say \"Belgium\" to that, and pulled Rolling Thunder across the room to my workbench and got to work. This was going to be a project that would work with Truck simulators, sub simulators and more! Grab that soldering iron, the wire clippers and that drill over there! It's time to start making! \u003c/p\u003e\n\u003cp\u003e \u003c/p\u003e\n\u003ch2\u003eNotes : \u003c/h2\u003e\n\u003cp\u003e1. CB radio jargon was around long before IRC , and was its own language designed to obfuscate communication and have a grand ol time. \"Handles\" were common, and yes CB radio handles are where the hacking community got the term handles for hacker aliases! \u003c/p\u003e\n\u003cp\u003eTranslation? Why not ? \u003c/p\u003e\n\u003cul\u003e\n\u003cli\u003e\"Breaker breaker , any takers?\"\n\u003cul\u003e\n\u003cli\u003eIn cb radio ( less formal than ham radio ) it was common to ask permission before talking on an open channel. Calling for a \"break\" was like requesting permission to chime in , and was normally answered with \"Go ahead breaker\"\u003c/li\u003e\n\u003c/ul\u003e\n\u003c/li\u003e\n\u003cli\u003e\"This is the the one and only Delchi\"\n\u003cul\u003e\n\u003cli\u003eHandles were a point of pride and very often unique, but when they did collide they politely adjusted to be like \"The New Orleans Joker \" vs \"The Chicago Joker\" and so on.\u003c/li\u003e\n\u003c/ul\u003e\n\u003c/li\u003e\n\u003cli\u003e\"hunting for bear on I-95 South\"\n\u003cul\u003e\n\u003cli\u003eTruckers took great lengths to avoid being caught by the police in speed traps. \"Smokey Bear\" referred to the Smokey The Bear hat most often worn by police patrolling the interstates. If you were hunting for bear that meant you were on the lookout for police, and sometimes were asking for a \"Smokey report\" if anyone had seen any police.  You usually followed this with the interstate you were on and the direction you were traveling and sometimes the mile marker you had passed most recently.\u003c/li\u003e\n\u003c/ul\u003e\n\u003c/li\u003e\n\u003cli\u003e\"keeping that double nickel\"\n\u003cul\u003e\n\u003cli\u003eThis referred to the speed limit of 55 miles per hour that was enforced back then. Sadly there is no clever phrase for the 65 mph speed limit.\u003c/li\u003e\n\u003c/ul\u003e\n\u003c/li\u003e\n\u003cli\u003e\"keeping the sunny side up \u0026amp; the greasy side down!\"\n\u003cul\u003e\n\u003cli\u003eMultiple meanings here, but for the most part this meant keeping your truck upright ( sunny side was the cabin, greasy side was the road ). It was like wishing someone safe travels and no accidents. \u003c/li\u003e\n\u003c/ul\u003e\n\u003c/li\u003e\n\u003cli\u003e\"We gone!\"\n\u003cul\u003e\n\u003cli\u003eWhen a conversation ended people would signal this with a number of phrases like \"we gone\" , or \"On the side\". Sometimes it also included the \"10-code\" messages such as \"10-10 Till I see you again\"\u003c/li\u003e\n\u003c/ul\u003e\n\u003c/li\u003e\n\u003c/ul\u003e\n\u003ch2\u003eRelated Links : \u003c/h2\u003e\n\u003cul\u003e\n\u003cli\u003eTruck Simulator\n\u003cul\u003e\n\u003cli\u003e\u003ca href=\"https://americantrucksimulator.com/\"\u003ehttps://americantrucksimulator.com/\u003c/a\u003e\u003c/li\u003e\n\u003c/ul\u003e\n\u003c/li\u003e\n\u003cli\u003eButton Box\n\u003cul\u003e\n\u003cli\u003e\u003ca href=\"https://www.simpanel.com/ats\"\u003ehttps://www.simpanel.com/ats\u003c/a\u003e\u003c/li\u003e\n\u003c/ul\u003e\n\u003c/li\u003e\n\u003cli\u003e10- Code \u0026amp; other jargon\n\u003cul\u003e\n\u003cli\u003e\u003ca href=\"https://www.rightchannelradios.com/blogs/newsletters/cb-radio-slang-and-10-codes\"\u003ehttps://www.rightchannelradios.com/blogs/newsletters/cb-radio-slang-and-10-codes\u003c/a\u003e\u003c/li\u003e\n\u003c/ul\u003e\n\u003c/li\u003e\n\u003c/ul\u003e\n\u003cp\u003e \u003c/p\u003e\n      \n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n","metadata":{}},{"element_type":"text","content":"\n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n        \u003ch1\u003ePart Two : Requirements\u003c/h1\u003e\n\u003cp\u003eSo then at the workbench with graph paper and pencil in hand ( or Lucidchart if you will ) let's determine what we need to make this CB mic project roll down the road : \u003c/p\u003e\n\u003cul\u003e\n\u003cli\u003eUtilizing a CB Microphone\n\u003cul\u003e\n\u003cli\u003eBe able to attach the microphone to the computer\u003c/li\u003e\n\u003cli\u003eBe able to use the button on the microphone to activate the  PTT ( Push to talk ) feature on the computer / in game\u003c/li\u003e\n\u003cli\u003eMake it look realistic! \u003c/li\u003e\n\u003cli\u003eMake it as clean as possible ( minimum number of wires / software / configuration )\u003c/li\u003e\n\u003c/ul\u003e\n\u003c/li\u003e\n\u003c/ul\u003e\n\u003cp\u003e \u003c/p\u003e\n      \n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n","metadata":{}},{"element_type":"text","content":"\n  \n  \n        \u003ch1\u003ePart Three : The Parts!\u003c/h1\u003e\n\u003cp\u003eSo after thinking it over for a bit I came up with the parts needed to make this happen : \u003c/p\u003e\n\u003cul\u003e\n\u003cli\u003eCB Microphone\n\u003cul\u003e\n\u003cli\u003eCB mic with 4 Pin male plug\u003c/li\u003e\n\u003cli\u003e\n\u003ca href=\"https://www.amazon.com/Repalcement-Pin-Radio-Microphone-Plug/dp/B00H574YA8/\"\u003eHttps://www.amazon.com/Repalcement-Pin-Radio-Microphone-Plug/dp/B00H574YA8\u003c/a\u003e\u003cbr\u003e\u003cbr\u003e\n\u003c/li\u003e\n\u003c/ul\u003e\n\u003c/li\u003e\n\u003cli\u003eMicrophone adapter - CB 4 pin to 1/8\" MIC IN\n\u003cul\u003e\n\u003cli\u003eCB 4 pin female plug\n\u003cul\u003e\n\u003cli\u003e\u003ca href=\"https://www.amazon.com/Repalcement-Pin-Radio-Microphone-Plug/dp/B00H574YA8/\"\u003eHttps://www.amazon.com/Repalcement-Pin-Radio-Microphone-Plug/dp/B00H574YA8\u003c/a\u003e\u003c/li\u003e\n\u003c/ul\u003e\n\u003c/li\u003e\n\u003cli\u003e1/8\" MIC IN in cable with bare wire on one end\u003cbr\u003e\u003cbr\u003e\n\u003c/li\u003e\n\u003c/ul\u003e\n\u003c/li\u003e\n\u003cli\u003ePTT signal adapter\n\u003cul\u003e\n\u003cli\u003eAdafruit QT Py RP2040 ( Part # 4900 )\u003c/li\u003e\n\u003cli\u003eAdafruit USB type A to type C cable - 6\"  ( Part # : 4472 ) \u003c/li\u003e\n\u003cli\u003eAdafruit Half Size Breadboard ( Part # 4539 )\u003cbr\u003e\u003cbr\u003e\n\u003c/li\u003e\n\u003c/ul\u003e\n\u003c/li\u003e\n\u003cli\u003eProject Box : \n\u003cul\u003e\n\u003cli\u003eAdafruit has many of these. You will need to find the right size for your project.\n\u003cul\u003e\n\u003cli\u003e\n\u003ca href=\"https://www.adafruit.com/search?q=project+box\"\u003ehttps://www.adafruit.com/search?q=project+box\u003c/a\u003e\u003cbr\u003e\u003cbr\u003e\n\u003c/li\u003e\n\u003c/ul\u003e\n\u003c/li\u003e\n\u003cli\u003eGasket for the hole in the box where the USB cable will emerge from\n\u003cul\u003e\n\u003cli\u003e\u003ca href=\"https://www.amazon.com/dp/B093FCB922\"\u003ehttps://www.amazon.com/dp/B093FCB922\u003c/a\u003e\u003c/li\u003e\n\u003c/ul\u003e\n\u003c/li\u003e\n\u003c/ul\u003e\n\u003c/li\u003e\n\u003cli\u003eUSB Hub\n\u003cul\u003e\n\u003cli\u003e\n\u003ca href=\"https://www.amazon.com/dp/B0CD1BHXPZ?ref=ppx_yo2ov_dt_b_product_details\"\u003ehttps://www.amazon.com/dp/B0CD1BHXPZ?ref=ppx_yo2ov_dt_b_product_details\u003c/a\u003e\u003cbr\u003e\u003cbr\u003e\n\u003c/li\u003e\n\u003c/ul\u003e\n\u003c/li\u003e\n\u003cli\u003eUSB Soundcard\n\u003cul\u003e\n\u003cli\u003e\u003ca href=\"https://www.amazon.com/dp/B00IRVQ0F8?ref=ppx_yo2ov_dt_b_product_details\"\u003ehttps://www.amazon.com/dp/B00IRVQ0F8?ref=ppx_yo2ov_dt_b_product_details\u003c/a\u003e\u003c/li\u003e\n\u003c/ul\u003e\n\u003c/li\u003e\n\u003c/ul\u003e\n\u003cp\u003e \u003c/p\u003e\n      \n\n","metadata":{}},{"element_type":"text","content":"\n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n        \u003ch1\u003ePart 4 :  Wiring it up !\u003c/h1\u003e\n\u003cp\u003eSo now we have to go exploring as to how we will connect these microphones to the computer. First off we know that most computers come with a built in sound system ( we used to call it a sound card when they didn't come with them ). There is a AUX input and a MIC input. Seems simple enough, right? So now all we need to know is the pinout for the 4 pin connector. Quick! To the internet!\u003c/p\u003e\n      \n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n","metadata":{}},{"element_type":"user_image","content":"https://cdn-learn.adafruit.com/user_assets/assets/000/000/344/original/pinout.jpg?1700353866","metadata":{"caption":""}},{"element_type":"text","content":"\n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n        \u003cp\u003eSo we now know that pin 1 is ground, pin 2 is the microphone element, and pin 3 is the PTT button. \u003c/p\u003e\n\u003cp\u003eTake care to note that pin 2 is connected to the microphone element, which means this is best suited to go into the MIC IN on the computer and not the AUX IN port. AUX IN is designed for connecting to AUX OUT on another device. For more info google up \"Mic level and line level\". \u003c/p\u003e\n\u003cp\u003eSo with a handy soldering iron and some wire , we will make the following connections : \u003c/p\u003e\n\u003cul\u003e\n\u003cli\u003eMicrophone plug\n\u003cul\u003e\n\u003cli\u003eTwo wires from pin 1\n\u003cul\u003e\n\u003cli\u003eWire  #1 : to negative on the 1/8\" MIC IN plug\u003c/li\u003e\n\u003cli\u003eWire #2 : to be attached to the QT Py GND pin\u003c/li\u003e\n\u003c/ul\u003e\n\u003c/li\u003e\n\u003cli\u003eOne wire from pin 2 to the positive on the 1/8\" MIC IN plug\u003c/li\u003e\n\u003cli\u003eOne wire from pin 3 to be attached to the QT Py A0 pin\u003c/li\u003e\n\u003c/ul\u003e\n\u003c/li\u003e\n\u003c/ul\u003e\n\u003cp\u003eDon't connect any wires to the QT Py just yet. It still needs to be set up. \u003c/p\u003e\n\u003cp\u003e \u003c/p\u003e\n\u003cp\u003e \u003c/p\u003e\n      \n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n","metadata":{}},{"element_type":"user_image","content":"https://cdn-learn.adafruit.com/user_assets/assets/000/000/373/original/d44.JPG?1700525611","metadata":{"caption":"Wiring Diagram. Sorry if it's a bit rough. I dont' have proper symbols for the QT Py , or the CB plug"}},{"element_type":"text","content":"\n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n        \u003ch1\u003ePart 5 : PTT for you and me!\u003c/h1\u003e\n\u003cp\u003eThe next challenge is getting the PTT signal to the computer. As it stands the PTT switch on the microphone not only closes the circuit on pin 2, enabling the microphone, but it also closes the circuit on pin 3 to let the radio know the microphone is in use and to start transmitting.\u003c/p\u003e\n\u003cp\u003eThis means that we need pin 3 and pin 1 connected as a switch to know when the microphone is in use \u0026amp; send a signal to the computer that emulates pressing the hot key on your keyboard to let the game know that the microphone is in use. For this we will be using the Adafruit \u003cspan\u003eAdafruit QT Py RP2040.\u003c/span\u003e\u003c/p\u003e\n\u003cp\u003e\u003cspan\u003eThe first step in doing this is to acquire the QT Py 2040, then solder the header pins on it, then attach it to the breadboard. \u003c/span\u003e\u003c/p\u003e\n\u003cp\u003eAfter doing that bit of fun, head on over to the most excellent tutorial on how to install circuitpython on the board at \u003ca href=\"https://learn.adafruit.com/adafruit-qt-py-2040/circuitpython\"\u003ehttps://learn.adafruit.com/adafruit-qt-py-2040/circuitpython\u003c/a\u003e. \u003c/p\u003e\n\u003cp\u003eOnce you have that completed, use your editor of choice ( I chose the MU editor ) and drop the following code into the QT Py : \u003c/p\u003e\n\u003cp\u003e \u003c/p\u003e\n      \n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n","metadata":{}},{"element_type":"code","content":"import board\nimport keypad\nimport usb_hid\nfrom adafruit_hid.keyboard import Keyboard\nfrom adafruit_hid.keycode import Keycode\n\n\npins = [board.A0]\nbuttons = keypad.Keys(pins, value_when_pressed=False)\nkeyboard = Keyboard(usb_hid.devices)\nevent = keypad.Event()\nprint(\"listening\")\n\nwhile True:\n    while buttons.events:\n        buttons.events.get_into(event)\n        if event.pressed:\n            keyboard.press(Keycode.SHIFT,Keycode.F2)\n            print(\"PRESSED\")\n        else:\n            keyboard.release(Keycode.SHIFT,Keycode.F2)","metadata":{"language":"python","linenums":false}},{"element_type":"text","content":"\n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n        \u003cp\u003eMake sure to replace the keystroke you need to send to the game in the code. In the example above I used because it's an out of the way key combo, but I had to set that as the PTT key in the game as well. \u003c/p\u003e\n\u003cp\u003eChange the value to what you like in these two lines : \u003c/p\u003e\n\u003cp\u003e\u003cspan\u003ekeyboard.press(Keycode.SHIFT,Keycode.F2)\u003cbr\u003e\u003c/span\u003e\u003cspan\u003e keyboard.release(Keycode.SHIFT,Keycode.F2)\u003c/span\u003e\u003c/p\u003e\n\u003cp\u003e \u003c/p\u003e\n      \n\n\n\n\n\n\n\n\n\n","metadata":{}},{"element_type":"text","content":"\n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n        \u003ch1\u003ePart 6 : Connecting wires to the QT Py\u003c/h1\u003e\n\u003cp\u003eNothing could be easier, thanks to the breadboard! Take a good look at the QT Py board and you will see the pins related to GND and A0. \u003c/p\u003e\n\u003cp\u003eIn the following photo A0 is on the left, and GND is on the right. Follow the wiring diagram above and if you feel the need, use a hot melt glue gun ( like I did ) to secure the wires on the breadboard. It's not cheating, I promise! \u003c/p\u003e\n\u003cp\u003e \u003c/p\u003e\n      \n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n","metadata":{}},{"element_type":"user_image","content":"https://cdn-learn.adafruit.com/user_assets/assets/000/000/371/original/qtg.JPG?1700524798","metadata":{"caption":""}},{"element_type":"text","content":"\n  \n  \n  \n  \n  \n  \n  \n        \u003cp\u003eWith all the wires connected you should see the messages generated by the PRINT statements in the MU editor when you press the button on the CB microphone. \u003c/p\u003e\n\u003cp\u003eA few pointers if it doesn't work : \u003c/p\u003e\n\u003cul\u003e\n\u003cli\u003eCheck your soldering joints on the header pins ( I made a mistake here ) \u003c/li\u003e\n\u003cli\u003eCheck the connections at the breadboard ( That's why I hot glued them! ) \u003c/li\u003e\n\u003cli\u003eCheck your soldering connections at the 4 pin plug ( I made a mistake here ) \u003c/li\u003e\n\u003c/ul\u003e\n\u003cp\u003e \u003c/p\u003e\n      \n\n\n\n\n\n\n","metadata":{}},{"element_type":"text","content":"\n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n        \u003ch1\u003ePart 7 : The Challenges!\u003c/h1\u003e\n\u003cp\u003eOK so now is about the time where something goes wrong, right? We have working code, working gear , what could go wrong? Well talking with some people I found that I had overlooked a few things : \u003c/p\u003e\n\u003cul\u003e\n\u003cli\u003eWhat if I already have a microphone in the MIC IN jack? \u003c/li\u003e\n\u003cli\u003eThe volume controls on Windows are evil for MIC IN\u003c/li\u003e\n\u003cli\u003eI don't want two cords coming out of the project box, just one! I have enough wires already! \u003c/li\u003e\n\u003cli\u003eHow do I easily reprogram the QT Py if I need to? \u003c/li\u003e\n\u003c/ul\u003e\n\u003cp\u003eThese are all good points, and after doing some thinking I came to an interesting solution. \u003c/p\u003e\n\u003cp\u003eInstead of going directly to the MIC IN on the computer, and running two cables to the PC ( USB and MIC IN ) I changed the design to use a small unpowered hub, a small USB sound card, and one extra USB cable. This solves all of the problems at once! \u003c/p\u003e\n\u003cp\u003eA quick redesign lead me to this prototype : \u003c/p\u003e\n\u003cp\u003e \u003c/p\u003e\n      \n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n","metadata":{}},{"element_type":"user_image","content":"https://cdn-learn.adafruit.com/user_assets/assets/000/000/377/original/d4done.JPG?1700528824","metadata":{"caption":"Apologies for the mess, I'll improve this when I can. "}},{"element_type":"user_image","content":"https://cdn-learn.adafruit.com/user_assets/assets/000/000/372/original/poi99.JPG?1700525386","metadata":{"caption":"Prototype! Lot's of zip ties and hope here :) "}},{"element_type":"text","content":"\n  \n        \u003ch1\u003ePart 8 : Boxing day! \u003c/h1\u003e\n\u003cp\u003e( Apologies to you folks in Canada ;)  ) \u003c/p\u003e\n\u003cp\u003eSo next we put the whole shooting match in a box. This is where you , the gentle reader , have to make some decisions on how you want your project to look. For me I chose to use a large box because I had an extra microphone that I managed to get working by getting a swap-meet microphone adapter for powered Motorola mics. This was not a plug \u0026amp; play solution and was a bit of a challenge. This will be explained in another project. \u003c/p\u003e\n\u003cp\u003eSo I found a rather large box, measured and marked it with a grease pencil, drilled some holes for mounting the plugs, and added a gasket for the USB cable that leads to the computer. A little hot melt glue and some trial \u0026amp; error later I had a mounted project!\u003c/p\u003e\n      \n","metadata":{}},{"element_type":"user_image","content":"https://cdn-learn.adafruit.com/user_assets/assets/000/000/374/original/box1.JPG?1700526483","metadata":{"caption":""}},{"element_type":"user_image","content":"https://cdn-learn.adafruit.com/user_assets/assets/000/000/375/original/plugg.JPG?1700526641","metadata":{"caption":""}},{"element_type":"user_image","content":"https://cdn-learn.adafruit.com/user_assets/assets/000/000/376/original/dddone.JPG?1700526846","metadata":{"caption":""}},{"element_type":"text","content":"\n        \u003ch1\u003eConclusion!\u003c/h1\u003e\n\u003cp\u003eThere it is! Tried, tested and ready to go! \u003c/p\u003e\n\u003cp\u003eNow keep in mind that this is my first Adafruit Playground posting, so if you discover something lacking or wrong please let me know and I'll edit it ASAP.\u003c/p\u003e\n\u003cp\u003eThanks for following along, and happy hacking, good buddy! \u003c/p\u003e\n\u003cp\u003e \u003c/p\u003e\n      ","metadata":{}}]