Introduction: The Small Hadron Collider
So you can't afford a Large Hadron Collider of your own? No, I can't either. Anyway, where would I put it? I've got enough clutter around here already.
So I decided to build a Small Hadron Collider, and now you too can build one of your very own! You can watch it in action here:
Watch the particles zip around the track and help them on their way, if you like, by tipping it one way or another. Watch them collide and interact in different ways, and eventually decay.
But what is the significance of the different colours and brightnesses, and how many different ways can they interact and decay? And can you spot an elusive particle of Dark Matter? There's a challenge on to see who can deduce the physical laws that control the particles, but until then, the source code remains a tightly guarded secret!
For best results you'll need the big 60 pixel Neopixel Ring from Adafruit (Far Eastern WS2812 clones should work though I haven't tried), but if you're on a budget you can use any smaller size, which the firmware will detect down to 12 pixels. The 24 pixel ring is a good compromise but will only show 2 particles at a time.
If you've already built my Glowy Disco Badge then this project uses the same hardware. All you'll need to do is load the firmware, and if you like, fit a larger Neopixel ring.
Step 1: The Parts You'll Need
You will need the following active parts:
- Arduino Pro Mini (5V 16MHz)
- MPU-9150 Accelerometer and Magnetometer
- Bidirectional 3.3/5V level converter.
Make sure they are as illustrated otherwise you will have to modify the layout. In particular, there is more than one type of level converter. The one I use is a 4 channel one (though we only need 2 channels). It has LV and Gnd as the middle two pins on one side, and HV and Gnd as the middle two on the other.
All of the above can be obtained cheaply from Far Eastern sellers.
There is a cool alternative MPU-9150 device from Drotek which includes an on-board level converter. This would make a neater finished product but at a higher total cost. You would also have to modify the layout and wiring (take SCL and SDA direct from the Arduino instead of through the level converter), and use the alternative firmware in Step 7.
For the display you will need:- Adafruit Neopixel Ring.
(There are similar but cheaper rings also based on the WS2812 chip or a clone, available from Far Eastern traders. These might work equally well but if you get a faulty one you might find it harder to get satisfaction from the seller.)
You will also need the following miscellaneous items:
- One piece of 65x95mm stripboard
- Solid and stranded connecting wire
2.54mm female SIL header socket strip.
There are many different ways you could mount the ring and house the electronics. Mine is very cheap and cheerful and not particularly to be recommended. (I'd spent all my pocket money on the Adafruit Neopixel ring.) I had a piece of 1/4 inch plywood left over after cutting a hole in the back door for the cat flap, which happened to be just the right size. A piece of acrylic would be much nicer, and if you use white or frosted or simply put a sheet of paper between the ring and the acrylic in front it will nicely hide the individual WS2812 pixel chips and diffuse their light somewhat.
Step 2: Tools
You will need to be able to solder, but that's not hard - there are plenty of Instructables and other materials online to get you started, such as this brilliantly simple and entertaining tutorial from Technology Will Save Us (though the safety instructions are a bit excessive and you don't actually need an expensive soldering iron).
For tools, you will need wire cutters, wire strippers, small pliers and a stripboard track-cutting tool, though with care you can use a small craft knife or scalpel. And of course, you'll need a soldering iron.
For programming you will need an FTDI232 serial/USB adapter and you will need to install the Arduino IDE on your computer.
Step 3: Adding Power
There are two ways of powering your Small Hadron Collider. If you have a rechargeable lithium power bank with a USB socket as designed for recharging a smartphone, you can use that. Get hold of a cheap USB charging or sync cable and cut off the unwanted connector. You can then solder the cut end directly to the stripboard, having made sure you correctly identify the 5V and Gnd wires.
The cheapest alternative is a 3V battery box taking 2 AA batteries, plus a 3 - 5V boost converter. If you use a converter (as shown) with a USB socket you can use it with a USB lead as above. Solder the red and black wires from the battery box to the IN+ and IN- pads (respectively) on the boost converter. Wrap them around the opposite end of the boost converter for strain relief, then insert it into a piece of heat shrink sleeving for protection. Warm with a hot air gun or hair-dryer to shrink the sleeving. Or you can wrap it in PVC insulating tape.
Step 4: Construction - 1
You can use the stripboard as it is, but we won't be needing it all so if you like you can cut it down to have 32 holes along the length of the copper strips and 20 holes across its width.
Using a stripboard track cutter or craft knife, cut the copper tracks at the positions marked by red dots in the diagram. To avoid mistakes you might like to mark the positions with a felt tip pen before starting to cut. (The components and the wiring to be fitted to the other side of the board in the next step are shown at 50% transparency.)
Before continuing, it's a good idea to examine the board with a magnifying glass to ensure that there are no remaining slivers of copper bridging any of the cuts, or bridging adjacent tracks.
To simplify programming, solder the SIL header socket strip to the 6 pads at one end of the Arduino Pro Micro (component side).
Cut 2 lengths of solid core wire around 3cm long, strip the insulation from one end of each, and solder them to the two pads inset from the side of the board, either side of the pad marked A3. Solder them on the under side of the board. (These pads are harder to solder to after the Arduino is fitted to the board.)
Step 5: Construction - 2
Solder the Arduino Pro Mini, IMU and level shifter to the stripboard as shown in the diagram as follows.
Strip a few centimetres of insulation from some solid core connecting wire. Place the Arduino Pro Mini in the correct position on the board and thread the wire through the board and then through the Arduino at one of the positions marked by a purple dot. Solder the wire to the Arduino on one side and to the copper strip on the other, making sure the Arduino is seated flat on the board. Trim the wire on both sides.
Repeat for all the other purple dots on the Arduino, and then likewise for the IMU and the level shifter.
The two wires soldered to the Arduino in the previous step can now be trimmed to length, the ends stripped, and soldered in position as shown in the diagram.
Using the solid core wire, complete all the other connections shown in purple.
Solder the positive and negative leads from your USB plug or boost converter to the copper tracks marked Vcc and Gnd respectively.
At this point it's a good idea to double check your wiring, and that you don't have any slivers of solder bridging adjacent tracks.
Step 6: Construction - 3
Connect the NeoPixel ring. You can use solid core connecting wire but stranded is probably better. I like to use just 4 strands of rainbow ribbon cable. The length will depend on how you are mounting the board and the ring.
All NeoPixel rings have just 4 connections marked Power (or Vcc), Gnd, Data-In (or IN) and Data-Out or (OUT). If using ribbon cable, split the wires at one end sufficiently to reach the NeoPixel connections. Solder the 4 wires (or 4 separate lengths of connecting wire) to the 4 NeoPixel connections.
Now solder the other ends of the wires to the stripboard as shown by the green connections in the diagram in the previous step.
The diagram shows a schematic of the completed project.
You are now ready to mount the board and the ring in whatever way you have chosen. Note that the ring and the components on the board must face in opposite directions. (On mine, they are fitted to opposite sides of the piece of plywood.) Also, the first pixel in the ring (fed directly from the D-IN connection) should be at the top (with the board the way up shown in the previous steps).
Step 7: Programming
For this you will need a FTDI232 serial/USB adapter. (If you have an Arduino Uno you should be able to programme it with that instead, but I'll have to leave you to work out how for yourself.) I assume you'll be using a Windows PC or laptop, though you could use a Mac or Linux by modifying this step.
You will also need the Arduino IDE installed on your computer, which you can download from the Arduino Download page. Check that it's installed in C:\Program Files (x86)\Arduino. If not, you will have to modify the file path at the end of this step.
Finally, you will need to know which COM port the FTDI adapter is using. If you don't know, launch Device Manager (from the Control Panel) and select Ports (COM & LPT). In my case, I get a line "USB Serial Port (COM10)" but you may get something different from COM10. Note what it is.
There are 2 versions of the firmware provided. If you're using the same or similar MPU-9150 board to the one shown in Step 1 and you followed my wiring, download the attached file SHC.hex to your Downloads folder.
Should you be using the Drotek MPU-9150 board or any other which uses address 0x69 instead of 0x68, or if you wired AD0 to 3.3V in order to allow you to add a DS1307 real time clock for other applications, then download the file SHC-0x69.hex instead. Use this file name instead of SHC.hex in the last command below.
Now launch a command prompt (If you're not sure how, check out this article.) You should get a prompt such as:
C:\Users\Philip>
(but with your login name instead of mine). Type the following commands. If your COM port isn't COM10, substitute your COM port in the first command, and if your Arduino IDE isn't installed in the same folder as mine, substitute your install folder in the second command.
set COM=COM10
set ARDUINO=C:\Program Files (x86)\Arduino
cd Downloads
dir
Check that the downloaded file SHC.hex appears in the file listing generated by the last of the commands above.
You are now ready to upload the code and start your Small Hadron Collider working! Make sure your FTDI adapter is plugged in to the Arduino and to your PC, copy the following command and paste it into the Command prompt. (To paste into a Command prompt, right-click on the title bar and select Edit - Paste.)
"%ARDUINO%\hardware\tools\avr/bin/avrdude" -C"%ARDUINO%\hardware\tools\avr/etc/avrdude.conf" -v -patmega328p -carduino -P%COM% -b57600 -D -Uflash:w:SHC.hex:i
You should see it writing then reading back the hex file, after which your Small Hadron Collider will spring to life! The FTDI adapter will power the board initially, but after disconnecting it, it will require its own power supply.
Should you just get rotating patterns, this means the Arduino has been unable to communicate with the IMU. Check your wiring. If you used a different MPU-9150 module it could mean that it uses address 0x69 instead of 0x68, as does the Drotek module. Try using the alternate firmware SHC-0x69.hex instead.
Attachments
Step 8: Going Further
As I said earlier, this project uses the same hardware as my previous Instructable, the Glowy Disco Badge, optionally with a different size Neopixel ring. You can very easily reprogramme it with the firmware for that.
Once someone has cracked the physics of the particles I will release a set of source files, which optionally incorporate both functions.
If you want to use it with different size Neopixel rings, you can connect them to the stripboard with a 90 degree pin strip on the board and female jumper leads connected to the ring. A great feature of this project is that it automatically detects the size of ring in use by counting pulses for missing pixels on the data-out line. But you must double check you've connected it correctly before switching on otherwise there is a risk of damaging the ring.
Adafruit recommend connecting a 1000μF 16v capacitor across the power connections to the Neopixel ring (negative side to Gnd) and a resistor (220Ω should do) in series with D-In. I've never found these necessary but should you get unreliable operation, certainly try the capacitor, and additionally a 22nF capacitor between Vcc and Gnd on the board. Try the resistor as well if you like though all I can see that that would do is reduce the likelihood of damage if you connect the ring incorrectly.
44 Comments
Question 1 year ago
I am Getting this error message:
C:\Users\saauj\Downloads>"%ARDUINO%\hardware\tools\avr/bin/avrdude" -C"%ARDUINO%\hardware\tools\avr/etc/avrdude.conf" -v -patmega328p -cavrispmkII -P%COM% -b57600 -D -Uflash:w:SHC-0x69.hex:i
avrdude: Version 6.3-20190619
Copyright (c) 2000-2005 Brian Dean, http://www.bdmicro.com/
Copyright (c) 2007-2014 Joerg Wunsch
System wide configuration file is "C:\Program Files (x86)\Arduino\hardware\tools\avr/etc/avrdude.conf"
Using Port : COM3
Using Programmer : avrispmkII
Overriding Baud Rate : 57600
avrdude: stk500v2_ReceiveMessage(): timeout
avrdude: stk500v2_ReceiveMessage(): timeout
avrdude: stk500v2_ReceiveMessage(): timeout
Please help me i need this to get working
thank you
it is the same with programmer: arduino
Answer 1 year ago
It looks like you may be using the wrong COM port. The correct one should only appear in Device Manager when you plug the Arduino in and disappear when you unplug it. My bed time now.
Reply 1 year ago
i checked i am using the right com posrt for sure other wise my other arduino.ino programs wont work
so that is not the problem
Reply 1 year ago
Try uploading the Blink sketch. Once it's finished uploading, scroll back through the lower pane of the Arduino IDE and find the last white line before the amber lines. This is the correct avrdude command to use, except for the hex file. Copy and paste the entire line (it goes off the right hand side of the window) into Notepad. Replace the hex file path (probably C:\Users\....\Blink.ino.hex) with SHC.hex. Copy and paste this into the command line. If you successfully uploaded Blink, the SHC should upload with thhat command. If not, double-check everything and study any error messages.
Question 1 year ago
i got the wiring done,
i cant seem to upload the hex file to the arduino,
i have avrdude installed
i can try to answer the questions:
the brightness repersents the stage of life(level 1, 2, etc) the particle
the different colours repersent different particles in the "lhc"
The particles can collide, decay into new particles and zip around the lhc
Answer 1 year ago
A good question gets a good reply. In formulating your question you will often see the answer for yourself. But if you just say "it doesn't seem to work" then it's hard for me to help you.
What happens when you try to upload the hex file? What response do you get to the commands you type? Do the error messages give you a clue? Did you read, understand and follow ALL the instructions?
In Step 7, Instructables messed up one of the code boxes. In the box begining SET COM = COM10, where it's got <br> that should be a new line. I've fixed it but I'm not certain it'll stay fixed. I've had that trouble with Instructables before. So that box should read:
set COM=COM10
set ARDUINO=C:\Program Files (x86)\Arduino
cd Downloads
dir
(Make sure you follow the instructions in the preceding paragraph.)
And the command in the next code box should be all on one line.
Question 1 year ago
pls reply
Answer 1 year ago
Please don't hassle me - I'll reply as soon as I can. I suspect I'm in a different time zone to you.
Question 1 year ago
pls reply
Question 1 year ago
i hope i can get the source code,
i think my theory is "qualitative"
thanks for the instructable
pls reply now i really want to get this thing working pls
Question 1 year ago
also i cant run the program can you tell me how to do it
please like in a video
Answer 1 year ago
I'm sorry, but my projects are not the type you can brainlessly follow and end up with a clone of my prototype but rather I expect you to understand what's going on and learn something. It's not hard.
You don't say what program you can't run. If it's the Arduino IDE there are plenty of Getting Started with Arduino tutorials and videos. I suggest you go through one of those before going any further.
In terms of wiring it up, Steps 4 and 5 tell you exactly how to do that but the principles are simple. Each connection between modules in the diagram in Step 6 can consist of a wire or a copper strip or a combination. Yes, you could make all the connections just with wires (though you'd still have to cut the strips where they would make unwanted connections) but you get the neatest layout by using the strips for the horizontal part of a connection and wires for the vertical part. In particular, it's convenient to dedicate 2 strips for Vcc and Gnd as several things connect to these.
Good luck, and keep persevering - you'll get there in the end!
Question 1 year ago
i only have 24 hours from now to complete
this project
Question 1 year ago
please reply fast
Question 1 year ago
can you send me a picture of the back side of the strip board
and send me video how to connect the wires plaease by today or tommorow
Question 1 year ago
can you give me a detailed explanation on how to connect the wires like why would you wire something to the strip board back to the strip board
and which connecting wires do you suggest
sorry for asking so many questions
Question 1 year ago
Can you use any Led Ring besides the Adafruit neopixel ring?
Please Reply now.
Thank you
Answer 1 year ago
Any WS2812 or compatible ring should do. Occasionally you might get a dead pixel so bargain basement from an unknown seller could be a false economy - your choice.
Question 2 years ago on Step 8
Can you use an arduino uno replace the pro mini?
Can you give me the link to the other products, and where i can buy them from?
Thanks
Answer 2 years ago
Yes, you can use a Uno - it's practically the same except that it effectively has the FTDI (used for programming) built in.
As for where to get parts, that depends what region you're in, but you should be able to get everything from eBay.